Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Operational Monad (https://wiki.haskell.org/Operational) implemented with extensible effects.
Documentation
Lift values to an effect.
You can think this is a generalization of Lift
.
Program (instr a) (a -> v) |
runProgram :: (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