The bool-extras package

[ Tags: bsd3, data, library ] [ Propose Tags ]

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.

Properties

Versions 0.2.0, 0.3.0, 0.4.0
Dependencies base [details]
License BSD3
Author Erik Hesselink, Jeroen Leeuwestein, Tom Lokhorst, Sebastiaan Visser
Maintainer Tom Lokhorst <tom@lokhorst.eu>
Category Data
Uploaded Wed May 13 08:24:59 UTC 2009 by TomLokhorst
Distributions Debian:0.4.0, LTSHaskell:0.4.0, NixOS:0.4.0, Tumbleweed:0.4.0
Downloads 1685 total (64 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees