Fair enough - what did I miss in my (nasty) bit of code? Doesn't it expose exactly the fact that global uniqueness is not guaranteed by ghc? Who's got the bigger type class implementation is another debate entirely and not at all the point I was making, sorry if it was unclear
That's the definition of type-classes. It's a 1:1 mapping from class to data type so that it can be implicitly passed. i.e. "global uniqueness" is not a feature, it's in the definition. It's even in the name. "type" "class"
-
-
So - if type classes *must* have guaranteed global instance uniqueness, then that's fair - Scala doesn't have type classes according to that definition. But then - why do you consider that Haskell, as implemented in GHC, does?
-
Haskell, the language will refuse to compile it. Simply, it violates the language standard. You must turn off this standard to break the rules. Though I'm much more interested in the question, "is there a valid or practical reason to turn off those rules?" Hard: no.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.