RepLib: A library for derivable type classes

Loading...
Thumbnail Image
Penn collection
Departmental Papers (CIS)
Degree type
Discipline
Subject
generic programming
representation type
Haskell
type class
Funder
Grant number
License
Copyright date
Distributor
Related resources
Contributor
Abstract

Some type class instances can be automatically derived from the structure of types. As a result, the Haskell language includes the deriving mechanism to automatic generates such instances for a small number of built-in type classes. In this paper, we present RepLib, a GHC library that enables a similar mechanism for arbitrary type classes. Users of RepLib can define the relationship between the structure of a datatype and the associated instance declaration by a normal Haskell functions that pattern-matches a representation types. Furthermore, operations defined in this manner are extensible-instances for specific types not defined by type structure may also be incorporated. Finally, this library also supports the definition of operations defined by parameterized types.

Advisor
Date of presentation
2006-09-17
Conference name
Departmental Papers (CIS)
Conference dates
2023-05-17T02:08:51.000
Conference location
Date Range for Data Collection (Start Date)
Date Range for Data Collection (End Date)
Digital Object Identifier
Series name and number
Volume number
Issue number
Publisher
Publisher DOI
Journal Issue
Comments
Postprint version. Published in Proceedings of the 2006 ACM SIGPLAN workshop on Haskell, September 2006, pages 1-12. Publisher URL: http://doi.acm.org/10.1145/1159842.1159844
Recommended citation
Collection