foundation-0.0.29: Alternative prelude with batteries and no dependencies
Safe Haskell None
Language Haskell2010

Foundation.Monad.State

Synopsis

MonadState

class Monad m => MonadState m where Source #

Associated Types

type State m Source #

Methods

withState :: ( State m -> (a, State m)) -> m a Source #

StateT

data StateT s m a Source #

State Transformer

Instances

Instances details
MonadTrans ( StateT s) Source #
Instance details

Defined in Foundation.Monad.State

Methods

lift :: Monad m => m a -> StateT s m a Source #

( Functor m, Monad m) => Monad ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

Functor m => Functor ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

Methods

fmap :: (a -> b) -> StateT s m a -> StateT s m b Source #

(<$) :: a -> StateT s m b -> StateT s m a Source #

( Functor m, MonadFix m) => MonadFix ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

Methods

mfix :: (a -> StateT s m a) -> StateT s m a Source #

( Applicative m, Monad m) => Applicative ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

( Functor m, MonadIO m) => MonadIO ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

( Functor m, MonadFailure m) => MonadFailure ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

Associated Types

type Failure ( StateT s m) Source #

( Functor m, MonadCatch m) => MonadCatch ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

Methods

catch :: Exception e => StateT s m a -> (e -> StateT s m a) -> StateT s m a Source #

( Functor m, MonadThrow m) => MonadThrow ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

( Functor m, Monad m) => MonadState ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

Associated Types

type State ( StateT s m) Source #

type Failure ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

type State ( StateT s m) Source #
Instance details

Defined in Foundation.Monad.State

type State ( StateT s m) = s

runStateT :: StateT s m a -> s -> m (a, s) Source #