A monad that can perform concurrent or parallel IO operations. Streams that can be composed concurrently require the underlying monad to be MonadAsync.
Modulestreamly-0.10.1Haskell2010
Streamly.Internal.Control.Concurrent
- 3 types
- 3 values
- Packagestreamly-0.10.1
- Exports7
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceConcurrent.hs
When we run computations concurrently, we completely isolate the state of the concurrent computations from the parent computation. The invariant is that we should never be running two concurrent computations in the same thread without using the runInIO function. Also, we should never be running a concurrent computation in the parent thread, otherwise it may affect the state of the parent which is against the defined semantics of concurrent execution.
Construct a m computation from the monadic state of m that is
returned from a RunInBase function.
Instances should satisfy:
liftBaseWith (\runInBase -> runInBase m) >>= restoreM = mrestoreM is usually not implemented directly, but using
defaultRestoreM.