## Generating generic functions (2006)

Venue: | In WGP ’06: Proceedings of the 2006 ACM SIGPLAN workshop on Generic programming |

Citations: | 1 - 0 self |

### BibTeX

@INPROCEEDINGS{Jeuring06generatinggeneric,

author = {Johan Jeuring and Alexey Rodriguez and Gideon Smeding},

title = {Generating generic functions},

booktitle = {In WGP ’06: Proceedings of the 2006 ACM SIGPLAN workshop on Generic programming},

year = {2006},

pages = {23--32},

publisher = {ACM Press}

}

### OpenURL

### Abstract

www.cs.uu.nl

### Citations

308 | QuickCheck: A lightweight tool for random testing of Haskell programs
- Claessen, Hughes
- 2000
(Show Context)
Citation Context ... type. In this paper we use the Djinn tool [2] for the type-based generation. • The generated terms are pruned by testing each term against properties it should satisfy. We use the QuickCheck library =-=[5]-=- for testing. • The set of candidate generic functions is constructed by taking the cross-product of the generated function cases.s• This set is pruned by testing each candidate against examples insta... |

157 | Simple unification-based type inference for GADTs
- Jones, Vytiniotis, et al.
- 2006
(Show Context)
Citation Context ...ll-typed terms. In this way it becomes possible to implement an efficient interpreter that does away with the tagging and untagging that an untyped interpreter needs. Generalized algebraic data types =-=[21, 20]-=- (GADTs) play an essential rôle here. Moreover, since the interpreted values are Haskell values, it is possible to use the QuickCheck library. In the rest of this section we describe our typed interpr... |

132 |
Contraction-free Sequent Calculi for Intuitionistic Logic
- Dyckhoff
- 1992
(Show Context)
Citation Context ...against the instances. 4.1 Djinn In this paper we use Djinn for the type-based generation of terms. This tool implements a decision procedure for intuitionistic propositional calculus due to Dyckhoff =-=[6]-=-, and, effectively exploiting the Curry-Howard correspondence, uses it to solve the typeinhabitation problem for the simply-typed lambda calculus.sTo an end user, Djinn looks like the interactive envi... |

129 | Guarded recursive datatype constructors
- Xi, Chen, et al.
- 2003
(Show Context)
Citation Context ...ll-typed terms. In this way it becomes possible to implement an efficient interpreter that does away with the tagging and untagging that an untyped interpreter needs. Generalized algebraic data types =-=[21, 20]-=- (GADTs) play an essential rôle here. Moreover, since the interpreted values are Haskell values, it is possible to use the QuickCheck library. In the rest of this section we describe our typed interpr... |

107 | Polytypic values possess polykinded types
- Hinze
- 2000
(Show Context)
Citation Context ...: GenSignature → GenDefinition → Type → Expr. The definitions of these functions are based upon the standard specialization algorithms for Generic Haskell, which have been described in several places =-=[10, 11, 16]-=-, and are therefore omitted from this paper.s5.2 Typing untyped terms To turn Djinn-generated terms into untagged Haskell values we first have to type them. This section briefly explains how we type t... |

84 | Generic programming – an introduction
- Backhouse, Jansson, et al.
- 1999
(Show Context)
Citation Context ...he same semantics as the functions I gave when I introduced the function. Examples of this approach have been given by Hinze [8] for generalized folds, Gibbons [7] for accumulations, Backhouse et al. =-=[4]-=- for maps, and by many other authors introducing new generic functions. This approach has worked well, and both readers and students are usually convinced by the argument. However, it raises the quest... |

68 | Exploring Generic Haskell
- Löh
- 2004
(Show Context)
Citation Context ...lexey,gjsmedin}@cs.uu.nl question will be negative. Even the weaker problem of finding the type of the generic function that generalizes from the types of the examples does not have a unique solution =-=[16]-=-. The story doesn’t end here, though. First, combining a desired type of a generic function with example instances might lead to fewer, and maybe even unique, solutions. And even though there might no... |

65 | Generic Haskell: Practice and theory
- Hinze, Jeuring
- 2003
(Show Context)
Citation Context ...ed function cases.s• This set is pruned by testing each candidate against examples instances. In this phase, candidate functions are instantiated using the specialization algorithm of Generic Haskell =-=[11, 18, 16]-=-. This paper is organized as follows. Section 2 introduces typeindexed and generic functions and briefly shows how Generic Haskell generates code for generic functions. Section 3 shows how a generic p... |

57 | Typing dynamic typing
- Baars, Swierstra
- 2002
(Show Context)
Citation Context ...ues we first have to type them. This section briefly explains how we type the untyped terms generated by Djinn. Our approach is reminiscent of the dynamic typing solution given by Baars and Swierstra =-=[3]-=- for a similar problem. The main difference is that we use De Bruijn indices for variables, making it impossible to fail when looking up a variable. Typed terms are defined as a GADT to enforce the co... |

32 | Generic Programs and Proofs
- Hinze
- 2000
(Show Context)
Citation Context ... is reduced to a call on type T ◦ . For example, for equality we obtain a function of type a ◦ → a ◦ → Bool. To convert this function back to a function of type a → a → Bool we use the function bimap =-=[9]-=-. Hence, if the generic function is defined for view types such as Unit, +, and ×, we do not need cases for specific data types such as List or Tree anymore. For primitive types such as Int, Float, IO... |

25 | Generic views on data types
- Holdermans, Jeuring, et al.
- 2006
(Show Context)
Citation Context ...on algorithm of Generic Haskell. If our set of view types would include one or more recursive data types, which would be the case if we would use the view types for the fixed-point view on data types =-=[12]-=-, which includes the data type Fix, this would be a problem. Furthermore, this Djinn restriction also rules out generating generic functions with recursive types in their signatures. For example, sinc... |

21 | Systematic search for lambda expressions
- Katayama
- 1998
(Show Context)
Citation Context ...on. • Third, it formalizes the informal procedure with which we started this paper. Recently there has been growing interest in the automatic generation of functions from user-provided specifications =-=[14, 15, 2]-=-, mainly consisting of a type and a set of input-output examples. However, the function generation research above is not directly applicable to the generation of generic functions due to their differe... |

19 | Generic downwards accumulations
- Gibbons
- 2000
(Show Context)
Citation Context ...es List and Tree, I get functions with the same semantics as the functions I gave when I introduced the function. Examples of this approach have been given by Hinze [8] for generalized folds, Gibbons =-=[7]-=- for accumulations, Backhouse et al. [4] for maps, and by many other authors introducing new generic functions. This approach has worked well, and both readers and students are usually convinced by th... |

13 |
PolyLib — a polytypic function library
- Jansson, Jeuring
- 1998
(Show Context)
Citation Context ...egers (presumably representing entries in the ASCII table) by supplying the function ord. This type of generalization is very common in generic programming, for example, the type of pequal in PolyLib =-=[13]-=-, the library of PolyP, is (a → b → Bool) → d a → d b → Bool. The type of a generic function can always safely be generalized: the generic function obtained from the code generated by Djinn with a mor... |

12 | First-order unification by structural recursion
- McBride
- 2003
(Show Context)
Citation Context ... env a TLambda :: TExpr (a, env) b → TExpr env (a → b) evaluate :: TExpr () a → a This presentation is heavily inspired by the representation of typed terms in dependently typed programming languages =-=[19]-=-. The TExpr data type represents a valid typing judgement that follows the structure of a typed term. The first argument is the environment under which the judgement holds and the second argument is t... |

11 | Efficient generalized folds
- Hinze
- 1999
(Show Context)
Citation Context ...ause if I instantiate it on the types List and Tree, I get functions with the same semantics as the functions I gave when I introduced the function. Examples of this approach have been given by Hinze =-=[8]-=- for generalized folds, Gibbons [7] for accumulations, Backhouse et al. [4] for maps, and by many other authors introducing new generic functions. This approach has worked well, and both readers and s... |

4 |
Announcing Djinn, version 2004-12-11, a coding wizard. http://permalink.gmane.org/ gmane.comp.lang.haskell.general/12747
- Augustsson
- 2005
(Show Context)
Citation Context ...on. • Third, it formalizes the informal procedure with which we started this paper. Recently there has been growing interest in the automatic generation of functions from user-provided specifications =-=[14, 15, 2]-=-, mainly consisting of a type and a set of input-output examples. However, the function generation research above is not directly applicable to the generation of generic functions due to their differe... |

4 |
Löh and Johan Jeuring (editors). The Generic Haskell user’s guide, version 1.42 - coral release
- Andres
- 2005
(Show Context)
Citation Context ...Djinn [2] and Katayama’s MagicHaskeller [14] generate polymorphic functions but not generic functions. In this paper, we propose a procedure for the generation of generic functions in Generic Haskell =-=[18]-=-. Generic Haskell is an extension of Haskell that supports the definition of datatype-generic functions. Generic functions are generated from a user-provided specification consisting of the type of a ... |

2 |
and Rinus Plasmeijer. Systematic synthesis of functions
- Koopman
- 2006
(Show Context)
Citation Context ...on. • Third, it formalizes the informal procedure with which we started this paper. Recently there has been growing interest in the automatic generation of functions from user-provided specifications =-=[14, 15, 2]-=-, mainly consisting of a type and a set of input-output examples. However, the function generation research above is not directly applicable to the generation of generic functions due to their differe... |