effin-0.3.0.3: A Typeable-free implementation of extensible effects

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Coroutine

Synopsis

Documentation

class MemberEffect Coroutine (Coroutine i o) l => EffectCoroutine i o l Source #

Instances

MemberEffect (* -> * -> * -> *) Coroutine (Coroutine i o) l => EffectCoroutine i o l Source # 

data Coroutine i o a Source #

An effect describing a suspendable computation.

Instances

type Is (* -> * -> * -> *) Coroutine f Source # 
type Is (* -> * -> * -> *) Coroutine f

runCoroutine :: Effect (Coroutine i o :+ l) a -> Effect l (Iterator i o l a) Source #

Converts a Coroutine effect into an Iterator.

suspend :: EffectCoroutine i o l => i -> Effect l o Source #

Suspends the current computation by providing a value of type i and then waiting for a value of type o.

data Iterator i o l a Source #

A suspended computation.

Constructors

Done a

Describes a finished computation.

Next (o -> Effect l (Iterator i o l a)) i

Describes a computation that provided a value of type i and awaits a value of type o.

evalIterator :: Iterator i o l a -> [o] -> Effect l (Iterator i o l a, [i]) Source #

Evaluates an iterator by providing it with an input stream.