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.
-
-
Arguments about hypothetical tools that don’t exist aren’t very persuasive to me. The non-local reasoning (practically) required by inheritance is real and detrimental to large OOP code base I’ve worked on.
-
Hypothetical? Those tools exist, at least for Common Lisp. To achieve equivalent functionality without inheritance, I am composing a large number of higher order modules, and using module and signature inclusion. This is just as "non local", but only sucks in comparison.
End of conversation
New conversation -
-
-
Except where OOP = Smalltalk.
-
You can write typeclasses in Smalltalk, just like you do in Common Lisp, using "Interface-Passing Style", with an explicit interface object.
- 4 more 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.
Read my blog!