summaryrefslogtreecommitdiff
path: root/Types
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-12 22:01:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-12 22:01:24 -0400
commit70aef104847247accc8da34e77c096672737a63f (patch)
tree60ca2036ef951e86184e0ef69e5b0d5ff69dda66 /Types
parente0eef9979943e67226ca606e1aaa58c9a18a1d40 (diff)
fix Ord instance for MetaValue to work like Eq instance
Diffstat (limited to 'Types')
-rw-r--r--Types/MetaData.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Types/MetaData.hs b/Types/MetaData.hs
index a8be9231d..53a9b6944 100644
--- a/Types/MetaData.hs
+++ b/Types/MetaData.hs
@@ -53,11 +53,13 @@ newtype MetaField = MetaField String
deriving (Show, Eq, Ord)
data MetaValue = MetaValue CurrentlySet String
- deriving (Show, Ord)
+ deriving (Show)
-{- Metadata values are compared equal whether currently set or not. -}
+{- Metadata values compare and order the same whether currently set or not. -}
instance Eq MetaValue where
MetaValue _ a == MetaValue _ b = a == b
+instance Ord MetaValue where
+ compare (MetaValue _ x) (MetaValue _ y) = compare x y
{- MetaData is serialized to a format like:
-