data-accessor-0.2.3.1: Utilities for accessing and manipulating fields of records
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Accessor.MonadState

Description

Deprecated: please use Data.Accessor.Monad.Trans.State from data-accessor-transformers

Access helper functions in a State monad

Synopsis

Documentation

get :: forall (m :: Type -> Type) r a. Monad m => T r a -> StateT r m a Source #

lift :: forall (m :: Type -> Type) r s a. Monad m => T r s -> State s a -> StateT r m a Source #

modify :: forall (m :: Type -> Type) r a. Monad m => T r a -> (a -> a) -> StateT r m () Source #

(%=) :: forall (m :: Type -> Type) r a. Monad m => T r a -> a -> StateT r m () infix 1 Source #

Infix variant of set.

(%:) :: forall (m :: Type -> Type) r a. Monad m => T r a -> (a -> a) -> StateT r m () infix 1 Source #

Infix variant of modify.

set :: forall (m :: Type -> Type) r a. Monad m => T r a -> a -> StateT r m () Source #

getAndModify :: forall (m :: Type -> Type) r a. Monad m => T r a -> (a -> a) -> StateT r m a Source #

Modify a record element and return its old value.

modifyAndGet :: forall (m :: Type -> Type) r a. Monad m => T r a -> (a -> a) -> StateT r m a Source #

Modify a record element and return its new value.

liftT :: forall (m :: Type -> Type) r s a. Monad m => T r s -> StateT s m a -> StateT r m a Source #