Override default `clearBit` method impl for `Natural`
authorHerbert Valerio Riedel <hvr@gnu.org>
Mon, 16 Oct 2017 20:12:03 +0000 (22:12 +0200)
committerHerbert Valerio Riedel <hvr@gnu.org>
Mon, 16 Oct 2017 20:18:52 +0000 (22:18 +0200)
commit5984a698fc2974b719365a9647a7cae1bed51eec
tree8534bb79e087e4b55cac76c3fc166e18ae8f7fe6
parente3ba26f8b49700b41ff4672f3f7f6a4e453acdcc
Override default `clearBit` method impl for `Natural`

The default implementation of `clearBit` is in terms of
`complement`. However, `complement` is not well-defined
for `Natural` and this consequently renders the default
implementation of `clearBit` dysfunctional.

This implements `clearBit` in terms of `testBit`
and `setBit` which are both well-defined for `Natural`s.

This addresses #13203
libraries/base/GHC/Natural.hs