summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-21 14:34:36 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-05-21 14:35:12 +0100
commite9c54e8fafdb89886b4dd81a6e10240952bd1a24 (patch)
treeecbf02b13cf8730ffcc5cae0cc81883bdcfac1c9
parent939a56e780b7cc55cf49b52c4222e0e8061e99b1 (diff)
downloadhaskell-wip/t19880.tar.gz
docs: Fix example in toIntegralSizedwip/t19880
Thanks to Mathnerd3141 for the fixed example. Fixes #19880
-rw-r--r--libraries/base/GHC/Bits.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/libraries/base/GHC/Bits.hs b/libraries/base/GHC/Bits.hs
index d0703e223f..012550a60b 100644
--- a/libraries/base/GHC/Bits.hs
+++ b/libraries/base/GHC/Bits.hs
@@ -601,10 +601,10 @@ instance Bits Natural where
--
-- > toIntegral :: (Integral a, Integral b) => a -> Maybe b
-- > toIntegral x
--- > | toInteger x == y = Just (fromInteger y)
--- > | otherwise = Nothing
+-- > | toInteger x == toInteger y = Just y
+-- > | otherwise = Nothing
-- > where
--- > y = toInteger x
+-- > y = fromIntegral x
--
-- This version requires going through 'Integer', which can be inefficient.
-- However, @toIntegralSized@ is optimized to allow GHC to statically determine