summaryrefslogtreecommitdiff
path: root/libraries/base
diff options
context:
space:
mode:
authorOleg Grenrus <oleg.grenrus@iki.fi>2021-01-24 14:42:42 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-27 17:43:49 -0500
commit831ba0fb216e7481d1fb299b1cff09298b060370 (patch)
tree16c108866a3a081e0f200c89bd0956a67d26f3e8 /libraries/base
parent9c87f97ee9e697b6609db892a503fc053dc8f901 (diff)
downloadhaskell-831ba0fb216e7481d1fb299b1cff09298b060370.tar.gz
Fix doctest examples in Data.Bits
Diffstat (limited to 'libraries/base')
-rw-r--r--libraries/base/Data/Bits.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs
index 95105a4b3f..73ebfbc03c 100644
--- a/libraries/base/Data/Bits.hs
+++ b/libraries/base/Data/Bits.hs
@@ -63,12 +63,16 @@ import GHC.Enum
import GHC.Read
import GHC.Show
+-- $setup
+-- >>> import Prelude
+-- >>> import Data.Word
+
-- | A more concise version of @complement zeroBits@.
--
--- >>> complement zeroBits :: Word == oneBits :: Word
+-- >>> complement (zeroBits :: Word) == (oneBits :: Word)
-- True
--
--- >>> complement oneBits :: Word == zeroBits :: Word
+-- >>> complement (oneBits :: Word) == (zeroBits :: Word)
-- True
--
-- = Note
@@ -142,7 +146,7 @@ instance (Bits a) => Monoid (Ior a) where
-- | Monoid under bitwise XOR.
--
--- >>> getXor (Xor 0xab <> 0x12) :: Word8
+-- >>> getXor (Xor 0xab <> Xor 0x12) :: Word8
-- 185
--
-- @since 4.16