The Bool type and related functions.
Some classes for generalized boolean operations. Starting with 0.1.0, this package uses type families. Up to version 0.0.2, it used MPTCs with functional dependencies. My thanks to Andy Gill for suggesting & helping with the change. Thanks also to Alex Horsman for Data.Boolean.Overload and to Jan Bracker for Data.Boolean.Numbers.
Copyright 2009-2013 Conal Elliott; BSD3 license.
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.
Boolean expressions with various representations and search queries.
Functions for dealing with bools
Normal form representation for boolean expressions. Typically simplifies such expressions, but is not guaranteed to produce the absolute simplest form.
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.
This package has been removed.
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.