Stability | experimental |
---|---|

Maintainer | boriss@gmail.com |

Safe Haskell | None |

MonadPlus with left catch (MonadOr) for StateT.

- data StatePlusT s m a
- runStatePlusT :: Monad m => StatePlusT s m a -> s -> m (Maybe a, s)
- execStatePlusT :: Monad m => StatePlusT s m a -> s -> m s
- evalStatePlusT :: Monad m => StatePlusT s m a -> s -> m (Maybe a)

# The StatePlusT monad transformer

data StatePlusT s m a Source

StatePlusT behaves similar to StateT monad transformer

Monad m => MonadState s (StatePlusT s m) | |

MonadTrans (StatePlusT s) | |

Monad m => Monad (StatePlusT s m) | |

Functor m => Functor (StatePlusT s m) | |

Monad m => MonadPlus (StatePlusT s m) | |

MonadIO m => MonadIO (StatePlusT s m) |

runStatePlusT :: Monad m => StatePlusT s m a -> s -> m (Maybe a, s)Source

Evaluate StatePlusT monad. In difference from runStateT it returns
`Nothing`

if `mzero`

has been encountered. `Just a`

otherwise.

execStatePlusT :: Monad m => StatePlusT s m a -> s -> m sSource

Execute StatePlusT monad returning resulting state

evalStatePlusT :: Monad m => StatePlusT s m a -> s -> m (Maybe a)Source

Evaluate StatePlusT monad returning resulting value. See above for the semantics.