Proposal: Add bool to Data.Bool
Henning Thielemann
lemming at henning-thielemann.de
Wed Sep 11 08:34:55 CEST 2013
On Tue, 10 Sep 2013, Oliver Charles wrote:
> Hello,
>
> I would like to propose that the following is added to Data.Bool in base:
>
> bool :: a -> a -> Bool -> a
> bool f _ False = f
> bool _ t True = t
>
> (Aka, bool f t b = if b then t else f)
There is already the ifThenElse function (and I have if' in utility-ht).
Their argument order is optimal for writing kinds of 'case':
http://www.haskell.org/haskellwiki/Case
But 'bool' would be consistent with 'maybe' and 'either' and should be in
Data.Bool, not Prelude.
More information about the Libraries
mailing list