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.
-
-
Yeah, Smalltalk’s message passing paradigm is the problem that multimethods solve by detaching methods from any single class.
-
Incidentally, the main difference between multimethods and type classes is that multimethods are dispatched on the runtime types while typeclasses are dispatched on compile-time types.
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!