data-accessor-transformers-0.2.1.8: Use Accessor to access state in transformers State monad
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Accessor.Monad.Trans.State

Description

Access helper functions in a State monad

Synopsis

accessors in the form of actions in the state monad

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

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

modify :: forall (m :: Type -> Type) r a. Monad m => T r a -> (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.

(%=) :: 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.

lift a state monadic accessor to an accessor of a parent record

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

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