Got into yet another argument that Haskell's type classes were superior to Scala's because Haskell has global instance uniqueness. Problem being, as far as I can tell, this is true in theory (by specifications) but not in practice (by implementation): https://nrinaudo.github.io/typeclasses/haskell.html …
The argument is practical Write Haskell; never use orphan instances. This is achievable with little/no penalty Write Scala; never use orphan instances. With this commitment, it's difficult & there's no sweet spot Scala does not have type-classes in any general practical sense
-
-
That is entirely besides the point though. My point is: GHC doesn't enforce global instance uniqueness. This is demonstrably true, but exhibiting a program in which global instance uniquess is violated. Whether or not it's easy to avoid is another discussion
-
I will agree that a well disciplined team with 0 external dependencies will have no such problem in Haskell, but is almost guaranteed to have them in Scala. I'm not aware of a mechanism by which you can guarantee that your Haskell dependencies don't do what I did though.
End of conversation
New conversation -
-
-
The separate discussion that you're answering to is interesting though. I'd like to know how you define a type class, and in which way that definition invalidates Scala's encoding of them. This is neither a challenge nor sarcasm. I'm genuinely interested.
-
It's a rabbit hole! Happy to go there though.
- 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.