Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- exit :: Monad m => Automaton (MaybeT m) a b
- exitWhen :: Monad m => (a -> Bool) -> Automaton (MaybeT m) a a
- exitIf :: Monad m => Automaton (MaybeT m) Bool ()
- maybeExit :: Monad m => Automaton (MaybeT m) (Maybe a) a
- inMaybeT :: Monad m => Automaton (MaybeT m) (Maybe a) a
- untilMaybe :: Monad m => Automaton m a b -> Automaton m b Bool -> Automaton (MaybeT m) a b
- catchMaybe :: (Functor m, Monad m) => Automaton (MaybeT m) a b -> Automaton m a b -> Automaton m a b
- exceptToMaybeS :: (Functor m, Monad m) => Automaton (ExceptT e m) a b -> Automaton (MaybeT m) a b
- listToMaybeS :: (Functor m, Monad m) => [b] -> Automaton (MaybeT m) a b
- runMaybeS :: (Functor m, Monad m) => Automaton (MaybeT m) a b -> Automaton m a (Maybe b)
- reactimateMaybe :: (Functor m, Monad m) => Automaton (MaybeT m) () () -> m ()
- embed_ :: (Functor m, Monad m) => Automaton m a () -> [a] -> m ()
- newtype MaybeT (m :: Type -> Type) a = MaybeT {}
- mapMaybeT :: (m (Maybe a) -> n (Maybe b)) -> MaybeT m a -> MaybeT n b
- hoistMaybe :: forall (m :: Type -> Type) b. Applicative m => Maybe b -> MaybeT m b
- maybeToExceptT :: forall (m :: Type -> Type) e a. Functor m => e -> MaybeT m a -> ExceptT e m a
- exceptToMaybeT :: forall (m :: Type -> Type) e a. Functor m => ExceptT e m a -> MaybeT m a
- maybeToExceptS :: (Functor m, Monad m) => Automaton (MaybeT m) a b -> Automaton (ExceptT () m) a b
Documentation
exitWhen :: Monad m => (a -> Bool) -> Automaton (MaybeT m) a a Source #
Throw the exception when the condition becomes true on the input.
untilMaybe :: Monad m => Automaton m a b -> Automaton m b Bool -> Automaton (MaybeT m) a b Source #
Run the first automaton until the second one produces True
from the output of the first.
catchMaybe :: (Functor m, Monad m) => Automaton (MaybeT m) a b -> Automaton m a b -> Automaton m a b Source #
When an exception occurs in the first automaton
, the second automaton
is executed
from there.
exceptToMaybeS :: (Functor m, Monad m) => Automaton (ExceptT e m) a b -> Automaton (MaybeT m) a b Source #
Convert exceptions into Nothing
, discarding the exception value.
embed_ :: (Functor m, Monad m) => Automaton m a () -> [a] -> m () Source #
Run an Automaton
fed from a list, discarding results. Useful when one needs to
combine effects and streams (i.e., for testing purposes).
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.
Instances
hoistMaybe :: forall (m :: Type -> Type) b. Applicative m => Maybe b -> MaybeT m b #