[commit: packages/base] master: Add Haddock docs for new `class FiniteBits` (b0ca46b)
git at git.haskell.org
git at git.haskell.org
Sat Sep 21 14:28:21 CEST 2013
Repository : ssh://git@git.haskell.org/base
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/b0ca46b92a757fb1a9a9a5e65b4f900b52192a18/base
>---------------------------------------------------------------
commit b0ca46b92a757fb1a9a9a5e65b4f900b52192a18
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Sat Sep 21 14:10:32 2013 +0200
Add Haddock docs for new `class FiniteBits`
>---------------------------------------------------------------
b0ca46b92a757fb1a9a9a5e65b4f900b52192a18
Data/Bits.hs | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Data/Bits.hs b/Data/Bits.hs
index fb71d75..d32d45d 100644
--- a/Data/Bits.hs
+++ b/Data/Bits.hs
@@ -244,7 +244,20 @@ class Eq a => Bits a where
(rotate | (rotateL, rotateR)),
bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-}
+-- |The 'FiniteBits' class denotes types with a finite, fixed number of bits.
+--
+-- /Since: 4.7.0.0/
class Bits b => FiniteBits b where
+ -- | Return the number of bits in the type of the argument.
+ -- The actual value of the argument is ignored. Moreover, 'finiteBitSize'
+ -- is total, in contrast to the deprecated 'bitSize' function it replaces.
+ --
+ -- @
+ -- 'finiteBitSize' = 'bitSize'
+ -- 'bitSizeMaybe' = 'Just' . 'finiteBitSize'
+ -- @
+ --
+ -- /Since: 4.7.0.0/
finiteBitSize :: b -> Int
-- The defaults below are written with lambdas so that e.g.
More information about the ghc-commits
mailing list