4 ms·
But at the same time, something that could be achieved by something like Haskell typeclasses, e.g. a "concatenatable" typeclass - which then gives you more poly
by 14113 12y ago
But at the same time, something that could be achieved by something like Haskell typeclasses, e.g. a "concatenatable" typeclass - which then gives you more polymorphism for free than you originally anticipated!
- loqi 12y agoDefining an instance of "concatenable" (eg, Monoid) for some type in Haskell is pretty much isomorphic to overloading some free function (or operator) on some type in C++. It's the same "amount of polymorphism" either way, namely ad-hoc polymorphism.