4 ms·
This doesn't appear to have anything to do with type classes or overloading, but rather with (unconstrained) parametric polymorphism. Such a function is easy t
by detrino 13y ago
This doesn't appear to have anything to do with type classes or overloading, but rather with (unconstrained) parametric polymorphism.
Such a function is easy to write in C++, but the function prototype can not provide a strong guarantee that your b value will only be produced by your callback.
- sixbrx 13y ago> but the function prototype can not provide a strong guarantee It doesn't provide any such guarantee, and I think that was the whole point.
- dllthomas 13y agoThere are limits placed on you by parametric polymorphism. Adding typeclass constraints in Haskell is how you weaken those limits in a controlled way. So I think it has quite a bit to do with typeclasses. I agree "overloading" might not be the correct term to use here, although it is itself a bit... overloaded.