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

Brandon Allbery allbery.b at
Sun Sep 28 20:03:10 UTC 2014

On Sun, Sep 28, 2014 at 2:45 PM, David Feuer <david.feuer at> wrote:

> I would think what you're trying to do would likely be better with a
> different class, by another name, supporting things like .&&., .||., etc.,
> or maybe even moving && and || into a class.

So, if I look at this from the angle that the strictness of other Bits
instances is an artifact of their being spine-strict bit vectors, I get
that the correct answer to this is not a new class but a "strict" newtype
on Bool. The standard lazy Bool is by far the more common one, so it's the
strict variant that gets the newtype. (Compare the Sum and Product monoid

brandon s allbery kf8nh                               sine nomine associates
allbery.b at                                  ballbery at
unix, openafs, kerberos, infrastructure, xmonad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list