HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Moduleextensible-effects-5.0.0.1Haskell2010

Control.Eff.Operational

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

Contents
  1. Usage
Synopsis
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']

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