classfile: add Ord instance for some types
authorBernhard Urban <lewurm@gmail.com>
Tue, 19 Jun 2012 19:03:01 +0000 (21:03 +0200)
committerBernhard Urban <lewurm@gmail.com>
Tue, 19 Jun 2012 19:03:01 +0000 (21:03 +0200)
MateVM uses `MethodSignature' as a key in Data.Map, therefore we need `Ord'

JVM/ClassFile.hs

index 217e7bcfc7afc6a128a13da1518da0ce3f683be7..68ea764a338cc02f4a32e48f1167020400720da4 100644 (file)
@@ -310,7 +310,7 @@ data FieldType =
   | BoolType   -- ^ Z
   | ObjectType String -- ^ L @{class name}@
   | Array (Maybe Int) FieldType -- ^ @[{type}@
-  deriving (Eq)
+  deriving (Eq, Ord)
 
 instance Show FieldType where
   show SignedByte = "byte"
@@ -396,7 +396,7 @@ getToSemicolon = do
 data ReturnSignature =
     Returns FieldType
   | ReturnsVoid
-  deriving (Eq)
+  deriving (Eq, Ord)
 
 instance Show ReturnSignature where
   show (Returns t) = show t
@@ -418,7 +418,7 @@ type ArgumentSignature = FieldType
 -- | Class method argument signature
 data MethodSignature =
     MethodSignature [ArgumentSignature] ReturnSignature
-  deriving (Eq)
+  deriving (Eq, Ord)
 
 instance Show MethodSignature where
   show (MethodSignature args ret) = "(" ++ intercalate ", " (map show args) ++ ") returns " ++ show ret