unification-fd-0.9.0: Simple generic unification algorithms.

Portabilitysemi-portable (MPTCs)
Stabilityperpetually unstable
Maintainerwren@community.haskell.org
Safe HaskellSafe-Inferred

Control.Monad.State.UnificationExtras

Contents

Description

This module defines some extra functions for Control.Monad.State.Lazy. This package really isn't the proper place for these, but we need them to be somewhere.

TODO: patch transformers/mtl-2 with these functions.

Synopsis

Additional functions for MTL

liftReader :: Reader e a -> State e aSource

Lift a reader into a state monad. More particularly, this allows disabling mutability in a local context within State.

liftReaderT :: Monad m => ReaderT e m a -> StateT e m aSource

Lift a reader into a state monad. More particularly, this allows disabling mutability in a local context within StateT.

modify' :: MonadState s m => (s -> s) -> m ()Source

A strict version of modify.

localState :: MonadState s m => m a -> m aSource

Run a state action and undo the state changes at the end.