| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Control.Monad.Ology.General.Coroutine
Synopsis
- class Monad m => MonadCoroutine (m :: Type -> Type) where
- coroutineSuspend :: ((p -> m q) -> m r) -> CoroutineT p q m r
- type With (m :: k -> Type) t = forall (r :: k). (t -> m r) -> m r
- unpickWith :: MonadCoroutine m => With m a -> m (a, m ())
- pickWith :: Monad m => m (a, m ()) -> With m a
Documentation
class Monad m => MonadCoroutine (m :: Type -> Type) where Source #
Monads in which one can do coroutines.
Methods
coroutineSuspend :: ((p -> m q) -> m r) -> CoroutineT p q m r Source #
Instances
| MonadCoroutine IO Source # | Uses threads. |
Defined in Control.Monad.Ology.General.Coroutine Methods coroutineSuspend :: ((p -> IO q) -> IO r) -> CoroutineT p q IO r Source # | |
| (MonadTransTunnel t, MonadCoroutine m) => MonadCoroutine (t m) Source # | |
Defined in Control.Monad.Ology.General.Coroutine Methods coroutineSuspend :: ((p -> t m q) -> t m r) -> CoroutineT p q (t m) r Source # | |
type With (m :: k -> Type) t = forall (r :: k). (t -> m r) -> m r Source #
A type synoynm for a common pattern for closing opened resources, e.g.
withFile,
withBinaryFile,
etc.
unpickWith :: MonadCoroutine m => With m a -> m (a, m ()) Source #