hs-ix-0.2.0.0: Indexed applicative functors and monads
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Indexed.Trans.State

Description

The indexed state transformer: each StateT _ i j term takes an input of type i and gives an output of type j.

Documentation

newtype StateT f i j a Source #

Constructors

StateT 

Fields

Instances

Instances details
Monad m => Bind (StateT m :: Type -> Type -> Type -> Type) Source # 
Instance details

Defined in Control.Monad.Indexed.Trans.State

Methods

join :: forall (i :: k) (j :: k) (k :: k) a. StateT m i j (StateT m j k a) -> StateT m i k a Source #

(>>=) :: forall (i :: k) (j :: k) a (k :: k) b. StateT m i j a -> (a -> StateT m j k b) -> StateT m i k b Source #

Monad m => Apply (StateT m :: Type -> Type -> Type -> Type) Source # 
Instance details

Defined in Control.Monad.Indexed.Trans.State

Methods

(<*>) :: forall (i :: k) (j :: k) a b (k :: k). StateT m i j (a -> b) -> StateT m j k a -> StateT m i k b Source #

(*>) :: forall (i :: k) (j :: k) a (k :: k) b. StateT m i j a -> StateT m j k b -> StateT m i k b Source #

(<*) :: forall (i :: k) (j :: k) a (k :: k) b. StateT m i j a -> StateT m j k b -> StateT m i k a Source #

liftA2 :: forall a b c (i :: k) (j :: k) (k :: k). (a -> b -> c) -> StateT m i j a -> StateT m j k b -> StateT m i k c Source #

Monad m => Monad (StateT m k k) Source # 
Instance details

Defined in Control.Monad.Indexed.Trans.State

Methods

(>>=) :: StateT m k k a -> (a -> StateT m k k b) -> StateT m k k b #

(>>) :: StateT m k k a -> StateT m k k b -> StateT m k k b #

return :: a -> StateT m k k a #

Functor f => Functor (StateT f i j) Source # 
Instance details

Defined in Control.Monad.Indexed.Trans.State

Methods

fmap :: (a -> b) -> StateT f i j a -> StateT f i j b #

(<$) :: a -> StateT f i j b -> StateT f i j a #

MonadFix m => MonadFix (StateT m k k) Source # 
Instance details

Defined in Control.Monad.Indexed.Trans.State

Methods

mfix :: (a -> StateT m k k a) -> StateT m k k a #

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

Defined in Control.Monad.Indexed.Trans.State

Methods

pure :: a -> StateT m k k a #

(<*>) :: StateT m k k (a -> b) -> StateT m k k a -> StateT m k k b #

liftA2 :: (a -> b -> c) -> StateT m k k a -> StateT m k k b -> StateT m k k c #

(*>) :: StateT m k k a -> StateT m k k b -> StateT m k k b #

(<*) :: StateT m k k a -> StateT m k k b -> StateT m k k a #

MonadPlus m => Alternative (StateT m k k) Source # 
Instance details

Defined in Control.Monad.Indexed.Trans.State

Methods

empty :: StateT m k k a #

(<|>) :: StateT m k k a -> StateT m k k a -> StateT m k k a #

some :: StateT m k k a -> StateT m k k [a] #

many :: StateT m k k a -> StateT m k k [a] #

MonadPlus m => MonadPlus (StateT m k k) Source # 
Instance details

Defined in Control.Monad.Indexed.Trans.State

Methods

mzero :: StateT m k k a #

mplus :: StateT m k k a -> StateT m k k a -> StateT m k k a #

lift :: Functor f => f a -> StateT f k k a Source #

mapStateT :: (f (a, j) -> g (b, k)) -> StateT f i j a -> StateT g i k b Source #

modify :: Applicative p => (i -> j) -> StateT p i j i Source #

modifyF :: Functor f => (i -> f j) -> StateT f i j i Source #

get :: Applicative p => StateT p k k k Source #

put :: Applicative p => j -> StateT p i j () Source #

liftCallCC :: CallCC f g h (a, i) (b, j) (c, k) (d, l) -> CallCC (StateT f e j) (StateT g i k) (StateT h i l) a b c d Source #

liftCatch :: Catch e f g h (a, i) (b, j) (c, k) -> Catch e (StateT f l i) (StateT g l j) (StateT h l k) a b c Source #

liftListen :: Functor f => Listen w f (a, j) b -> Listen w (StateT f i j) a (i -> b) Source #

liftPass :: Functor f => Pass z f g (a, k) (b, j) -> Pass z (StateT f i k) (StateT g i j) a b Source #