Type classes as objects and implicits
- 17 October 2010
- conference paper
- conference paper
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM international conference on Object oriented programming systems languages and applications - OOPSLA '10
- Vol. 45 (10), 341-360
- https://doi.org/10.1145/1869459.1869489
Abstract
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. © 2010 ACM.link_to_subscribed_fulltexKeywords
This publication has 32 references indexed in Scilit:
- A language for generic programming in the largeScience of Computer Programming, 2011
- On understanding data abstraction, revisitedACM SIGPLAN Notices, 2009
- First-Class Type ClassesLecture Notes in Computer Science, 2008
- An extended comparative study of language support for generic programmingJournal of Functional Programming, 2007
- Faking it Simulating dependent types in HaskellJournal of Functional Programming, 2002
- Functional unparsingJournal of Functional Programming, 1998
- Type classes in HaskellACM Transactions on Programming Languages and Systems, 1996
- Typechecking and modules for multimethodsACM Transactions on Programming Languages and Systems, 1995
- A Denotational Semantics of Inheritance and Its CorrectnessInformation and Computation, 1994
- Abstract types have existential typeACM Transactions on Programming Languages and Systems, 1988