| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Effect.Carrier.Internal.Stepped
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.
Constructors
| SteppedC | |
Fields
| |
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 #
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.
type SteppedThreads = FreeThreads Source #
SteppedThreads accepts the following primitive effects:
RegionalsOptionals(whensis a functor)UnravelpListenPrims(whensis aMonoid)ReaderPrimi