fix Ord instance for MetaValue to work like Eq instance

This commit is contained in:
Joey Hess 2014-02-12 22:01:24 -04:00
parent 4789d9910a
commit 4d205b0fb9

View file

@ -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:
-