Portability | portable |
---|---|
Stability | experimental |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Safe Haskell | Safe-Inferred |
Useful combinators for boolean expressions
- bool :: a -> a -> Bool -> a
- ifThenElse :: Bool -> a -> a -> a
- notF :: Functor f => f Bool -> f Bool
- (<||>) :: Applicative f => f Bool -> f Bool -> f Bool
- (<&&>) :: Applicative f => f Bool -> f Bool -> f Bool
- aguard :: Alternative m => Bool -> m ()
- aguard' :: Alternative m => Bool -> a -> m a
- notM :: Monad m => m Bool -> m Bool
- (<|=>) :: Monad m => m Bool -> m Bool -> m Bool
- (<&=>) :: Monad m => m Bool -> m Bool -> m Bool
- guard' :: MonadPlus m => Bool -> a -> m a
- guardM' :: MonadPlus m => m Bool -> a -> m a
- whenM :: (Monoid a, Monad m) => m Bool -> m a -> m a
- unlessM :: (Monoid a, Monad m) => m Bool -> m a -> m a
- ifThenElseM :: Monad m => m Bool -> m a -> m a -> m a
A pure combinator
bool :: a -> a -> Bool -> aSource
bool a b
is a function that returns a if the argument is True, otherwise returns b
.
ifThenElse :: Bool -> a -> a -> aSource
An argument-permuted equivalent of bool
.
Applicative combinators
aguard :: Alternative m => Bool -> m ()Source
An Alternative
analogue of guard
.
aguard' :: Alternative m => Bool -> a -> m aSource
Monadic combinators
guardM' :: MonadPlus m => m Bool -> a -> m aSource
guard'
b returns the second argument if b is True, otherwise becomes mzero.
whenM :: (Monoid a, Monad m) => m Bool -> m a -> m aSource
Run the action if the given monadic condition becomes True
.
unlessM :: (Monoid a, Monad m) => m Bool -> m a -> m aSource
Run the action if the given monadic condition becomes False
.
ifThenElseM :: Monad m => m Bool -> m a -> m a -> m aSource