Sciweavers

ICFP
2010
ACM

Instance chains: type class programming without overlapping instances

14 years 15 days ago
Instance chains: type class programming without overlapping instances
Type classes have found a wide variety of uses in Haskell programs, from simple overloading of operators (such as equality or ordering) to complex invariants used to implement type-safe heterogeneous lists or limited subtyping. Unfortunately, many of the richer uses of type classes require extensions to the class system that have been incompletely described in the research literature and are not universally accepted within the Haskell community. This paper describes a new type class system, implemented in a prototype tool called ilab, that simplifies and enhances Haskellstyle type-class programming. In ilab, we replace overlapping instances with a new feature, instance chains, allowing explicit alternation and failure in instance declarations. We describe a technique for ascribing semantics to type class systems, relating classes, instances, and class constraints (such as kind signatures or functional dependencies) directly to a set-theoretic model of relations on types. Finally, we g...
J. Garrett Morris, Mark P. Jones
Added 09 Nov 2010
Updated 09 Nov 2010
Type Conference
Year 2010
Where ICFP
Authors J. Garrett Morris, Mark P. Jones
Comments (0)