Two reasons type classes are superior to OOP-style interfaces: 1. You can define instances for 3rd party data types 2. You can use the same data but different logic Type classes decouple capabilities from both types and data, giving you increased flexibility and power.
-
-
Smalltalk is OOP at its best, IMO, light years beyond Java et al.
-
I'll claim CLOS is ahead.
- 2 more replies
New conversation -
-
-
Forget OOP for a sec, let's just talk about interfaces, as seen in Java, C#, etc. Can we agree that type classes are strictly more powerful than those?
-
Yes, but they also use return-type polymorphism, which violates type erasure. So you don't get something for nothing.
End of conversation
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.
Read my blog!