mtlx-0.1: Monad transformer library with type indexes, providing 'free' copies.

Portabilitynon-portable (multi-param classes, functional dependencies)
Stabilityexperimental
MaintainerMark Snyder, marks@ittc.ku.edu

Control.Monad.StateX.Strict

Contents

Description

Strict state monads.

Synopsis

Documentation

The StateX Monad

data Index ix => StateX ix s a Source

Constructors

StateX ix (s -> (a, s)) 

Instances

Index ix => MonadStateX ix s (StateX ix s) 
Index ix => Monad (StateX ix s) 
Index ix => Functor (StateX ix s) 
Index ix => MonadFix (StateX ix s) 

runStateX :: Index ix => ix -> StateX ix s a -> s -> (a, s)Source

evalStatex :: Index ix => ix -> StateX ix s a -> s -> aSource

execStatex :: Index ix => ix -> StateX ix s a -> s -> sSource

mapStatex :: Index ix => ix -> ((a, s) -> (b, s)) -> StateX ix s a -> StateX ix s bSource

withStatex :: Index ix => ix -> (s -> s) -> StateX ix s a -> StateX ix s aSource

The StateTX Monad

data Index ix => StateTX ix s m a Source

Constructors

StateTX ix (s -> m (a, s)) 

Instances

(Index ixs, MonadReaderX ixr r m) => MonadReaderX ixr r (StateTX ixs st m) 
(Index ix1, Index ix2, MonadStateX ix1 s1 m) => MonadStateX ix1 s1 (StateTX ix2 s2 m) 
(Monad m, Index ix) => MonadStateX ix s (StateTX ix s m) 
(Index ixs, MonadWriterX ixw w m) => MonadWriterX ixw w (StateTX ixs s m) 
(MonadErrorX ixe e m, Index ixe, Index ixs) => MonadErrorX ixe e (StateTX ixs s m) 
(Index ix, MonadReader r m) => MonadReader r (StateTX ix st m) 
(MonadState s1 m, Index ix) => MonadState s1 (StateTX ix s2 m) 
(MonadError e m, Index ix) => MonadError e (StateTX ix s m) 
(Index ix, MonadWriter w m) => MonadWriter w (StateTX ix s m) 
Index ix => MonadTrans (StateTX ix s) 
(Monad m, Index ix) => Monad (StateTX ix s m) 
(Monad m, Index ix) => Functor (StateTX ix s m) 
(MonadFix m, Index ix) => MonadFix (StateTX ix s m) 
(MonadPlus m, Index ix) => MonadPlus (StateTX ix s m) 
(MonadCont m, Index ix) => MonadCont (StateTX ix s m) 
(MonadIO m, Index ix) => MonadIO (StateTX ix s m) 

runStateTX :: Index ix => ix -> StateTX ix s m a -> s -> m (a, s)Source

evalStateTX :: (Monad m, Index ix) => ix -> StateTX ix s m a -> s -> m aSource

execStateTX :: (Monad m, Index ix) => ix -> StateTX ix s m a -> s -> m sSource

mapStateTX :: Index ix => ix -> (m (a, s) -> n (b, s)) -> StateTX ix s m a -> StateTX ix s n bSource

withStateTX :: Index ix => ix -> (s -> s) -> StateTX ix s m a -> StateTX ix s m aSource