Programming with Type Classes

Programming with Type Classes

Typically, object-oriented and functional languages don't have a lot in common. Former usually implement polymorphism through class hierachies and inheritance. Haskell, being a prototypical functional language, offers polymorphism through another mechanism: type classes. This is available in Scala as well! With type classes it becomes surprisingly easy to abstract over completely different classes and methods.

A1216674d5c9747bcdcc716872439137?s=128

Lars Hupel

April 22, 2013
Tweet