3 ms·
So how would a subtype of Addition look here? Who would tell stringEvaluator how to handle this SmallNumberAddition?
by tsimionescu 6y ago
So how would a subtype of Addition look here? Who would tell stringEvaluator how to handle this SmallNumberAddition?
- dwohnitmok 6y agoThere wouldn't be a subtype of Addition because Haskell doesn't have a notion of subtyping in the same way C# does. It would depend on the particulars of what the difference between SmallNumberAddition and Addition look like (in particular which parts are kept with the same functionality and which are different). The answer could be either a simple function or a typeclass depending on that.