Copyright | (c) Ivan Perez and Manuel Baerenz 2016 |
---|---|
License | BSD3 |
Maintainer | ivan.perez@keera.co.uk |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Warning: This module uses the ListT transformer, which is considered deprecated.
MSF
s with a list monadic layer.
This module contains functions to work with MSFs that include a ListT
monadic layer. MSFs on a list monad may produce multiple outputs and
continuations, or none. This enables the possibility for spawning new MSFs,
or stopping MSFs, at will.
A common use case is to be able to dynamically spawn new interactive elements in applications (e.g., a game object that splits in two, or that fires to an enemy).
WARNING: the ListT transformer is considered dangerous, and imposes additional constraints on the inner monad in order for the combination of the monad and the transformer to be a monad. Use at your own risk.
Documentation
widthFirst :: (Functor m, Monad m) => MSF (ListT m) a b -> MSF m a [b] Source #
Run an MSF
in the ListT
transformer (i.e., multiple MSFs producing
each producing one output), by applying the input stream to each MSF in the
list transformer and concatenating the outputs of the MSFs together.
An MSF in the ListT transformer can spawn into more than one MSF, or none, so the outputs produced at each individual step are not guaranteed to all have the same length.
newtype ListT (m :: Type -> Type) a #
Parameterizable list monad, with an inner monad.
Note: this does not yield a monad unless the argument monad is commutative.