Corpus ID: 2652758

Generics as a Library

@inproceedings{Hinze2006GenericsAA,
  title={Generics as a Library},
  author={Ralf Hinze and Bruno C. d. S. Oliveira},
  year={2006}
}
A generic function is a function that is defined on the structure of data types: with a single definition, we obtain a function that works for many data types. In contrast, an ad-hoc polymorphic function requires a separate implementation for each data type. Previous work by Hinze on lightweight generic programming has introduced techniques that allow the definition of generic functions directly in Haskell. A severe drawback of these approaches is that generic functions, once defined, cannot be… Expand
Extensible and modular generics for the masses
TLDR
A revised version of Hinze’s Generics for the masses approach is presented, which shows that writing an extensible and modular generic programming library in Haskell 98 is possible and can be extended with ad-hoc behaviour for new data types. Expand
Instant Generics: Fast and Easy
This paper introduces a novel approach to datatype-generic programming based on type classes and type families. The approach favours simplicity as generic functions are based on Haskell’s standardExpand
RepLib: a library for derivable type classes
TLDR
RepLib is presented, a GHC library that enables a similar mechanism for arbitrary type classes to be enabled, and supports the definition of operations defined by parameterized types. Expand
Datatype-Generic Programming
  • J. Gibbons
  • Computer Science
  • Lecture Notes in Computer Science
  • 2007
TLDR
This lecture notes expands on the definition of datatype-generic programming, and explores the connection with design patterns in object-oriented programming; in particular, it is argued that certain design patterns are just higher-order datatypes-generic programs. Expand
Generics for the working ML'er
TLDR
This paper presents a technique that allows an existing value-dependent encoding to be extended with new values, and shows how to encode type representations over essentially all the ML-types. Expand
Modular generic programming with extensible superclasses
TLDR
Type classes with extensible superclasses are formalized as the combination of a previously introduced type-passing translation scheme and a general type class framework to shed some new light on the use of type classes to support generic programming. Expand
Comparing Approaches to Generic Programming in Haskell
TLDR
In these lecture notes, the various approaches to datatype-generic programming in Haskell are compared by means of example, and they are evaluated along different dimensions (expressivity, ease of use, and so on). Expand
Generic and Indexed Programming
  • J. Gibbons
  • Computer Science
  • Lecture Notes in Computer Science
  • 2012
TLDR
This paper surveys three distinct approaches to bidirectional programming and pays particular attention to use of complements, which are structures that represent the information discarded by the transformation in the forward direction. Expand
Generic and Indexed Programming (Project Paper)
The EPSRC-funded Generic and Indexed Programming project will explore the interaction between datatype-generic programming (DGP) — programs parametrized by the shape of their data — and indexedExpand

References

SHOWING 1-10 OF 22 REFERENCES
Generics for the masses
TLDR
The purpose of this pearl is to show that one can, in fact, program generically within Haskell 98 obviating to some extent the need for fancy type systems or separate tools. Expand
Derivable Type Classes
TLDR
This paper proposes a simple type-class system extension to allow the programmer to write richer contexts than is currently possible within the Haskell language, without radically changing the language or its type system. Expand
Generic Functional Programming with Types and Relations
TLDR
The purpose of this paper is to explore the possibility of deriving generic programs by recasting part of the theory of lists that deals with segments as a theory about ‘segments’ in a wide class of datatypes and then used to pose and solve a generic version of a well-known problem. Expand
TypeCase: a design pattern for type-indexed functions
TLDR
TypeCase is presented, a design pattern that allows the definition of closed type-indexed functions, in which the index family is fixed but the collection of functions is extensible, inspired by Cheney and Hinze's work on lightweight approaches to generic programming. Expand
Open data types and open functions
TLDR
This work presents a semantically and syntactically lightweight variant of open data types and open functions as a solution to the expression problem in the Haskell language and shows that the solution is applicable to theexpression problem, generic programming, and exceptions. Expand
Exploring generic Haskell
TLDR
The thesis starts with the presentation of a simple functional core language which is gradually extended with features that allow generic programming, and shows how generic programming can benefit from the concept of dependencies. Expand
An open and shut typecase
TLDR
A language is defined that supports both forms of ad-hoc polymorphism, using the same basic constructs, and is important to let programmers decide which is most appropriate for their needs. Expand
Scrap your boilerplate with class: extensible generic functions
TLDR
This paper extends the 'Scrap your boilerplate' approach to generic programming to support this open style, and demonstrates the desirability of abstraction over type classes, and the usefulness of recursive dictionarie. Expand
Functional Polytypic Programming
TLDR
This dissertation introduces polytypic programming for functional programming languages, shows how to construct and prove properties ofpolytypic algorithms, presents the language extension PolyP for implementing polytyPic algorithms in a type safe way, and presents a number of applications of polyTYpic programming. Expand
Prototyping Generic Programming in Template Haskell
Generic Programming deals with the construction of programs that can be applied to many different datatypes. This is achieved by parameterizing the generic programs by the structure of the datatypesExpand
...
1
2
3
...