machines-0.6.2: Networked stream transducers

Safe HaskellNone
LanguageHaskell2010

Data.Machine.Lift

Description

Utilities for working with machines that run in transformed monads, inspired by Pipes.Lift.

Synopsis

Documentation

execStateM :: Monad m => s -> MachineT (StateT s m) k o -> MachineT m k o Source #

Given an initial state and a MachineT that runs in StateT s m, produce a MachineT that runs in m.

catchExcept :: Monad m => MachineT (ExceptT e m) k o -> (e -> MachineT (ExceptT e m) k o) -> MachineT (ExceptT e m) k o Source #

catchExcept allows a broken machine to be replaced without stopping the assembly line.

runReaderM :: Monad m => e -> MachineT (ReaderT e m) k o -> MachineT m k o Source #

Given an environment and a MachineT that runs in ReaderT e m, produce a MachineT that runs in m.