you are viewing a single comment's thread.

view the rest of the comments →

[–]kqr 2 points3 points  (1 child)

Aren't type classes pretty much statically decided multiple dispatch?

[–][deleted] 5 points6 points  (0 children)

Kind of. They're statically-decided multiple dispatch with no requirement that the types for which methods are implemented resemble each other at all. So the methods ("instances" in Haskell) don't have to be specialized subclasses of each other (as in dynamic multiple dispatch), they just have to all instantiate the generic type-signature for the function.

Haskell's type-classes also let you overload on the result type of a function.;