[Main website]

problem/the-expression-problem

If one define an Expr type, in FP it is easy to add new functions (i.e. methods in OOP), but it is difficult to add new cases to the Expr algebraic structure. In OOP, on the contrary, it is easy adding subtypes of Expr, but it is difficult adding methods.