diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2014-05-12 10:53:09 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2014-08-28 11:14:09 +0100 |
commit | 4c03791f986509c5d95adf50de555876ed05522e (patch) | |
tree | 00ce8214b4094dde855ae01d4279bc680dc0a8b2 /libraries/base | |
parent | 9cf5906b692c31b7ec67856b0859cb0e33770651 (diff) | |
download | haskell-4c03791f986509c5d95adf50de555876ed05522e.tar.gz |
Specialise Eq, Ord, Read, Show at Int, Char, String
These instances are quite common, so it's good to have
pre-specialised versions available
Diffstat (limited to 'libraries/base')
-rw-r--r-- | libraries/base/GHC/Read.lhs | 3 | ||||
-rw-r--r-- | libraries/base/GHC/Show.lhs | 5 |
2 files changed, 7 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" |