stateful-mtl-1.0: Stateful monad transformers with pure evaluation semantics.



A monad transformer that cleanly generalizes out implementation details of array manipulation in an array transformer. In general, this is likely to be the most efficient array transformer implementation made available in this library, but if improperly used, elements of this implementation may lead to segfaults.



data ArrayT e m a Source

Monad transformer that safely grants the underlying monad access to a mutable array.


MonadReader r m => MonadReader r (ArrayT e m) 
MonadState s m => MonadState s (ArrayT e m) 
MonadWriter w m => MonadWriter w (ArrayT e m) 
MonadST s m => MonadST s (ArrayT e m) 
Monad m => MonadArray e (ArrayT e m) 
MonadTrans (ArrayT e) 
Monad m => Monad (ArrayT e m) 
MonadFix m => MonadFix (ArrayT e m) 
MonadPlus m => MonadPlus (ArrayT e m) 
MonadIO m => MonadIO (ArrayT e m) 

data ArrayM e a Source




:: Monad m 
=> Int

Initial array size.

-> e

Default array element.

-> ArrayT e m a

Array transformer.

-> m a

Monadically bound output.

Safely performs a monadic computation that statefully modifies a one-dimensional array with the specified default element.

runArrayT_ :: Monad m => Int -> ArrayT e m a -> m aSource

runArrayM :: Int -> e -> ArrayM e a -> aSource

runArrayM_ :: Int -> ArrayM e a -> aSource