Results 1  10
of
25
Phantom Types
, 2003
"... Phantom types are data types with type constraints associated with dierent cases. Examples of phantom types include typed type representations and typed higherorder abstract syntax trees. These types can be used to support typed generic functions, dynamic typing, and staged compilation in highe ..."
Abstract

Cited by 102 (2 self)
 Add to MetaCart
Phantom types are data types with type constraints associated with dierent cases. Examples of phantom types include typed type representations and typed higherorder abstract syntax trees. These types can be used to support typed generic functions, dynamic typing, and staged compilation in higherorder, statically typed languages such as Haskell or Standard ML. In our system, type constraints can be equations between type constructors as well as type functions of higherorder kinds. We prove type soundness and decidability for a Haskelllike language extended by phantom types.
Associated Types with Class
 In POPL ’05: Proceedings of the 32nd ACM SIGPLANSIGACT symposium on Principles of programming languages
, 2005
"... In this paper, we explore an extension to Haskell type classes that allows a type class declaration to define data types as well as values (or methods). Similarly, an instance declaration gives a witness for such data types, as well as a witness for each method. It turns out that this extension dire ..."
Abstract

Cited by 75 (22 self)
 Add to MetaCart
In this paper, we explore an extension to Haskell type classes that allows a type class declaration to define data types as well as values (or methods). Similarly, an instance declaration gives a witness for such data types, as well as a witness for each method. It turns out that this extension directly supports the idea of a typeindexed type, and is useful in many applications, especially for selfoptimising libraries that adapt their data representations and algorithms in a typedirected manner.
TypeIndexed Data Types
 SCIENCE OF COMPUTER PROGRAMMING
, 2004
"... A polytypic function is a function that can be instantiated on many data types to obtain data type specific functionality. Examples of polytypic functions are the functions that can be derived in Haskell, such as show , read , and ` '. More advanced examples are functions for digital searching, patt ..."
Abstract

Cited by 59 (21 self)
 Add to MetaCart
A polytypic function is a function that can be instantiated on many data types to obtain data type specific functionality. Examples of polytypic functions are the functions that can be derived in Haskell, such as show , read , and ` '. More advanced examples are functions for digital searching, pattern matching, unification, rewriting, and structure editing. For each of these problems, we not only have to define polytypic functionality, but also a typeindexed data type: a data type that is constructed in a generic way from an argument data type. For example, in the case of digital searching we have to define a search tree type by induction on the structure of the type of search keys. This paper shows how to define typeindexed data types, discusses several examples of typeindexed data types, and shows how to specialize typeindexed data types. The approach has been implemented in Generic Haskell, a generic programming extension of the functional language Haskell.
A Generic Programming Extension for Haskell
 Utrecht University
, 1999
"... Many functions can be dened completely generically for all datatypes. Examples include pretty printers (eg show), parsers (eg read), data converters, equality and comparison functions, mapping functions, and so forth. This paper proposes a generic programming extension that enables the user to dene ..."
Abstract

Cited by 40 (5 self)
 Add to MetaCart
Many functions can be dened completely generically for all datatypes. Examples include pretty printers (eg show), parsers (eg read), data converters, equality and comparison functions, mapping functions, and so forth. This paper proposes a generic programming extension that enables the user to dene such functions in Haskell. In particular, the proposal aims at generalizing Haskell's deriving construct, which is commonly considered decient since instance declarations can only be derived for a few predened classes. Using generic denitions derived instances can be specied for arbitrary userdened type classes and for classes that abstract over type constructors of rstorder kind. 1 Introduction Generic or polytypic programming aims at relieving the programmer from repeatedly writing functions of similar functionality for dierent datatypes. Typical examples for socalled generic functions include pretty printers (eg show), parsers (eg read), functions that convert data into a u...
Generic Haskell: applications
 In Generic Programming, Advanced Lectures, volume 2793 of LNCS
, 2003
"... Generic Haskell is an extension of Haskell that supports the construction of generic programs. These lecture notes discuss three advanced generic programming applications: generic dictionaries, compressing XML documents, and the zipper: a data structure used to represent a tree together with a s ..."
Abstract

Cited by 30 (16 self)
 Add to MetaCart
Generic Haskell is an extension of Haskell that supports the construction of generic programs. These lecture notes discuss three advanced generic programming applications: generic dictionaries, compressing XML documents, and the zipper: a data structure used to represent a tree together with a subtree that is the focus of attention, where that focus may move left, right, up or down the tree. When describing and implementing these examples, we will encounter some advanced features of Generic Haskell, such as typeindexed data types, dependencies between and generic abstractions of generic functions, adjusting a generic function using a default case, and generic functions with a special case for a particular constructor.
TypeCase: A Design Pattern for TypeIndexed Functions
, 2005
"... A typeindexed function is a function that is defined for each member of some family of types. Haskell's type class mechanism provides collections of open typeindexed functions, in which the indexing family can be extended by defining a new type class instance but the collection of functions is fix ..."
Abstract

Cited by 25 (10 self)
 Add to MetaCart
A typeindexed function is a function that is defined for each member of some family of types. Haskell's type class mechanism provides collections of open typeindexed functions, in which the indexing family can be extended by defining a new type class instance but the collection of functions is fixed. The purpose of this paper is to present TypeCase: a design pattern that allows the definition of closed typeindexed functions, in which the index family is fixed but the collection of functions is extensible. It is inspired by Cheney and Hinze's work on lightweight approaches to generic programming. We generalise their techniques as a design pattern. Furthermore, we show that typeindexed functions with typeindexed types, and consequently generic functions with generic types, can also be encoded in a lightweight manner, thereby overcoming one of the main limitations of the lightweight approaches.
Systematic search for lambda expressions
 In Proceedings Sixth Symposium on Trends in Functional Programming (TFP2005
, 2005
"... This paper presents a system for searching for desired small functional programs by just generating a sequence of typecorrect programs in a systematic and exhaustive manner and evaluating them. The main goal of this line of research is to ease functional programming, along with the subgoal to provi ..."
Abstract

Cited by 21 (1 self)
 Add to MetaCart
This paper presents a system for searching for desired small functional programs by just generating a sequence of typecorrect programs in a systematic and exhaustive manner and evaluating them. The main goal of this line of research is to ease functional programming, along with the subgoal to provide an axis to evaluate heuristic approaches to program synthesis such as genetic programming by telling the best performance possible by exhaustive search algorithms. While our previous approach to that goal used combinatory expressions in order to simplify the synthesis process, which led to redundant combinator expressions with complex types, this time we use de Bruijn lambda expressions and enjoy improved results. 1
Comparing Libraries for Generic Programming in Haskell
, 2008
"... Datatypegeneric programming is defining functions that depend on the structure, or “shape”, of datatypes. It has been around for more than 10 years, and a lot of progress has been made, in particular in the lazy functional programming language Haskell. There are more than 10 proposals for generic p ..."
Abstract

Cited by 20 (10 self)
 Add to MetaCart
Datatypegeneric programming is defining functions that depend on the structure, or “shape”, of datatypes. It has been around for more than 10 years, and a lot of progress has been made, in particular in the lazy functional programming language Haskell. There are more than 10 proposals for generic programming libraries or language extensions for Haskell. To compare and characterize the many generic programming libraries in a typed functional language, we introduce a set of criteria and develop a generic programming benchmark: a set of characteristic examples testing various facets of datatypegeneric programming. We have implemented the benchmark for nine existing Haskell generic programming libraries and present the evaluation of the libraries. The comparison is useful for reaching a common standard for generic programming, but also for a programmer who has to choose a particular approach for datatypegeneric programming.
Memo Functions, Polytypically!
 Proceedings of the 2nd Workshop on Generic Programming, Ponte de
, 2000
"... . This paper presents a polytypic implementation of memo functions that are based on digital search trees. A memo function can be seen as the composition of a tabulation function that creates a memo table and a lookup function that queries the table. We show that tabulation can be derived from ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
. This paper presents a polytypic implementation of memo functions that are based on digital search trees. A memo function can be seen as the composition of a tabulation function that creates a memo table and a lookup function that queries the table. We show that tabulation can be derived from lookup by inverse function construction. The type of memo tables is dened by induction on the structure of argument types and is parametric with respect to the result type of memo functions. A memo table for a xed argument type is then a functor and lookup and tabulation are natural isomorphisms. We provide simple polytypic proofs of these properties. 1 Introduction A memo function [11] is like an ordinary function except that it caches previously computed values. If it is applied a second time to a particular argument, it immediately returns the cached result, rather than recomputing it. For storing arguments and results a memo function internally employs an index structure, the ...
Polytypic Programming With Ease
, 1999
"... A functional polytypic program is one that is parameterised by datatype. Since polytypic functions are defined by induction on types rather than by induction on values they typically operate on a higher level of abstraction than their monotypic counterparts. However, polytypic programming is not nec ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
A functional polytypic program is one that is parameterised by datatype. Since polytypic functions are defined by induction on types rather than by induction on values they typically operate on a higher level of abstraction than their monotypic counterparts. However, polytypic programming is not necessarily more complicated than conventional programming. We show that a polytypic function is uniquely defined by its action on constant functors, projection functors, sums, and products. This information is sufficient to specialize a polytypic function to arbitrary polymorphic datatypes, including mutually recursive datatypes and nested datatypes. The key idea is to use infinite trees as index sets for polytypic functions and to interpret datatypes as algebraic trees. This approach appears both to be simpler, more general, and more efficient than previous ones which are based on the initial algebra semantics of datatypes. Polytypic functions enjoy polytypic properties. We show that wellkno...