The bool-extras package

[Tags: bsd3, library]

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.


Versions0.2.0, 0.3.0, 0.4.0
Change logNone available
Dependenciesbase (>=3 && <5) [details]
AuthorErik Hesselink, Jeroen Leeuwestein, Tom Lokhorst, Sebastiaan Visser
MaintainerTom Lokhorst <>
Home page
UploadedFri Apr 4 12:58:55 UTC 2014 by TomLokhorst
DistributionsDebian:0.4.0, LTSHaskell:0.4.0, NixOS:0.4.0, Stackage:0.4.0
Downloads1269 total (23 in last 30 days)
0 []
StatusDocs available [build log]
Successful builds reported [all 1 reports]




Maintainers' corner

For package maintainers and hackage trustees