Proposal: Add bool to Data.Bool

Herbert Valerio Riedel hvr at gnu.org
Wed Sep 11 11:02:29 CEST 2013


On 2013-09-11 at 00:02:19 +0200, Oliver Charles wrote:
> 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)

+1 


(btw, somewhat related: http://www.haskell.org/haskellwiki/If-then-else )



More information about the Libraries mailing list