Safe Haskell  Safe 

Language  Haskell2010 
Monadic Stream Functions are synchronized stream functions with side effects.
 data MStreamF m a b = MStreamF {
 unMStreamF :: a > m (b, MStreamF m a b)
 liftMStreamF :: Monad m => (a > m b) > MStreamF m a b
 liftMStreamFPurer :: (Monad m2, Monad m1) => (forall c. m1 c > m2 c) > MStreamF m1 a b > MStreamF m2 a b
 liftMStreamFTrans :: (MonadTrans t, Monad m, Monad (t m)) => MStreamF m a b > MStreamF (t m) a b
 liftMStreamFBase :: (Monad m2, MonadBase m1 m2) => MStreamF m1 a b > MStreamF m2 a b
 performOnFirstSample :: Monad m => m (MStreamF m a b) > MStreamF m a b
 iPre :: Monad m => a > MStreamF m a a
 delay :: Monad m => a > MStreamF m a a
 switch :: Monad m => MStreamF m a (b, Maybe c) > (c > MStreamF m a b) > MStreamF m a b
 feedback :: Monad m => c > MStreamF m (a, c) (b, c) > MStreamF m a b
 embed :: Monad m => MStreamF m a b > [a] > m [b]
 reactimate :: Monad m => MStreamF m () () > m ()
 reactimateB :: Monad m => MStreamF m () Bool > m ()
Documentation
MStreamF  

Lifts
liftMStreamF :: Monad m => (a > m b) > MStreamF m a b Source #
Monadic lifting from one monad into another
Purer monads
liftMStreamFPurer :: (Monad m2, Monad m1) => (forall c. m1 c > m2 c) > MStreamF m1 a b > MStreamF m2 a b Source #
Lifting purer monadic actions (in an arbitrary way)
Monad stacks
liftMStreamFTrans :: (MonadTrans t, Monad m, Monad (t m)) => MStreamF m a b > MStreamF (t m) a b Source #
Lifting inner monadic actions in monad stacks TODO Should be able to express this in terms of MonadBase
liftMStreamFBase :: (Monad m2, MonadBase m1 m2) => MStreamF m1 a b > MStreamF m2 a b Source #
Lifting the innest monadic actions in a monad stacks (generalisation of liftIO)
MSFs within monadic actions
performOnFirstSample :: Monad m => m (MStreamF m a b) > MStreamF m a b Source #
Extract MSF from a monadic action
Delays and signal overwriting
Switching
Feedback loops
Reactimating
embed :: Monad m => MStreamF m a b > [a] > m [b] Source #
Apply a monadic stream function to a list.
Because the result is in a monad, it may be necessary to traverse the whole list to evaluate the value in the results to WHNF. For example, if the monad is the maybe monad, this may not produce anything if the MSF produces Nothing at any point, so the output stream cannot consumed progressively.
To explore the output progressively, use liftMStreamF and (>>>), together with some action that consumes/actuates on the output.
This is called "runSF" in Liu, Cheng, Hudak, "Causal Commutative Arrows and Their Optimization"
reactimate :: Monad m => MStreamF m () () > m () Source #
Runs an MSF indefinitely passing a unitcarrying input stream.