Home > lambdatheultimate > Type Classes as Objects and Implicits

Type Classes as Objects and Implicits

August 4th, 2010 08:25 admin Leave a comment Go to comments

Type Classes as Objects and Implicits

Type classes were originally developed in Haskell as a disciplined alternative to ad-hoc polymorphism. Type classes have been shown to provide a type-safe solution to important challenges in software engineering and programming languages such as, for example, retroactive extension of programs. They are also recognized as a good mechanism for concept-based generic programming and, more recently, have evolved into a mechanism for type-level computation. This paper presents a lightweight approach to type classes in object-oriented (OO) languages with generics using the CONCEPT pattern and implicits (a type-directed implicit parameter passing mechanism).

This paper also shows how Scala’s type system conspires with implicits to enable, and even surpass, many common extensions of the Haskell type class system, making Scala ideally suited for generic programming in the large.

Martin Odersky and team’s design decisions around how to do type classes in a unified OO and FP language continue to bear fascinating fruit. Implicits look less and less like “poor man’s type classes,” and more and more like an improvement upon type classes, in my opinion given a quick read of this paper.

Source: Type Classes as Objects and Implicits

Related Articles:

  1. Scala in the Enterprise: Creator Launches New Professional Support Company
  2. Scala Designer Martin Odersky On Next Steps
  3. Revisiting the "Holy Trinity" of MMORPG Classes
  4. Feature-Oriented Programming with Object Algebras
  5. Feature-Oriented Programming with Object Algebras
blog comments powered by Disqus