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

David Feuer david.feuer at gmail.com
Sun Sep 28 17:15:53 UTC 2014


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140928/e8928d22/attachment.html>


More information about the Libraries mailing list