data-accessor-0.2.3.1: Utilities for accessing and manipulating fields of records

Safe Haskell | Safe-Inferred
Language | Haskell98

Data.Accessor.MonadState

Description

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

Access helper functions in a State monad

Synopsis

- get :: forall (m :: Type -> Type) r a. Monad m => T r a -> StateT r m a
- lift :: forall (m :: Type -> Type) r s a. Monad m => T r s -> State s a -> StateT r m a
- modify :: forall (m :: Type -> Type) r a. Monad m => T r a -> (a -> a) -> StateT r m ()
- (%=) :: forall (m :: Type -> Type) r a. Monad m => T r a -> a -> StateT r m ()
- (%:) :: forall (m :: Type -> Type) r a. Monad m => T r a -> (a -> a) -> StateT r m ()
- set :: forall (m :: Type -> Type) r a. Monad m => T r a -> a -> StateT r m ()
- getAndModify :: forall (m :: Type -> Type) r a. Monad m => T r a -> (a -> a) -> StateT r m a
- modifyAndGet :: forall (m :: Type -> Type) r a. Monad m => T r a -> (a -> a) -> StateT r m a
- liftT :: forall (m :: Type -> Type) r s a. Monad m => T r s -> StateT s m a -> StateT r m a

# 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 #