diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-05-21 14:34:36 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-05-21 14:35:12 +0100 |
commit | e9c54e8fafdb89886b4dd81a6e10240952bd1a24 (patch) | |
tree | ecbf02b13cf8730ffcc5cae0cc81883bdcfac1c9 | |
parent | 939a56e780b7cc55cf49b52c4222e0e8061e99b1 (diff) | |
download | haskell-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.hs | 6 |
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 |