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
.
forall a . Program (instr a) (a -> v) |
singleton :: (Typeable instr, Member (Program instr) r) => instr a -> Eff r a Source
Lift a value to a monad.
runProgram :: Typeable f => (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 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 putStrLn . fst .run
.runMonoidWriter
.evalState
["foo","bar"] $runProgram
adventPure progrunLift
$runProgram
adventIO prog