Some basic monad combinators that Control.Monad lacks. Many
of these functions have been adopted by the
- ifM :: Monad m => m Bool -> m a -> m a -> m a
- whenM :: Monad m => m Bool -> m () -> m ()
- unlessM :: Monad m => m Bool -> m () -> m ()
- whileM :: Monad m => m Bool -> m () -> m ()
- untilM :: Monad m => m Bool -> m () -> m ()
- return' :: Monad m => a -> m a
- returning :: Monad m => (a -> m b) -> a -> m a
- liftM' :: Monad m => (a -> b) -> m a -> m b
- maybeMP :: MonadPlus m => Maybe a -> m a
- maybeEither :: a -> Maybe b -> Either a b
Choose a computation to run based on the boolean.
If the boolean is false, then run the computation.
Execute a monadic action so long as a monadic boolean returns true.
whileM: execute an action so long as the boolean
Strict version of
return because usually we don't need that
Take an action and make it into a side-effecting
Because I seem to keep running into
m () and the like.
This is the moral inverse of
Control.Monad.void :: Functor f
=> f a -> f () which is added in