Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
This module provides some convenient functions for dealing with Booleans.
The most important one being bool
, a function that can be used in place of
the build-in if then else
-syntax.
- bool :: a -> a -> Bool -> a
- mwhen :: Monoid a => a -> Bool -> a
- mwhenM :: (Monad m, Monoid a) => m a -> Bool -> m a
- whenA :: Arrow a => a b b -> Bool -> a b b
- whenC :: Category cat => cat a a -> Bool -> cat a a
- whenM :: Monad m => (a -> m a) -> Bool -> a -> m a
- type BoolAlgebra r = (r, r)
- cata :: BoolAlgebra r -> Bool -> r
- ana :: (b -> Bool) -> b -> Bool
Main function
Case analysis for the Bool
type.
bool a b p
evaluates to a
when p
is False
, and evaluates to b
when p
is True
.
Since: 4.7.0.0
Other functions
Morphisms
type BoolAlgebra r = (r, r) Source
cata :: BoolAlgebra r -> Bool -> r Source
Catamorphism for booleans.