freer-0.2.4.1: Implementation of the Freer Monad

CopyrightAllele Dev 2016
LicenseBSD-3
Maintainerallele.dev@gmail.com
Stabilitybroken
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Freer.Coroutine

Description

An effect to compose functions with the ability to yield.

Using http://okmij.org/ftp/Haskell/extensible/Eff1.hs as a starting point.

Synopsis

Documentation

data Yield a b v Source #

A type representing a yielding of control a: The current type b: The input to the continuation function v: The output of the continuation

Instances

Functor (Yield a b) Source # 

Methods

fmap :: (a -> b) -> Yield a b a -> Yield a b b #

(<$) :: a -> Yield a b b -> Yield a b a #

yield :: Member (Yield a b) r => a -> (b -> c) -> Eff r c Source #

Lifts a value and a function into the Coroutine effect

data Status r a b Source #

Status of a thread: done or reporting the value of the type a and resuming with the value of type b

Constructors

Done 
Continue a (b -> Eff r (Status r a b)) 

runC :: Eff (Yield a b ': r) w -> Eff r (Status r a b) Source #

Launch a thread and report its status