hgeometry-combinatorial-0.12.0.2: Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Control.Monad.State.Persistent

Description

 
Synopsis

Documentation

data PersistentStateT s m a Source #

A State monad that can store earlier versions of the state.

Instances

Instances details
Monad m => MonadState s (PersistentStateT s m) Source # 
Instance details

Defined in Control.Monad.State.Persistent

Methods

get :: PersistentStateT s m s #

put :: s -> PersistentStateT s m () #

state :: (s -> (a, s)) -> PersistentStateT s m a #

Monad m => Monad (PersistentStateT s m) Source # 
Instance details

Defined in Control.Monad.State.Persistent

Methods

(>>=) :: PersistentStateT s m a -> (a -> PersistentStateT s m b) -> PersistentStateT s m b #

(>>) :: PersistentStateT s m a -> PersistentStateT s m b -> PersistentStateT s m b #

return :: a -> PersistentStateT s m a #

Functor m => Functor (PersistentStateT s m) Source # 
Instance details

Defined in Control.Monad.State.Persistent

Methods

fmap :: (a -> b) -> PersistentStateT s m a -> PersistentStateT s m b #

(<$) :: a -> PersistentStateT s m b -> PersistentStateT s m a #

Monad m => Applicative (PersistentStateT s m) Source # 
Instance details

Defined in Control.Monad.State.Persistent

Methods

pure :: a -> PersistentStateT s m a #

(<*>) :: PersistentStateT s m (a -> b) -> PersistentStateT s m a -> PersistentStateT s m b #

liftA2 :: (a -> b -> c) -> PersistentStateT s m a -> PersistentStateT s m b -> PersistentStateT s m c #

(*>) :: PersistentStateT s m a -> PersistentStateT s m b -> PersistentStateT s m b #

(<*) :: PersistentStateT s m a -> PersistentStateT s m b -> PersistentStateT s m a #

type PersistentState s = PersistentStateT s Identity Source #

A State monad that can store earlier versions of the state.

store :: Monad m => PersistentStateT s m () Source #

Create a snapshot of the current state and add it to the list of states that we store.

runPersistentStateT :: Functor m => PersistentStateT s m a -> s -> m (a, s, [s]) Source #

Run a persistentStateT, returns a triplet with the value, the last state and a list of all states (including the last one) in chronological order

runPersistentState :: PersistentState s a -> s -> (a, s, [s]) Source #

Run a persistentStateT, returns a triplet with the value, the last state and a list of all states (including the last one) in chronological order