Ticket #4369 (closed bug: fixed)
No instances for Eq and Ord for Located e
Description
There are no Eq and Ord instances for Located e. Such instances would be useful for storing a Located e in e.g. a Set. I propose the two following instances:
instance Eq e => Eq (Located e) where
L loc1 e1 == L loc2 e2 = loc1 == loc2 && e1 == e2
instance Ord e => Ord (Located e) where
compare (L loc1 e1) (L loc2 e2) = case compare loc1 loc2 of
LT -> LT
GT -> GT
EQ -> compare e1 e2
Change History
Note: See
TracTickets for help on using
tickets.
