
21 Mar
2011
21 Mar
'11
4:12 p.m.
Andrew Coppin schrieb:
Haskell has ADTs. Most of the time, these work great. As I've written in several other places (but possibly not here), OO languages tend to "factor" the problem the other way. That is, if I want a binary tree, an OO language makes me split the type and all of its operations into three parts (an abstract base class, a branch subclass, and a leaf subclass). Adding each new operation requires adding an abstract version of it to the abstract base class, and putting half of the implementation into each concrete subclass.
I think, that's known as the 'expression problem'. http://en.wikipedia.org/wiki/Expression_problem