3 ms·
The post drew a line between OOP and FP; for that line to mean anything, polymorphism would have to go with OOP. Which is what I meant by raw FP. And solving t
by sifoobar 8y ago
The post drew a line between OOP and FP; for that line to mean anything, polymorphism would have to go with OOP. Which is what I meant by raw FP.
And solving the same kind of problems without polymorphism (be that multiple dispatch, type classes or otherwise), is a struggle.
- polityagent 8y agoPolymorphism doesn't require anything to do with OOP or objects themselves, see clojure multi methods as an extremely pure example that involves nothing even close to an object. Protocols or typeclasses are also ways to implement functionality over (usually) immutable data. I don't see the relation to a mutable object with a closed set of methods defined at compile time.
- sifoobar 8y agoI didn't make the distinction, the post sort of did between the lines. Go back to my original comment and you'll see that multiple dispatch is what got us here. I never said anything about mutable/immutable data, I'm talking about polymorphism. But I did mention type classes as an alternative. I frankly fail to see how this is leading anywhere.