Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Operational Monad (https://wiki.haskell.org/Operational) implemented with extensible effects.
Documentation
data Program instr v where Source #
Lift values to an effect.
You can think this is a generalization of Lift
.
runProgram :: forall f r a. (forall x. f x -> Eff r x) -> Eff (Program f ': r) a -> Eff r a Source #
Convert values using given interpreter to effects.
Usage
See Control.Eff.Operational.Example for an example of defining data using GADTs and implementing interpreters from the data to effects.
To use the interpreter, see below or consult the tests.
main :: IO () main = do let comp =runProgram
adventPure prog putStrLn . fst .run
.runMonoidWriter
$evalState
comp ["foo","bar"]runLift
$runProgram
adventIO prog