[commit: packages/base] master: Add Show and Read instances for Data.Ord.Down (ebc8526)

git at git.haskell.org git at git.haskell.org
Mon Oct 14 20:01:19 UTC 2013


Repository : ssh://git@git.haskell.org/base

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ebc85262ccfbb65db71d7fdff7a35c8178b99f18/base

>---------------------------------------------------------------

commit ebc85262ccfbb65db71d7fdff7a35c8178b99f18
Author: Krzysztof Gogolewski <krz.gogolewski at gmail.com>
Date:   Mon Oct 14 21:47:40 2013 +0200

    Add Show and Read instances for Data.Ord.Down
    
    libraries mailing list thread "Proposal: Show and Read for Data.Ord.Down", Sep 2013, http://www.haskell.org/pipermail/libraries/2013-September/020867.html


>---------------------------------------------------------------

ebc85262ccfbb65db71d7fdff7a35c8178b99f18
 Data/Ord.hs |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Data/Ord.hs b/Data/Ord.hs
index f7d32f6..a574b83 100644
--- a/Data/Ord.hs
+++ b/Data/Ord.hs
@@ -23,6 +23,8 @@ module Data.Ord (
  ) where
 
 import GHC.Base
+import GHC.Show
+import GHC.Read
 
 -- | 
 -- > comparing p x y = compare (p x) (p y)
@@ -42,7 +44,8 @@ comparing p x y = compare (p x) (p y)
 -- as in: @then sortWith by 'Down' x@
 --
 -- /Since: 4.6.0.0/
-newtype Down a = Down a deriving (Eq)
+-- Show and Read instances /Since: 4.7.0.0/
+newtype Down a = Down a deriving (Eq, Show, Read)
 
 instance Ord a => Ord (Down a) where
     compare (Down x) (Down y) = y `compare` x



More information about the ghc-commits mailing list