monoid-transformer-0.0.2: Monoid counterparts to some ubiquitous monad transformers

Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Monoid.State

Synopsis

Documentation

newtype T s a Source

This resembles the pure State monad. However, State in transformers is a StateT and mtl is not Haskell 98.

I hope I have the more natural parameter order for evaluate in contrast to mtl and transformers. However, it is different from the parameter order of run.

Constructors

Cons 

Fields

run :: s -> (a, s)
 

Instances

Functor (T s) 
C (T s) 
Monoid a => Monoid (T s a) 

pure :: a -> T s a Source

evaluate :: s -> T s a -> a Source

execute :: s -> T s a -> s Source

put :: Monoid a => s -> T s a Source

modify :: Monoid a => (s -> s) -> T s a Source

mapFst :: (a -> c) -> (a, b) -> (c, b) Source