[GHC] #13203: Implement Bits Natural clearBit

GHC ghc-devs at haskell.org
Tue Feb 28 16:29:55 UTC 2017


#13203: Implement Bits Natural clearBit
-------------------------------------+-------------------------------------
        Reporter:  dylex             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  lowest            |            Milestone:
       Component:  libraries/base    |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by vlopez):

 At least it should be documented that `clearBit` is undefined.

 For implementing `clearBit`, instead of doing a conditional
 `complementBit` on `testBit`, I  suggest doing a `complementBit` after
 `setBit`. This avoids branching entirely.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13203#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list