HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleextensible-effects-5.0.0.1Haskell2010

Control.Eff.Operational

Operational Monad (https://wiki.haskell.org/Operational) implemented with extensible effects.

  • 2 types
  • 3 values
datadata Program (instr :: k -> Type) (v :: k) where
#

Lift values to an effect. You can think this is a generalization of Lift.

Constructors

Instances1Handle
  • Handle (Program f) r a (Intrprtr f r' -> Eff r' a)Defined in extensible-effects-5.0.0.1 · Control.Eff.Operational

    Given a continuation and a program, interpret it Usually, we have r ~ [Program f : r']

newtypenewtype Intrprtr (f :: Type -> Type) (r :: [Type -> Type])
#

General form of an interpreter

Constructors

Instances1Handle
  • Handle (Program f) r a (Intrprtr f r' -> Eff r' a)Defined in extensible-effects-5.0.0.1 · Control.Eff.Operational

    Given a continuation and a program, interpret it Usually, we have r ~ [Program f : r']

Usage

0 declarations

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