Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/c80c5cb64f5aa5d8d9b142085f3bf40b5bce7567

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

commit c80c5cb64f5aa5d8d9b142085f3bf40b5bce7567
Author: Simon Marlow <[email protected]>
Date:   Thu Jul 14 15:51:28 2011 +0100

    give instances of Ord for TyCon and TypeRep

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

 Data/Typeable/Internal.hs |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Data/Typeable/Internal.hs b/Data/Typeable/Internal.hs
index f28a079..cdd2778 100644
--- a/Data/Typeable/Internal.hs
+++ b/Data/Typeable/Internal.hs
@@ -87,6 +87,9 @@ data TypeRep = TypeRep {-# UNPACK #-} !Fingerprint TyCon 
[TypeRep]
 instance Eq TypeRep where
   (TypeRep k1 _ _) == (TypeRep k2 _ _) = k1 == k2
 
+instance Ord TypeRep where
+  (TypeRep k1 _ _) <= (TypeRep k2 _ _) = k1 <= k2
+
 -- | An abstract representation of a type constructor.  'TyCon' objects can
 -- be built using 'mkTyCon'.
 data TyCon = TyCon {
@@ -99,6 +102,9 @@ data TyCon = TyCon {
 instance Eq TyCon where
   (TyCon t1 _ _ _) == (TyCon t2 _ _ _) = t1 == t2
 
+instance Ord TyCon where
+  (TyCon k1 _ _ _) <= (TyCon k2 _ _ _) = k1 <= k2
+
 ----------------- Construction --------------------
 
 #include "MachDeps.h"



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to