Conversation

I have issues with type classes as well but I share this concern with Brian - by parameterizing the entire data structure on a dictionary every method has that constraint, even those that don't need it (e.g. empty).
1
2
I still don't understand why its the end of the world. It's needed because the way you order the set is important for the semantics of the data structure. I'd be fine with the tradeoff.
2
2
IIUC, assuming you *only* value maximal polymorphism and as many free theorems as possible, at the expense of everything else, adding an Ord constraint is indeed a problem. But I don’t think that assumption makes much sense here, there are more things to consider.
2
My assumption here is: Dependently typed language with the full power to do type-level abstractions. Could you unpack "maximal polymorphism and as many free theorems as possible" a little more? I'm not up to speed enough with that terminology, alas.
1
Too tired for a primer on this honestly; looking up those terms or “parametricity” should help. Let’s just say, there are fewer ways to implement Dict a than Ord a => Dict a, because you have more operations on type a; having fewer choices can reduce the chance of a mistake.
2
1