Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SteppedC (e :: Effect) m a
- data Steps (e :: Effect) m a where
- steps :: forall e m a p. (Carrier m, Threaders '[SteppedThreads] m p) => SteppedC e m a -> m (Steps e m a)
- unsteps :: forall e m a. (FirstOrder e, Member e (Derivs m), Carrier m) => Steps e m a -> m a
- liftSteps :: (MonadTrans t, Monad m) => Steps e m a -> Steps e (t m) a
- class (forall m n x. Coercible (e m x) (e n x)) => FirstOrder (e :: Effect)
- type SteppedThreads = FreeThreads
Documentation
data SteppedC (e :: Effect) m a Source #
A carrier for any first-order effect e
that allows for
dividing a computation into several steps, where
each step is seperated by the use of the effect.
This can be used to implement coroutines.
Instances
data Steps (e :: Effect) m a where Source #
A stack of continuations of m
that eventually produces a result of type a
.
Each continuation is seperated by the use of the effect e
.
steps :: forall e m a p. (Carrier m, Threaders '[SteppedThreads] m p) => SteppedC e m a -> m (Steps e m a) Source #
Run the first-order effect e
by breaking the computation using it
into steps, where each step is seperated by the use of an action of e
.
unsteps :: forall e m a. (FirstOrder e, Member e (Derivs m), Carrier m) => Steps e m a -> m a Source #
Execute all the steps of a computation.
class (forall m n x. Coercible (e m x) (e n x)) => FirstOrder (e :: Effect) Source #
A constraint that e
is first-order.
This is automatically deduced by the compiler.
Instances
(forall (m :: Type -> Type) (n :: Type -> Type) x. Coercible (e m x) (e n x)) => FirstOrder e Source # | |
Defined in Control.Effect.Carrier.Internal.Stepped |
type SteppedThreads = FreeThreads Source #
SteppedThreads
accepts the following primitive effects:
Regional
s
Optional
s
(whens
is a functor)Unravel
p
ListenPrim
s
(whens
is aMonoid
)ReaderPrim
i