Proposal: change the Bits instance for Bool to align with other basic types and support branchless calculations

Felipe Almeida Lessa felipe.lessa at
Sun Sep 28 18:12:21 UTC 2014

+1 for the same reason, too.

Em 28/09/2014 14:35, "Anthony Cowley" <acowley at> escreveu:

> > On Sep 28, 2014, at 1:15 PM, David Feuer <david.feuer at> wrote:
> >
> > 10% sounds pretty big to me when you're trying to really squeeze out a
> bit more performance (which is what tends to lead people to even look at
> Data.Bits). The asymptotic hit, as you call it, will only hit you if you
> use what I consider to be the wrong operator. Why would you use .&. and .|.
> if what you want are && and ||? From the perspective of the Bits concept,
> Bool is a bitvector that happens to hold only one bit. Why would you expect
> that to short-circuit? Why would you use it for control flow?
> This is exactly my thinking, too. I'm +1 for consistency, potential speed
> in ostensibly straight-line code, and offering the opportunity specifically
> for this distinct behavior.
> Anthony
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list