dunai-0.3.0.0: Generalised reactive framework supporting classic, arrowized and monadic FRP.

Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Trans.MSF.State

Contents

Description

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.

Synopsis

Documentation

State MSF runningwrappingunwrapping

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

Build an MSF in the State monad from one that takes the state as an extra input. This is the opposite of runStateS.

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

Build an MSF that takes a state as an extra input from one on the State monad. This is the opposite of stateS.

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.

Alternative implementation using lifterS

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

Alternative implementation of stateS using lifterS.

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

Alternative implementation of runStateS using lifterS.

Alternative implementation using transS

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

Alternative implementation of runStateS using transS.

Alternative implementation using transG

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

Alternative implementation of runStateS using transG.