Package Info

ghc-bool-extras


A fold function for Bool


Development/Libraries/Haskell

The `bool' function allows folding over boolean values.

This is comparable to the maybe' oreither' 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.


License: BSD-3-Clause
URL: https://hackage.haskell.org/package/bool-extras

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.4.0-bp150.2.4 info GA Release 2018-08-01 15
  • AArch64
  • ghc-bool-extras
  • ghc-bool-extras-devel
0.4.0-bp150.2.6 info GA Release 2018-07-30 15
  • ppc64le
  • x86-64
  • ghc-bool-extras
  • ghc-bool-extras-devel