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

Brandon Allbery allbery.b at gmail.com
Sun Sep 28 18:49:27 UTC 2014


On Sun, Sep 28, 2014 at 2:45 PM, David Feuer <david.feuer at gmail.com> 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. Another direction is to look
> at structures representing other sorts of logics. I just don't see that
> Data.Bits is the right place to try to do these things.


Yes. This is what I was trying to get at with my question; Data.Bits
already has a specific usage, and that usage just doesn't seem to fit the
proposed one; that proposal belongs in a related yet different (and, I
suspect, significantly different once fleshed out) class. Otherwise, we
might well be reinventing the current Enum/Bounded mess or something
similar --- trying to wedge something that looks superficially similar into
an inappropriate structure.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140928/a5c9dd02/attachment.html>


More information about the Libraries mailing list