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.


Lars Hupel

April 22, 2013