Strafunski-StrategyLib-5.0.0.3: Library for strategic programming

Portabilityportable
Stabilityexperimental
MaintainerRalf Laemmel, Joost Visser
Safe HaskellNone

Data.Generics.Strafunski.StrategyLib.StrategyLib

Description

This module is part of StrategyLib, a library of functional strategy combinators, including combinators for generic traversal. This is the top-level module of the library. One only needs to import this module to use the entire library. Some base modules are exported as well because they are commonly used.

Synopsis

Documentation

newtype Identity a

Identity functor and monad.

Constructors

Identity 

Fields

runIdentity :: a
 

Instances

Monad Identity 
Functor Identity 
MonadFix Identity 
Applicative Identity 
Foldable Identity 
Traversable Identity 
MonadRun (->) Identity

Running the Identity monad. The algebra for the Identity monad is a unary function.

MonadRun (StateAlg s) (State s)

Running the State monad.

type State s = StateT s Identity

A state monad parameterized by the type s of the state to carry.

The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.

newtype StateT s m a

A state transformer monad parameterized by:

  • s - The state.
  • m - The inner monad.

The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.

Constructors

StateT 

Fields

runStateT :: s -> m (a, s)
 

Instances

MonadReader r m => MonadReader r (StateT s m) 
Monad m => MonadState s (StateT s m) 
MonadWriter w m => MonadWriter w (StateT s m) 
MonadTrans (StateT s) 
MonadUnTrans (StateAlg s) (StateT s)

Unlifting the state monad transformer

MonadRun (StateAlg s) (State s)

Running the State monad.

Monad m => Monad (StateT s m) 
Functor m => Functor (StateT s m) 
MonadFix m => MonadFix (StateT s m) 
MonadPlus m => MonadPlus (StateT s m) 
(Functor m, Monad m) => Applicative (StateT s m) 
(Functor m, MonadPlus m) => Alternative (StateT s m) 
MonadIO m => MonadIO (StateT s m) 
MonadCont m => MonadCont (StateT s m)