robrix
Heinrich Apfelmus gives a [compelling account][operational monad] of a monad he calls `Program`, which is essentially the same as `Freer`. My favourite thing about his discussion is how smart constructors come out: ```haskell data Program instr a where Then :: instr a -> (a -> Program instr b) -> Program instr b Return :: a -> Program instr a data StackInstruction a where Pop :: StackInstruction Int Push :: Int -> StackInstruction () type StackProgram = Program StackInstruction pop :: StackProgram Int pop = Pop `Then` Return push :: Int -> StackProgram Int push i = Push i `Then` Return ``` This is blissfully lucid. I’d like to see high-level documentation (and possibly API) with this vocabulary. [operational monad]: http://apfelmus.nfshost.com/articles/operational-monad.html