MetaCart Sign in to MyCiteSeerX

Include Citations | Advanced Search | Help

Disambiguated Search | Include Citations | Advanced Search | Help

Restricted Data Types in Haskell (1999) [8 citations — 0 self]

by John Hughes
Proceedings of the 1999 Haskell Workshop. Number
Add To MetaCart

Abstract:

The implementations of abstract type constructors must often restrict the type parameters: for example, one implementation of sets may require equality on the element type, while another implementation requires an ordering. Haskell has no mechanism to abstract over such restrictions, which can hinder us from replacing one implementation by another, or making several implementations instances of the same class. This paper proposes a language extension called restricted data types to address this problem. A restricted data type definition specifies a condition which argument types must satisfy for the data type to be well-formed. Every type in a program must be well-formed, and we add an explicit notation to express such requirements. Thus programmers can simply state that a type must be well-formed, rather than repeat its restriction explicitly. We explain our extension via a simulation using multi-parameter classes, which serves to specify its semantics. We show its applic...

Citations

87 Generalising monads to arrows – Hughes - 2000
74 Type classes: Exploring the design space – Jones, Jones, et al. - 1997
18 Lightweight extensible records for Haskell – Jones, Jones - 1999
2 Bulk types with class – Peyton-Jones - 1996