| Safe Haskell | None |
|---|
Control.Monad.Operational.Simple
Description
A simpler, non-transformer version of this package's
Control.Monad.Operational's Program type, using Free
directly.
- module Control.Operational.Class
- newtype Program instr a = Program {}
- interpret :: forall m instr a. (Functor m, Monad m) => (forall x. instr x -> m x) -> Program instr a -> m a
- fromProgram :: (Operational instr m, Functor m, Monad m) => Program instr a -> m a
- data ProgramView instr a where
- Return :: a -> ProgramView instr a
- :>>= :: instr a -> (a -> Program instr b) -> ProgramView instr b
- view :: Program instr a -> ProgramView instr a
Documentation
module Control.Operational.Class
newtype Program instr a Source
Instances
| Operational instr (Program instr) | |
| Monad (Program instr) | |
| Functor (Program instr) | |
| Applicative (Program instr) |
interpret :: forall m instr a. (Functor m, Monad m) => (forall x. instr x -> m x) -> Program instr a -> m aSource
fromProgram :: (Operational instr m, Functor m, Monad m) => Program instr a -> m aSource
Lift a Program to any Operational instance at least as
powerful as Monad.
data ProgramView instr a whereSource
Constructors
| Return :: a -> ProgramView instr a | |
| :>>= :: instr a -> (a -> Program instr b) -> ProgramView instr b |
view :: Program instr a -> ProgramView instr aSource