Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data FOEff e x where
- class (forall m n x. Coercible (e m x) (e n x)) => FirstOrder (e :: Effect)
- newtype SteppedC (e :: Effect) m a = SteppedC {
- unSteppedC :: FreeT (FOEff e) m a
- sendStepped :: e q a -> SteppedC e 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)
- liftSteps :: (MonadTrans t, Monad m) => Steps e m a -> Steps e (t m) a
- unsteps :: forall e m a. (FirstOrder e, Member e (Derivs m), Carrier m) => Steps e m a -> m a
- type SteppedThreads = FreeThreads
Documentation
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 |
newtype 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.
SteppedC | |
|
Instances
sendStepped :: e q a -> SteppedC e m a Source #
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 #
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.
type SteppedThreads = FreeThreads Source #
SteppedThreads
accepts the following primitive effects:
Regional
s
Optional
s
(whens
is a functor)Unravel
p
ListenPrim
o
(wheno
is aMonoid
)ReaderPrim
i