## Generic programming with dependent types (2006)

Venue: | Spring School on Datatype Generic Programming |

Citations: | 4 - 0 self |

### BibTeX

@INPROCEEDINGS{Altenkirch06genericprogramming,

author = {Thorsten Altenkirch and Conor Mcbride and Peter Morris},

title = {Generic programming with dependent types},

booktitle = {Spring School on Datatype Generic Programming},

year = {2006},

publisher = {Springer-Verlag}

}

### OpenURL

### Abstract

In these lecture notes we give an overview of recent research on the relationship

### Citations

342 |
Intuitionistic type theory
- Martin-Löf
- 1984
(Show Context)
Citation Context ...programming [15,21] allows programmers to explain how a single algorithm can be instantiated for a variety of datatypes, by computation over each datatype’s structure. Dependent types Dependent types =-=[28,37]-=- are types containing data which enable the programmer to express properties of data concisely, covering the whole spectrum from conventional uses of types to types-as-specifications and programs-as-p... |

142 | Intensional polymorphism in type erasure semantics
- Crary, Weirich, et al.
- 2002
(Show Context)
Citation Context ...and Representation Types There is a very strong connection between the notion of universe in Type Theory and the more recent notion of representation type which has emerged from work on type analysis =-=[17]-=- to become a popular basis for generic programming in Haskell [23,22,40]. The two notions are both standard ways to give a data representation to a collection of things, in this case, types: – Martin-... |

93 |
The ALF proof editor and its proof engine
- Magnusson, Nordström
- 1994
(Show Context)
Citation Context ...on Type Theory whose emphasis has been on the representations of proofs like LEGO [26]. The design of the interactive program and proof development environment is heavily influenced by the ALF system =-=[27]-=-. Epigram uses a two-dimensional syntax to represent the types of operators in a natural deduction style. This is particularly useful for presenting programs with dependent types—however, we start wit... |

92 | The zipper
- Huet
- 1997
(Show Context)
Citation Context ... of containers in detail but restrict ourselves to using them to represent datatypes and generic operations in Epigram. As an example of a library of generic operations we consider the generic zipper =-=[24]-=- (section 6), which is a useful generic tool when implementing functional programs which use the notion of a position in a data structure. As observed by McBride [29], the zipper is closely related to... |

76 | Inductive sets and families in Martin-Löfs Type Theory and their set-theoretic semantics: An inversion principle for Martin-Löfs type theory
- Dybjer
- 1991
(Show Context)
Citation Context ...acci function, or lexicographically combined structural recursions, like the Ackermann function. Data-type families So far we haven’t used dependent types explicitly. Dependent types come in families =-=[20]-=-, indexed by data. A standard example is the family of vectors indexed by length: data n : Nat X : ⋆ Vec n X where vnil : Vec zero X a : A as : Vec n X vcons a as : Vec (sucn) X Here Vecn X is the typ... |

68 | Exploring Generic Haskell
- Löh
- 2004
(Show Context)
Citation Context ...o authors of the present notes presented a universe construction for the first order fragment of Haskell datatypes including nested datatypes in [9] which was motivated by the work on generic Haskell =-=[14,25]-=-. Structure of the paper We start our discourse with a quick introduction to dependently typed programming (section 2) using the language Epigram as a vehicle. Epigram is described in more detail else... |

63 | Containers: Constructing strictly positive types - Abbott, Altenkirch, et al. - 2005 |

52 | Generic programming within dependently typed programming
- Altenkirch, McBride
- 2003
(Show Context)
Citation Context ...ons for non-dependent and dependent types. The first two authors of the present notes presented a universe construction for the first order fragment of Haskell datatypes including nested datatypes in =-=[9]-=- which was motivated by the work on generic Haskell [14,25]. Structure of the paper We start our discourse with a quick introduction to dependently typed programming (section 2) using the language Epi... |

44 |
Epigram: Practical programming with dependent types
- McBride
- 2004
(Show Context)
Citation Context ...using the language Epigram as a vehicle. Epigram is described in more detail elsewhere, see [32] for a definition of the language with many applications, [11] for a short and more recent overview and =-=[31]-=- for an introductory tutorial. Epigram is not just a language but also an interactive program development system, which is, together with further documentation, available from the Epigram homepage [30... |

43 | Indexed induction-recursion
- Dybjer, Setzer
- 2006
(Show Context)
Citation Context ...a vehicle for generic programming, the authors of [16] actually introduced a universe containing codes for dependent types. The latter is based on the work by Dybjer and Setzer on Induction-Recursion =-=[18,19]-=- which can also be understood as universe constructions for non-dependent and dependent types. The first two authors of the present notes presented a universe construction for the first order fragment... |

42 | Universes for generic programs and proofs in dependent type theory
- Benke, Dybjer, et al.
- 2003
(Show Context)
Citation Context ...idea to use dependent types for generic programming isn’t new: starting with the pioneering work by Pfeifer and Rueß [36] who used the LEGO system as a vehicle for generic programming, the authors of =-=[16]-=- actually introduced a universe containing codes for dependent types. The latter is based on the work by Dybjer and Setzer on Induction-Recursion [18,19] which can also be understood as universe const... |

42 | A finite axiomatization of inductiverecursive definitions
- Dybjer, Setzer
- 1999
(Show Context)
Citation Context ...a vehicle for generic programming, the authors of [16] actually introduced a universe containing codes for dependent types. The latter is based on the work by Dybjer and Setzer on Induction-Recursion =-=[18,19]-=- which can also be understood as universe constructions for non-dependent and dependent types. The first two authors of the present notes presented a universe construction for the first order fragment... |

41 | scrap your boilerplate” reloaded
- Hinze, Löh, et al.
- 2006
(Show Context)
Citation Context ... the notion of universe in Type Theory and the more recent notion of representation type which has emerged from work on type analysis [17] to become a popular basis for generic programming in Haskell =-=[23,22,40]-=-. The two notions are both standard ways to give a data representation to a collection of things, in this case, types: – Martin-Löf’s universes (U,El) collect types as the image of a function El : U →... |

40 | Categories of containers
- Abbott, Altenkirch, et al.
- 2003
(Show Context)
Citation Context ...interpretation of unary containers as functors. Indeed, it turns out that all natural transformations between functors arising from containers can be given as container morphisms, see theorem 3.4. in =-=[2]-=-. Exercise 11. Give the representation of reverse as morphism between unary containers, i.e. let cRev : UMor cList cList Exercise 12. While the interpretation of morphisms is full, i.e. every natural ... |

36 |
Proof Development System: User’s Manual
- LEGO
- 1992
(Show Context)
Citation Context ...tional language and an interactive program development system. It is based on previous experiences with systems based on Type Theory whose emphasis has been on the representations of proofs like LEGO =-=[26]-=-. The design of the interactive program and proof development environment is heavily influenced by the ALF system [27]. Epigram uses a two-dimensional syntax to represent the types of operators in a n... |

36 | The derivative of a regular type is its type of one-hole contexts. Unpublished manuscript (2001
- McBride
- 2012
(Show Context)
Citation Context ...ns we consider the generic zipper [24] (section 6), which is a useful generic tool when implementing functional programs which use the notion of a position in a data structure. As observed by McBride =-=[29]-=-, the zipper is closely related to the notion of the derivative of a datatype, which has many structural similarities to derivatives in calculus. This topic has been explored from a more categorical p... |

32 | Generic Programs and Proofs
- Hinze
- 2000
(Show Context)
Citation Context ...ttingham In these lecture notes we give an overview of recent research on the relationship and interaction between two novel ideas in (functional) programming: Generic programming Generic programming =-=[15,21]-=- allows programmers to explain how a single algorithm can be instantiated for a variety of datatypes, by computation over each datatype’s structure. Dependent types Dependent types [28,37] are types c... |

18 | Scrap Your Boilerplate” revolutions
- Hinze, Löh
- 2006
(Show Context)
Citation Context ... the notion of universe in Type Theory and the more recent notion of representation type which has emerged from work on type analysis [17] to become a popular basis for generic programming in Haskell =-=[23,22,40]-=-. The two notions are both standard ways to give a data representation to a collection of things, in this case, types: – Martin-Löf’s universes (U,El) collect types as the image of a function El : U →... |

13 |
Why dependent types matter. Manuscript, available online
- Altenkirch, McBride, et al.
- 2005
(Show Context)
Citation Context ... to dependently typed programming (section 2) using the language Epigram as a vehicle. Epigram is described in more detail elsewhere, see [32] for a definition of the language with many applications, =-=[11]-=- for a short and more recent overview and [31] for an introductory tutorial. Epigram is not just a language but also an interactive program development system, which is, together with further document... |

12 | Constructing Polymorphic Programs with Quotient Types
- Abbott, Altenkirch, et al.
- 2004
(Show Context)
Citation Context ...34,8]. Another direction to pursue is to allow types where the positions are result of a quotient, like bags or multisets. We have already investigated this direction from a categorical point of view =-=[6]-=-; a typetheoretic approach requires a Type Theory which allows quotient types. Here our current work on Observational Type Theory [10] fits in very well. Apart from the more theoretical questions rega... |

8 |
Towards observational type theory. Manuscript, available online
- Altenkirch, McBride
- 2006
(Show Context)
Citation Context ...ample that there are exactly 4 functions of type Bool → Bool which would be necessary if we want to establish a case analysis principle for finite types. Our ongoing work on Observational Type Theory =-=[10]-=- will address this issue.susing the combinators defined in the previous section and observing that they compute the same element in Fin 256. 4 While extensionality is a desirable feature, it is not al... |

8 |
Generic programming—an introduction
- Backhouse, Jansson, et al.
- 1999
(Show Context)
Citation Context ...ttingham In these lecture notes we give an overview of recent research on the relationship and interaction between two novel ideas in (functional) programming: Generic programming Generic programming =-=[15,21]-=- allows programmers to explain how a single algorithm can be instantiated for a variety of datatypes, by computation over each datatype’s structure. Dependent types Dependent types [28,37] are types c... |

7 |
Conor McBride. Derivatives of Containers
- Abbott, Altenkirch, et al.
- 2003
(Show Context)
Citation Context ...s closely related to the notion of the derivative of a datatype, which has many structural similarities to derivatives in calculus. This topic has been explored from a more categorical perspective in =-=[5, 7]-=-; the presentation here is again based on [35]. We close with our conclusions and possible directions for further work (section 7). All the code contained with these notes is available to download fro... |

6 | Representing nested inductive types using Wtypes - Abbott, Altenkirch, et al. - 2004 |

6 |
Indexed containers. Manuscript, available online
- Altenkirch, Ghani, et al.
- 2006
(Show Context)
Citation Context ...inite types, the vectors or the family of elements of a universe itself. Recent work shows that it is possible to extend both the syntactic and the semantic approach to capture families of types, see =-=[34,8]-=-. Another direction to pursue is to allow types where the positions are result of a quotient, like bags or multisets. We have already investigated this direction from a categorical point of view [6]; ... |

6 |
Altenkirch and Tarmo Uustalu. Normalization by evaluation for lambda -2
- Thorsten
(Show Context)
Citation Context ...iverses for Generic Programming The previously introduced universe of finite types is extensional, any two functions which are extensionally equal are given the same code. E.g. using the example from =-=[13]-=- we can see that the functions λf : Bool → Bool ⇒ f and λf :Bool → Bool;x :Bool ⇒f (f (f x)) are extensionally equal by encoding them 3 We cannot show that two functions are equal if they are pointwis... |