summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libraries/base/GHC/Read.lhs3
-rw-r--r--libraries/base/GHC/Show.lhs5
-rw-r--r--libraries/ghc-prim/GHC/Classes.hs4
3 files changed, 11 insertions, 1 deletions
diff --git a/libraries/base/GHC/Read.lhs b/libraries/base/GHC/Read.lhs
index ab730e6652..2fd9f305b6 100644
--- a/libraries/base/GHC/Read.lhs
+++ b/libraries/base/GHC/Read.lhs
@@ -423,6 +423,9 @@ instance Read a => Read (Maybe a) where
readList = readListDefault
instance Read a => Read [a] where
+ {-# SPECIALISE instance Read [String] #-}
+ {-# SPECIALISE instance Read [Char] #-}
+ {-# SPECIALISE instance Read [Int] #-}
readPrec = readListPrec
readListPrec = readListPrecDefault
readList = readListDefault
diff --git a/libraries/base/GHC/Show.lhs b/libraries/base/GHC/Show.lhs
index 45338e8845..09c3c56cd9 100644
--- a/libraries/base/GHC/Show.lhs
+++ b/libraries/base/GHC/Show.lhs
@@ -184,7 +184,10 @@ instance Show () where
showsPrec _ () = showString "()"
instance Show a => Show [a] where
- showsPrec _ = showList
+ {-# SPECIALISE instance Show [String] #-}
+ {-# SPECIALISE instance Show [Char] #-}
+ {-# SPECIALISE instance Show [Int] #-}
+ showsPrec _ = showList
instance Show Bool where
showsPrec _ True = showString "True"
diff --git a/libraries/ghc-prim/GHC/Classes.hs b/libraries/ghc-prim/GHC/Classes.hs
index 5bb4cb681c..9028f6edcd 100644
--- a/libraries/ghc-prim/GHC/Classes.hs
+++ b/libraries/ghc-prim/GHC/Classes.hs
@@ -83,7 +83,9 @@ deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
=> Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
instance (Eq a) => Eq [a] where
+ {-# SPECIALISE instance Eq [[Char]] #-}
{-# SPECIALISE instance Eq [Char] #-}
+ {-# SPECIALISE instance Eq [Int] #-}
[] == [] = True
(x:xs) == (y:ys) = x == y && xs == ys
_xs == _ys = False
@@ -181,7 +183,9 @@ deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
=> Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
instance (Ord a) => Ord [a] where
+ {-# SPECIALISE instance Ord [[Char]] #-}
{-# SPECIALISE instance Ord [Char] #-}
+ {-# SPECIALISE instance Ord [Int] #-}
compare [] [] = EQ
compare [] (_:_) = LT
compare (_:_) [] = GT