Left-bias and non-structural equality.

Christian Maeder maeder at tzi.de
Wed Jan 4 10:52:12 EST 2006


Jean-Philippe Bernardy wrote:
>> data MapEntry a b = a := b
>>
>> instance Eq/Ord a => Eq/Ord (MapEntry a b) where
>>     compare (a1 := _) (a2 := _) = compare a1 a2
> 
> I would discourage such a use. This is exaclty why we provide Maps, after all.

Agreed, but suppose you have Symbols with their positions. Then you may 
like that a set of symbols is printed with the positions last (or first) 
inserted, although positions are ignored in camparisons.

C.


More information about the Libraries mailing list