Sciweavers

ICFP
2005
ACM

Associated type synonyms

14 years 11 months ago
Associated type synonyms
ML modules and Haskell type classes have proven to be highly effective tools for program structuring. Modules emphasize explicit configuration of program components and the use of data abstraction. Type classes emphasize implicit program construction and ad hoc polymorphism. In this paper, we show how the implicitlytyped style of type class programming may be supported within the framework of an explicitly-typed module language by viewing type classes as a particular mode of use of modules. The modular setting offers several benefits: programmers have explicit control over which type class instances are available for use by type inference in a given scope, class hierarchies are expressible in terms of module hierarchies, and extensions to Haskell such as associated type synonyms arise naturally as uses of existing module-language constructs. We formalize our approach as an elaboration relation in the style of Harper and Stone, and provide a sound type inference algorithm as a guide to...
Manuel M. T. Chakravarty, Gabriele Keller, Simon L
Added 13 Dec 2009
Updated 13 Dec 2009
Type Conference
Year 2005
Where ICFP
Authors Manuel M. T. Chakravarty, Gabriele Keller, Simon L. Peyton Jones
Comments (0)