summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Tibell <johan.tibell@gmail.com>2012-02-14 11:49:21 -0800
committerJohan Tibell <johan.tibell@gmail.com>2012-02-14 11:49:21 -0800
commit04a820683c0487474808cf92808d958d3415e9b3 (patch)
tree0ff1353bb6311c6379b7ed10351960d2a5862e88
parent11f108bfbf783de618759f479f66820a2f640efb (diff)
downloadhaskell-04a820683c0487474808cf92808d958d3415e9b3.tar.gz
Fix documentation of minimal complete definition of Bits instances
Added testBit, bit, and popCount to the required set. They no longer have default implementations as the Num constraint was removed from the Bits class.
-rw-r--r--libraries/base/Data/Bits.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs
index 496f592317..9d8b60ab96 100644
--- a/libraries/base/Data/Bits.hs
+++ b/libraries/base/Data/Bits.hs
@@ -75,7 +75,9 @@ The 'Bits' class defines bitwise operations over integral types.
Minimal complete definition: '.&.', '.|.', 'xor', 'complement',
('shift' or ('shiftL' and 'shiftR')), ('rotate' or ('rotateL' and 'rotateR')),
-'bitSize' and 'isSigned'.
+'bitSize', 'isSigned', 'testBit', 'bit', and 'popCount'. The latter three can
+be implemented using `testBitDefault', 'bitDefault, and 'popCountDefault', if
+@a@ is also an instance of 'Num'.
-}
class Eq a => Bits a where
-- | Bitwise \"and\"