
21 Jun
2008
21 Jun
'08
5:19 a.m.
Adrian Hey wrote:
So I think I would really like to see a subclass that *does* guarantee Ordering that is consistent with Ord.
Why not just use class (Ord k, GMap map k) => OrderedGMap map k where instead of class GMap map k => OrderedGMap map k where compareKey :: k -> k -> Ordering for a class that indicates consistent ordering? I mean, you control the instances. For example, you can implement instance OrdGMap map k => OrdGMap map [k] because you know what the Ord instance for lists looks like. Regards, apfelmus