Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class Monad m => MonadCoroutine m where
- coroutineSuspend :: ((p -> m q) -> m r) -> CoroutineT p q m r
- type With (m :: Type -> Type) (t :: Type) = forall (r :: Type). (t -> m r) -> m r
- unpickWith :: forall m a. MonadCoroutine m => With m a -> m (a, m ())
Documentation
class Monad m => MonadCoroutine m where Source #
Monads in which one can do coroutines.
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 coroutineSuspend :: ((p -> IO q) -> IO r) -> CoroutineT p q IO r Source # | |
(MonadTransUnlift t, MonadCoroutine m, MonadTunnelIOInner m, Monad (t m)) => MonadCoroutine (t m) Source # | |
Defined in Control.Monad.Ology.General.Coroutine coroutineSuspend :: ((p -> t m q) -> t m r) -> CoroutineT p q (t m) r Source # |
type With (m :: Type -> Type) (t :: Type) = forall (r :: Type). (t -> m r) -> m r Source #
A type synoynm for a common pattern for closing opened resources, e.g.
withFile
,
withBinaryFile
,
etc.
unpickWith :: forall m a. MonadCoroutine m => With m a -> m (a, m ()) Source #