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

Language | Haskell2010 |

## Synopsis

- exit :: Monad m => MSF (MaybeT m) a b
- exitWhen :: Monad m => (a -> Bool) -> MSF (MaybeT m) a a
- exitIf :: Monad m => MSF (MaybeT m) Bool ()
- maybeExit :: Monad m => MSF (MaybeT m) (Maybe a) a
- inMaybeT :: Monad m => MSF (MaybeT m) (Maybe a) a
- untilMaybe :: Monad m => MSF m a b -> MSF m b Bool -> MSF (MaybeT m) a b
- catchMaybe :: (Functor m, Monad m) => MSF (MaybeT m) a b -> MSF m a b -> MSF m a b
- listToMaybeS :: Monad m => [b] -> MSF (MaybeT m) a b
- runMaybeS :: (Functor m, Monad m) => MSF (MaybeT m) a b -> MSF m a (Maybe b)
- reactimateMaybe :: (Functor m, Monad m) => MSF (MaybeT m) () () -> m ()
- embed_ :: (Functor m, Monad m) => MSF m a () -> [a] -> m ()
- exceptToMaybeT :: Functor m => ExceptT e m a -> MaybeT m a
- maybeToExceptT :: Functor m => e -> MaybeT m a -> ExceptT e m a
- mapMaybeT :: (m (Maybe a) -> n (Maybe b)) -> MaybeT m a -> MaybeT n b
- newtype MaybeT (m :: Type -> Type) a = MaybeT {}
- maybeToExceptS :: (Functor m, Monad m) => MSF (MaybeT m) a b -> MSF (ExceptT () m) a b

# Documentation

exitWhen :: Monad m => (a -> Bool) -> MSF (MaybeT m) a a Source #

Throw the exception when the condition becomes true on the input.

untilMaybe :: Monad m => MSF m a b -> MSF m b Bool -> MSF (MaybeT m) a b Source #

Run the first `msf`

until the second one produces `True`

from the output of the first.

catchMaybe :: (Functor m, Monad m) => MSF (MaybeT m) a b -> MSF m a b -> MSF m a b Source #

When an exception occurs in the first `msf`

, the second `msf`

is executed from there.

embed_ :: (Functor m, Monad m) => MSF m a () -> [a] -> m () Source #

Run an `MSF`

fed from a list, discarding results. Useful when one needs to
combine effects and streams (i.e., for testing purposes).

exceptToMaybeT :: Functor m => ExceptT e m a -> MaybeT m a #

maybeToExceptT :: Functor m => e -> MaybeT m a -> ExceptT e m a #

newtype MaybeT (m :: Type -> Type) a #

The parameterizable maybe monad, obtained by composing an arbitrary
monad with the `Maybe`

monad.

Computations are actions that may produce a value or exit.

The `return`

function yields a computation that produces that
value, while `>>=`

sequences two subcomputations, exiting if either
computation does.