I'm genuinely interested and ready to go down that rabbit hole, but do not mean to presume that you have the time to.
-
-
We can start with a shortcut! Have you seen the attempts at a Scala type-class hierarchy, dating back to 2005, using implicits and sub-typing, and still not getting it right? i.e. there is still not a usable type-class hierarchy, 15 years later.
1 reply 0 retweets 0 likes -
Are we limiting type class to categorial abstractions here? Or do you mean any type class, even ones such as `Eq`, for example?
1 reply 0 retweets 0 likes -
No limits. Just all the type-classes, including those we haven't thought of yet (and especially, for example, those that we have). Though equality is broken on the JVM from the outset.
1 reply 0 retweets 0 likes -
Mmm... I'm not following. You're talking about Functor <: Applicative <: Monad <:... right? If we assume that they are broken - you've exposed a bad implementation, but that doesn't invalidate the principle though. It doesn't show it's impossible to implement a sane, say, Show
3 replies 0 retweets 0 likes -
Replying to @NicolasRinaudo @dibblego and
That's why I asked for a definition. My very informal, likely incorret definition is, a type class is syntactic sugar for passing dictionaries around (+ implicit composition, which is really, really nice). Haskell has that. But so does Scala.
1 reply 0 retweets 0 likes -
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"
1 reply 0 retweets 0 likes -
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?
1 reply 0 retweets 0 likes -
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.
1 reply 0 retweets 0 likes -
Yes, I agree with that: Haskell, the language, has that guarantee. But GHC, one possible but popular implementation of the language, doesn't. My point has always been GHC doesn't have type classes according to that definition, not Haskell doesns't.
2 replies 0 retweets 0 likes
BTW, here is the critical difference between type-classes and data types, for the purposes of a definition:https://gist.github.com/tonymorris/466f6a88aea8e0a56510b425724b84a8 …
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.