Left-bias and non-structural equality.
ahey at iee.org
Wed Jan 4 17:55:35 EST 2006
On Wednesday 04 Jan 2006 10:21 pm, Christian Maeder wrote:
> Adrian Hey wrote:
> > On Wednesday 04 Jan 2006 3:36 pm, Jean-Philippe Bernardy wrote:
> >> Agreed. Still, I have fixed the Current Data.Map and Data.Set so they
> >> match what the documentation says.
> > Yes, though I wonder how many people actually rely on this being
> > correct? Not many I suspect, since the implementations themselves were
> > incorrect in several cases :-)
> Fortunately not many people relied on biasing, but a few noticed a
> "wrong" bias. So fixing this is an improvement! I think, performance is
> hardly affected.
If they noticed it that can only be because they defined broken instances
of Ord :-). Though in all fairness the current overloaded (only) API
leaves little alternative (if you want access to the tree implementation).
This is what we want to discourage IMO (but of course we must provide
some alternative for cases like this).
> > I still think specifying this at all was a mistake and we should
> > deprecate all these functions. Unfortunately they use a lot of good
> > names, so maybe the entire API should be deprecated and put in
> > separate module (Data.OldSet or something).
> I can't follow you here.
I mean the new Set API should not make any promises regarding biasing,
but I guess the old biased API still needs to be made available for
those that rely on current biasing (albeit at the cost of changing
imports). Or they could just make local copies of Data.Set or the
AVL based clone I recently posted.
More information about the Libraries