summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Show.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/Show.hs')
-rw-r--r--libraries/base/GHC/Show.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/libraries/base/GHC/Show.hs b/libraries/base/GHC/Show.hs
index 798dff9891..a41bf81cb3 100644
--- a/libraries/base/GHC/Show.hs
+++ b/libraries/base/GHC/Show.hs
@@ -479,6 +479,13 @@ instance Show Integer where
| otherwise = integerToString n r
showList = showList__ (showsPrec 0)
+-- | @since 4.8.0.0
+instance Show Natural where
+#if defined(MIN_VERSION_integer_gmp)
+ showsPrec p (NatS# w#) = showsPrec p (W# w#)
+#endif
+ showsPrec p i = showsPrec p (naturalToInteger i)
+
-- Divide and conquer implementation of string conversion
integerToString :: Integer -> String -> String
integerToString n0 cs0