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.
Not so "entirely different": in Common Lisp, I can essentially implement "type classes" by dispatching at runtime on an explicit "interface" object.
-
-
I disagree that doing so is anything like type classes in Haskell
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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!