Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Type classes in Haskell
Hall C., Hammond K., Peyton Jones S., Wadler P. ACM Transactions on Programming Languages and Systems18 (2):109-138,1996.Type:Article
Date Reviewed: Mar 1 1997

Type inferencing in a subset of Haskell that contains overloading (but not pattern matching) is described. The process involves adding extra parameters to overloaded functions, thus making the previously implicit typing explicit. Rules are provided for translating Haskell source into a target language (a typed lambda calculus with type abstraction and application).

A type class is a parameterized type with defined operations, possibly inheriting operations from another such class. When type classes are introduced in Haskell, environments are augmented to hold information about bindings. There are environments for six different kinds of objects. The translation of an expression requires extracting information from these environments to resolve the type of the expression, which is added to the translation.

I was left feeling vaguely uneasy. The outline discussing classes and instances is fine, and the translation approach as an implementation technique seems reasonable. However, computing has a long history of language features being defined by translation (for example, if-then-else defined via jumps), which can be a sign that the appropriate level of abstraction for the language feature has not yet been found. This concern was reinforced by the observation in the paper that Haskell proper has over 100 translation rules for types.

Leaving that aside, the paper should be of value to language designers and high-level implementors who want to learn techniques for managing types with inheritance. As the style is not particularly readable, it would probably not be of great interest to the casual computer scientist.

Reviewer:  C. M. Holt Review #: CR120135 (9703-0207)
Bookmark and Share
 
Type Structure (F.3.3 ... )
 
 
Haskell (D.3.2 ... )
 
 
Applicative (Functional) Programming (D.1.1 )
 
Would you recommend this review?
yes
no
Other reviews under "Type Structure": Date
Equational type logic
Manca V., Salibra A., Scollo G. (ed) Theoretical Computer Science 77(1-2): 131-159, 1990. Type: Article
Dec 1 1991
Data types over multiple-valued logics
Pigozzi D. Theoretical Computer Science 77(1-2): 161-194, 1990. Type: Article
Aug 1 1992
An algebraically specified language for data directed design
Wagner E. Theoretical Computer Science 77(1-2): 195-219, 1990. Type: Article
Jul 1 1991
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy