From: Bernhard Urban Date: Tue, 19 Jun 2012 19:03:01 +0000 (+0200) Subject: classfile: add Ord instance for some types X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=hs-java.git;a=commitdiff_plain;h=4a2f1e623bd79f5583cd9c50d2543bb71e0dbb76 classfile: add Ord instance for some types MateVM uses `MethodSignature' as a key in Data.Map, therefore we need `Ord' --- diff --git a/JVM/ClassFile.hs b/JVM/ClassFile.hs index 217e7bc..68ea764 100644 --- a/JVM/ClassFile.hs +++ b/JVM/ClassFile.hs @@ -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