| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
ReWire.Monad
Description
This module defines operations related to monads in ReWire, including functions for defining looping monadic actions, and simplifying a tower of monad transformers down to the simple ReacT action required by rwc. It provides type synonyms for distinguishing looping devices and stateful devices that run indefinitely.
Synopsis
- iter :: (i -> o) -> i -> ReacT i o Identity ()
- iterSt :: (i -> s -> (o, s)) -> i -> ReacT i o (StateT s Identity) ()
- extrudeDev :: StateDev i o (StateT s Identity) -> s -> Dev i o
- extrudeStateDev :: forall (m :: Type -> Type) i o s. Monad m => StateDev i o (StateT s m) -> s -> StateDev i o m
- type Dev i o = ReacT i o Identity ()
- type StateDev i o (m :: Type -> Type) = ReacT i o m ()
Documentation
extrudeDev :: StateDev i o (StateT s Identity) -> s -> Dev i o Source #
Extrude a stateful device to remove the final StateT monad transformer.
extrudeStateDev :: forall (m :: Type -> Type) i o s. Monad m => StateDev i o (StateT s m) -> s -> StateDev i o m Source #
Extrude a stateful device to reduce the monad transformer tower.