The Bool type and related functions.
The `bool' function allows folding over boolean values.
This is comparable to the `maybe' or `either' functions on their respective types.
The `bool' function is a replacement for the build-in if then else-syntax. However, since it is a function, it can be partially applied and passed around to higher order functions, like so:
> ghci> :m + Data.Bool.Extras
> ghci> let yesOrNo = bool "no" "yes"
> ghci> map yesOrNo [True, False, True]
> ["yes", "no", "yes"]
Note that the arguments to `bool' are in the opposite order of the if then else-syntax; First the false value, then the true value, and finally the boolean.
Some classes for generalized boolean operations.
Copyright 2009 Conal Elliott; BSD3 license.
Boolean expressions with various representations and search queries.
Convert a Haskell Bool to its numeric representation
Convert a Boolean in numeric representation to a Haskell value
This package provides various functions and classes for dealing with things which are like Boolean values. It also defines a few useful instances. The main benefit is the ability to use the usual &&, etc. operators without having to invent new operator names for every kind of Bool-like thing.
* Increase efficiency of Boolean instance for Bool.
* Shorten source code.
* Remove function instance. (Control.Monad.Instances provides an equivilent Monad instance.)
Asserts that the specified condition holds.
Type-level booleans with basic operators that short-circuit as much as possible.
This package adds instances for the classes IfB and EqB in the Boolean package for the fixed length list data type in the Vec package. These intances are useful for example when using the GPipe package.