From a5c02f36ec0a4166c6d463da9b9451fe9c481510 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 10 Nov 2007 14:14:18 +0000 Subject: [PATCH] Removed the Metadata hack (where emptyMeta was "equal" to every other Meta data tag) --- common/Metadata.hs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/common/Metadata.hs b/common/Metadata.hs index e75dd06..2ef12b4 100644 --- a/common/Metadata.hs +++ b/common/Metadata.hs @@ -30,7 +30,7 @@ data Meta = Meta { metaLine :: Int, metaColumn :: Int } - deriving (Typeable, Data, Ord) + deriving (Typeable, Data, Ord, Eq) emptyMeta :: Meta emptyMeta = Meta { @@ -45,13 +45,6 @@ instance Show Meta where Just s -> s ++ ":" ++ show (metaLine m) ++ ":" ++ show (metaColumn m) Nothing -> "no source position" ---emptyMeta is equal to any meta tag: -instance Eq Meta where - (==) a b = - if ((metaFile a == Nothing) && (metaLine a == 0) && (metaColumn a == 0)) then True else - if ((metaFile b == Nothing) && (metaLine b == 0) && (metaColumn b == 0)) then True else - ((metaFile a == metaFile b) && (metaLine a == metaLine b) && (metaColumn a == metaColumn b)) - -- | Encode a Meta as the prefix of a string. packMeta :: Meta -> String -> String packMeta m s