alternators-0.1.1.1: Handy functions when using transformers

Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Trans.State.Lazy.Extras

Synopsis

Documentation

maybeState :: Monad m => StateT s (MaybeT m) a -> MaybeT (StateT s m) a Source #

The problem with StateT s (MaybeT m) a is that on failure, the original state is lost. A more useful type is MaybeT (StateT s m) a which at least keeps the original input state on failure.

exceptState :: Monad m => StateT s (ExceptT e m) a -> ExceptT e (StateT s m) a Source #

The problem with StateT s (ExceptT e m) a is that on failure, the original state is lost. A more useful type is ExceptT e (StateT s m) a which at least keeps the original input state on failure.