Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

MSFs with a State monadic layer.

This module contains functions to work with MSFs that include a `State`

monadic layer. This includes functions to create new MSFs that include an
additional layer, and functions to flatten that layer out of the MSF's
transformer stack.

- module Control.Monad.Trans.State.Strict
- stateS :: Monad m => MSF m (s, a) (s, b) -> MSF (StateT s m) a b
- runStateS :: Monad m => MSF (StateT s m) a b -> MSF m (s, a) (s, b)
- runStateS_ :: Monad m => MSF (StateT s m) a b -> s -> MSF m a (s, b)
- runStateS__ :: Monad m => MSF (StateT s m) a b -> s -> MSF m a b
- stateS' :: (Functor m, Monad m) => MSF m (s, a) (s, b) -> MSF (StateT s m) a b
- runStateS' :: (Functor m, Monad m) => MSF (StateT s m) a b -> MSF m (s, a) (s, b)
- runStateS'' :: (Functor m, Monad m) => MSF (StateT s m) a b -> MSF m (s, a) (s, b)
- runStateS''' :: (Functor m, Monad m) => MSF (StateT s m) a b -> MSF m (s, a) (s, b)

# Documentation

# State MSF running*wrapping*unwrapping

runStateS_ :: Monad m => MSF (StateT s m) a b -> s -> MSF m a (s, b) Source #

Build an MSF *function* that takes a fixed state as additional input, from
an MSF in the `State`

monad, and outputs the new state with every
transformation step.

This should be always equal to:

runStateS_ msf s = feedback s $ runStateS msf >>> arr ((s,b) -> ((s,b), s))

although possibly more efficient.

runStateS__ :: Monad m => MSF (StateT s m) a b -> s -> MSF m a b Source #

Build an MSF *function* that takes a fixed state as additional
input, from an MSF in the `State`

monad.

This should be always equal to:

runStateS__ msf s = feedback s $ runStateS msf >>> arr ((s,b) -> (b, s))

although possibly more efficient.