-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include strict-stm, strict-mvar and si-timers into io-classes
`strict-mvar:test` is left in `test-strict-mvar` as it introduces a cycle between `io-sim` and `io-classes` which cabal cannot resolve.
- Loading branch information
Showing
43 changed files
with
204 additions
and
747 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ author: Alexander Vieth, Duncan Coutts, Marcin Szamotulski, Thomas | |
maintainer: Duncan Coutts [email protected], Marcin Szamotulski [email protected] | ||
category: Control | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md README.md | ||
extra-doc-files: CHANGELOG.md README.md strict-stm/README.md strict-mvar/README.md | ||
bug-reports: https://github.com/input-output-hk/io-sim/issues | ||
tested-with: GHC == { 8.10, 9.2, 9.4, 9.6, 9.8, 9.10 } | ||
|
||
|
@@ -106,3 +106,98 @@ library | |
|
||
if flag(asserts) | ||
ghc-options: -fno-ignore-asserts | ||
|
||
library strict-stm | ||
visibility: public | ||
hs-source-dirs: strict-stm | ||
|
||
exposed-modules: Control.Concurrent.Class.MonadSTM.Strict | ||
Control.Concurrent.Class.MonadSTM.Strict.TArray | ||
Control.Concurrent.Class.MonadSTM.Strict.TBQueue | ||
Control.Concurrent.Class.MonadSTM.Strict.TChan | ||
Control.Concurrent.Class.MonadSTM.Strict.TMVar | ||
Control.Concurrent.Class.MonadSTM.Strict.TQueue | ||
Control.Concurrent.Class.MonadSTM.Strict.TVar | ||
reexported-modules: Control.Concurrent.Class.MonadSTM.TSem as Control.Concurrent.Class.MonadSTM.Strict.TSem | ||
default-language: Haskell2010 | ||
default-extensions: ImportQualifiedPost | ||
build-depends: base >= 4.9 && <4.21, | ||
array, | ||
stm >= 2.5 && <2.6, | ||
|
||
io-classes:io-classes, | ||
ghc-options: -Wall | ||
-Wno-unticked-promoted-constructors | ||
-Wcompat | ||
-Wincomplete-uni-patterns | ||
-Wincomplete-record-updates | ||
-Wpartial-fields | ||
-Widentities | ||
|
||
if flag(asserts) | ||
ghc-options: -fno-ignore-asserts | ||
|
||
library strict-mvar | ||
visibility: public | ||
hs-source-dirs: strict-mvar/src | ||
|
||
exposed-modules: Control.Concurrent.Class.MonadMVar.Strict | ||
default-language: Haskell2010 | ||
default-extensions: ImportQualifiedPost | ||
build-depends: base >= 4.9 && <4.21, | ||
io-classes:io-classes, | ||
ghc-options: -Wall | ||
-Wno-unticked-promoted-constructors | ||
-Wcompat | ||
-Wincomplete-uni-patterns | ||
-Wincomplete-record-updates | ||
-Wpartial-fields | ||
-Widentities | ||
|
||
library si-timers | ||
import: warnings | ||
visibility: public | ||
hs-source-dirs: si-timers/src | ||
exposed-modules: Control.Monad.Class.MonadTime.SI | ||
Control.Monad.Class.MonadTimer.SI | ||
other-modules: Control.Monad.Class.MonadTimer.NonStandard | ||
default-language: Haskell2010 | ||
default-extensions: ImportQualifiedPost | ||
other-extensions: BangPatterns, | ||
CPP, | ||
ConstraintKinds, | ||
DefaultSignatures, | ||
DeriveGeneric, | ||
NumericUnderscores, | ||
ScopedTypeVariables, | ||
TypeFamilies | ||
build-depends: base >=4.9 && <4.21, | ||
deepseq, | ||
mtl, | ||
nothunks, | ||
stm, | ||
time >=1.9.1 && <1.13, | ||
|
||
io-classes:io-classes | ||
^>=1.5 | ||
if flag(asserts) | ||
ghc-options: -fno-ignore-asserts | ||
|
||
-- Since `io-sim` depends on `si-times` (`io-sim` depends on `Time`) some tests of | ||
-- are in `io-sim:test`: this is a good enough reason to pull `io-sim:test` | ||
-- into a seprate package. | ||
test-suite test-si-timers | ||
import: warnings | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: si-timers/test | ||
main-is: Main.hs | ||
other-modules: Test.MonadTimer | ||
default-language: Haskell2010 | ||
default-extensions: ImportQualifiedPost | ||
build-depends: base, | ||
|
||
QuickCheck, | ||
tasty, | ||
tasty-quickcheck, | ||
|
||
si-timers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# [SI] Timers | ||
|
||
The `io-classes:si-timers` package provides delays & timeouts which are safe on | ||
32-bit systems; cancellable timeouts (see `registerDelayCancellable`); | ||
a refined interface for monotonic `Time`. `Time` is given with left monoid | ||
action of `DiffTime` (which encodes the notion of time differences). The | ||
`MonadMonotonicTime`, `MonadDelay` type classes & `MonadTimers` (type synonym) | ||
API provide a consistent interface for working with delays and timeouts. | ||
|
||
`io-classes:si-timers` package also defined a low level `MonadTimout` type | ||
class. On system with a native timer manager (e.g. `Linux`, `MacOS`, | ||
`FreeBSD`), it's very efficient but for other platforms (e.g. `Windows`), it | ||
might not be the right API for low latency timeouts needed for example for low | ||
level networking code, because it relies on `GHC`'s `RTS` thread scheduling. | ||
|
||
`io-classes:si-timers` are compatible with `io-sim`. | ||
|
||
The `SI` comes from the [International System of Units][SI]. | ||
|
||
[SI]: https://www.wikiwand.com/en/International_System_of_Units | ||
[`io-sim`]: https://hackage.haskell.org/package/io-sim |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Strict Mutable Variables | ||
|
||
The `io-classes:strict-mvar` package provides a strict interface to mutable | ||
variables (`MVar`). It builds on top of `io-classes:io-classes`, and thus it | ||
provides the interface for `MVar`s implementations from both | ||
[base](https://hackage.haskell.org/package/base-4.17.0.0/docs/Control-Concurrent-MVar.html) | ||
and [io-sim](https://github.com/input-output-hk/io-sim). |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.