Lift values to an effect.
You can think this is a generalization of Lift.
Moduleextensible-effects-5.0.0.1Haskell2010
Control.Eff.Operational
Operational Monad (https://wiki.haskell.org/Operational) implemented with extensible effects.
Contents
Synopsis
- data Program
- value withOperational
- newtype Intrprtr
- value singleton
- value runProgram
- Packageextensible-effects-5.0.0.1
- Exports5
- LanguageHaskell2010
- LicenceMIT
- SourceOperational.hs
Embed a pure value
General form of an interpreter
Constructors
IntrprtrrunIntrprtr :: forall x. f x -> Eff r x
Lift a value to a monad.
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 . E.Writer.Strict.runMonoidWriter $ E.State.Strict.evalState comp ["foo","bar"]
runLift $ runProgram adventIO prog