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

Safe HaskellSafe
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.

Could also be written as Monoid.Applicative (Monad.Trans.State s) a.

Constructors

Cons 

Fields

  • run :: s -> (a, s)
     

Instances

Functor (T s) Source # 

Methods

fmap :: (a -> b) -> T s a -> T s b #

(<$) :: a -> T s b -> T s a #

C (T s) Source # 

Methods

lift :: Monoid m => m -> T s m Source #

Semigroup a => Semigroup (T s a) Source # 

Methods

(<>) :: T s a -> T s a -> T s a #

sconcat :: NonEmpty (T s a) -> T s a #

stimes :: Integral b => b -> T s a -> T s a #

Monoid a => Monoid (T s a) Source # 

Methods

mempty :: T s a #

mappend :: T s a -> T s a -> T s a #

mconcat :: [T s a] -> 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 #