## Why dependent types matter (2005)

Venue: | In preparation, http://www.e-pig.org/downloads/ydtm.pdf |

Citations: | 10 - 2 self |

### BibTeX

@INPROCEEDINGS{Altenkirch05whydependent,

author = {Thorsten Altenkirch and Conor Mcbride and James Mckinna},

title = {Why dependent types matter},

booktitle = {In preparation, http://www.e-pig.org/downloads/ydtm.pdf},

year = {2005}

}

### Years of Citing Articles

### OpenURL

### Abstract

We exhibit the rationale behind the design of Epigram, a dependently typed programming language and interactive program development system, using refinements of a well known program—merge sort—as a running example. We discuss its relationship with other proposals to introduce aspects of dependent types into functional programming languages and sketch some topics for further work in this area. 1.

### Citations

1122 | Proof-Carrying Code - Necula - 1997 |

372 |
Principle type-schemes for functional programs
- Damas, Milner
- 1982
(Show Context)
Citation Context ... that it must inhabit ⋆, the type of types and internally completes the declaration X : ⋆ nilX : List X When presented with nil, Epigram uses the well known technology established by Damas and Milner =-=[DM82]-=- to figure out the value of this implicit parameter. We can also make an implicit parameter explicit by writing it as a subscript, eg., nilNat : List Nat. Epigram programs are tree-structured: each no... |

347 | Intuitionistic Type Theory - Martin-Löf - 1984 |

294 | Dependent types in practical programming
- Xi, Pfenning
- 1999
(Show Context)
Citation Context ... pattern matching for dependent types [Coq92] and it also pioneered the interactive style of type-driven program and proof development which inspired Epigram. Xi and Pfenning’s DML (for Dependent ML) =-=[XP99]-=- was an impressive experiment in exploiting dependent types for a real functional programming language. DML, like other Applied Type Systems [Xi04], separates the world of indexing expressions and pro... |

266 | Programming in MartinLöf’s Type Theory, an introduction - Nordstrom, Petersson, et al. - 1990 |

218 | Cayenne - a language with dependent types
- Augustsson
- 1998
(Show Context)
Citation Context ...rates the world of indexing expressions and programs, thereby keeping types unaffected from potentially badly behaved programs. In contrast to DML, Augustsson’s implementation of the Cayenne language =-=[Aug98]-=-, which also inspired the AGDA proof system [CC99], uses full dependency and doesn’t differentiate between static and dynamic types. 2 While the declaration of Nat provides a convenient interface to t... |

181 | Regular expression types for XML
- Hosoya, Vouillon, et al.
- 2005
(Show Context)
Citation Context ...grams which work for all the types named by a value u. Perhaps U is the type of regular expressions and T computes for each regular expression the type of its words, yielding regular expression types =-=[HVP00]-=-. Perhaps U represents a collection of datatypes with a decidable equality eq : ∀u : U ; x, y : T u ⇒ x = y ∨ x �= y Peter Morris has recently implemented exactly such a generic equality in Epigram fo... |

158 |
The view from the left
- McBride, McKinna
(Show Context)
Citation Context ... radical departure with Epigram, exploiting what we have learnt from proof development tools like LEGO and COQ. Epigram is a full dependently typed programming language defined by McBride and McKinna =-=[MM04]-=-, drawing on experience with the LEGO system. McBride has implemented a prototype which is available together with basic documentation [McB04, McB05] from the Epigram homepage. 1 The prototype impleme... |

146 | Views: A way for pattern matching to cohabit with data abstraction
- Wadler
- 1987
(Show Context)
Citation Context ...g pattern allows an abstract datatype to offer admissible notions of pattern matching which hide the actual data representation but are guaranteed to be faithful to it—we have Wadler’s views for free =-=[Wad87]-=-. We now need a practical theory of subtyping to deliver a suitable form of inheritance, and a convenient high-level syntax for working with records. Our elaboration mechanism naturally lends itself t... |

142 | Scrap your boilerplate: a practical design pattern for generic programming
- LÄMMEL, JONES, et al.
(Show Context)
Citation Context ...ts absence is beginning to cause pain. A recent experiment in ‘dynamically typed’ generic programming—the ‘Scrap Your Boilerplate’ library of traversal operators by Ralf Lämmel and Simon Peyton Jones =-=[LP03]-=-—is a case in point. The library relies on a ‘type safe cast’ operator, effectively comparing types at run time by comparing their encodings as data: cast :: (Typeable a, Typeable b) => a -> Maybe b c... |

124 | Unification under a mixed prefix
- Miller
- 1992
(Show Context)
Citation Context ...s arising from implicit quantification. The latter are resolved, where possible, by solving the unification constraints which arise during typechecking—we follow Dale Miller’s ‘mixed prefix’ approach =-=[Mil92]-=-. Epigram will not guess the type of your program, but it will infer the bits of your program which the type determines. The Damas-Milner approach to type inference [DM82] is alive and well and workin... |

109 |
Computation and reasoning: a type theory for computer science
- Luo
- 1994
(Show Context)
Citation Context ... parameter for any induction-like rule. The |scrutinee construct is just ‘cut’. The details of the process by which Epigram code is elaborated into the underlying type theory—a variation of Luo’s UTT =-=[Luo94]-=-—are given in [MM04]. Edwin Brady’s compiler for UTT, which erases extraneous information at run time, is presented in [Bra05]. The point is this: UTT is not our programming language—UTT is our langua... |

107 | Phantom types
- Cheney, Hinze
- 2003
(Show Context)
Citation Context ...suggested a more general approach [McB02b], exploiting that Haskell’s class system provides a static logic programming language. Having realized the power of indexed data structures, Cheney and Hinze =-=[CH03]-=- proposed to extend the type system to introduce a rich language of index expressions leading to generalized algebraic datatypes (GADTs), which are basically inductive families in a programming langua... |

96 | A syntactic approach to foundational proof-carrying code - Hamid, Shao, et al. - 2002 |

94 | The ALF proof editor and its proof engine - Magnusson, Nordström - 1994 |

91 | Proving properties of programs by structural induction
- Burstall
- 1969
(Show Context)
Citation Context ...rved [Tur95], defusing quick-sort exposes the binary search tree structure. The standard example of a non-structural program is actually tree-sort—Rod Burstall’s first example of a structural program =-=[Bur69]-=-! We play the same game with merge-sort in figure 2. The ‘divide’ phase deals out the input to each sort into two inputs for sub-sorts (roughly) half the size; the ‘conquer’ phase merges the two sorte... |

86 | An Extended Calculus of Constructions
- Luo
- 1990
(Show Context)
Citation Context .... Universe Polymorphism. What is the type of types, and how do we quantify over them safely and consistently? In [MM04], we follow the predicative fragment of Luo’s Extended Calculus of Constructions =-=[Luo90]-=-, installing a cumulative hierarchy of universes ⋆0, ⋆1, . . . each of which both inhabits and embeds in the next, so that ⋆i : ⋆i+1 holds and T : ⋆i implies T : ⋆i+1. As Harper and Pollack have shown... |

85 | Pattern matching with dependent types
- Coquand
- 1992
(Show Context)
Citation Context ...L [CAB + 86], LEGO [LP92] and the widely used COQ [Tea04]. Magnusson’s ALF system [MN94] was not only the first system to implement inductive families [Dyb91] and pattern matching for dependent types =-=[Coq92]-=- and it also pioneered the interactive style of type-driven program and proof development which inspired Epigram. Xi and Pfenning’s DML (for Dependent ML) [XP99] was an impressive experiment in exploi... |

83 |
Compiling pattern matching
- Augustsson
- 1985
(Show Context)
Citation Context ...include structural recursion, like rec x in order, general recursion and also case analysis. We suppress nonempty case analyses for the sake of brevity—they can be recovered by the standard algorithm =-=[Aug85]-=-. If, as in the merge function, we need to analyse the result of an intermediate computation, we bring it to the left with the |cdots construct (| is pronounced ‘with’). 3 Here, order decides the ≤ re... |

77 | Inductive sets and families in Martin-Löf’s Type Theory and their set-theoretic semantics: An inversion principle for Martin-Löf’s type theory
- Dybjer
- 1991
(Show Context)
Citation Context ...pired many type-based proof systems, such as NUPRL [CAB + 86], LEGO [LP92] and the widely used COQ [Tea04]. Magnusson’s ALF system [MN94] was not only the first system to implement inductive families =-=[Dyb91]-=- and pattern matching for dependent types [Coq92] and it also pioneered the interactive style of type-driven program and proof development which inspired Epigram. Xi and Pfenning’s DML (for Dependent ... |

75 | Implementing mathematics with the NuPrl development system - Constable, Allen, et al. - 1986 |

72 | Languages of the future
- Sheard
- 2004
(Show Context)
Citation Context ...Functional programmers have started to incorporate many aspects of dependent types into novel type systems using generalized algebraic data types and singleton types. Indeed, we share Sheard’s vision =-=[She04]-=- of closing the semantic gap between programs and their properties. While Sheard’s language Ωmega approaches this goal by an evolutionary step from current functional languages like Haskell, we are pr... |

71 | Dependently Typed Functional Programs and Their Proofs
- McBride
- 1999
(Show Context)
Citation Context ...the subgoals. Nothing is hidden—the proof state is recoverable from the source code simply by re-elaborating it in a single step. Our approach to metavariables basically follows McBride’s OLEG system =-=[McB99]-=-—metavariables represent not only the missing contents of sheds, but also all the unknowns arising from implicit quantification. The latter are resolved, where possible, by solving the unification con... |

58 | Type-indexed data types - Hinze, Jeuring, et al. |

57 | Strongly typed heterogeneous collections
- Kiselyov, Lämmel, et al.
- 2004
(Show Context)
Citation Context ...ts to dependent types which mainstream functional languages (especially Haskell) admit, by hook or by crook. From arrows and functional reactive programming [Hug05, Nil05], through extensible records =-=[KLS04]-=-, database programming [BH04] and dynamic web scripting [Thi02] to code generation [BS04], people are ‘faking it’ any way they can to great effect. Each little step along the road to dependent types m... |

52 | Generic programming within dependently typed programming - Altenkirch, McBride - 2003 |

51 |
Tool Support for Refactoring Functional Programs
- Li, Reinke, et al.
- 2003
(Show Context)
Citation Context ...he options which gave rise to the ‘open lower bound’ choice for sorted lists. More generally, we can seek to emulate existing tools for refactoring evolving the design of data structures and programs =-=[LRT03]-=-, now in the context of a system which supports incomplete objects. There is plenty of scope to develop tools which really reflect the way most programmers work, iteratively improving program attempts... |

50 | Extensional concepts in intensional type theory - Hofmann - 1995 |

50 | Wobbly types: type inference for generalised algebraic data types
- Jones, Washburn, et al.
- 2004
(Show Context)
Citation Context ... little step along the road to dependent types makes the task a little easier, the code a little neater and the next improvement a little closer: the arrival of GADTs in Haskell is a joy and a relief =-=[PWW04]-=-. 18 2005/4/14sNow is the time to recognize the direction of these developments and pursue it by design, not drift. In the long term, there is a great deal more chaos and confusion to be feared from f... |

46 | Epigram: Practical programming with dependent types - McBride - 2005 |

44 | Elementary strong functional programming
- Turner
- 1995
(Show Context)
Citation Context ...is intermediate data structure thus corresponds to the control structure built by the original recursion, which can be reconstructed by fusing the building with the collapse. As David Turner observed =-=[Tur95]-=-, defusing quick-sort exposes the binary search tree structure. The standard example of a non-structural program is actually tree-sort—Rod Burstall’s first example of a structural program [Bur69]! We ... |

42 | Universes for generic programs and proofs in dependent type theory - Benke, Dybjer, et al. - 2003 |

40 | An introduction to type theory
- Coquand
- 1991
(Show Context)
Citation Context ...s, thereby keeping types unaffected from potentially badly behaved programs. In contrast to DML, Augustsson’s implementation of the Cayenne language [Aug98], which also inspired the AGDA proof system =-=[CC99]-=-, uses full dependency and doesn’t differentiate between static and dynamic types. 2 While the declaration of Nat provides a convenient interface to the type of natural numbers, there is no need to im... |

39 | Inductive families need not store their indices
- Brady, McBride, et al.
- 2004
(Show Context)
Citation Context ...ng the right thing, if it means spending heap on this data structure of evidence and losing the tail-call optimisation into the bargain. Fortunately, our ≤ type has the property of being content-free =-=[BMM04]-=-: just as with = , for any given indices x and y, x ≤ y contains at most one value, so the evidence can be erased at run-time and the tail-call restored. Moreover, it is no accident that ≤ is content-... |

39 | Applied type system (extended abstract
- Xi
(Show Context)
Citation Context ...ed Epigram. Xi and Pfenning’s DML (for Dependent ML) [XP99] was an impressive experiment in exploiting dependent types for a real functional programming language. DML, like other Applied Type Systems =-=[Xi04]-=-, separates the world of indexing expressions and programs, thereby keeping types unaffected from potentially badly behaved programs. In contrast to DML, Augustsson’s implementation of the Cayenne lan... |

37 |
proof development system: user's manual
- LEGO
- 1992
(Show Context)
Citation Context ...ive logic and strongly typed functional programming. Type Theory and its impredicative extension, the Calculus of Constructions, inspired many type-based proof systems, such as NUPRL [CAB + 86], LEGO =-=[LP92]-=- and the widely used COQ [Tea04]. Magnusson’s ALF system [MN94] was not only the first system to implement inductive families [Dyb91] and pattern matching for dependent types [Coq92] and it also pione... |

37 | Elimination with a motive
- McBride
- 2000
(Show Context)
Citation Context ...e proof system. The basic constructs of the Epigram language give a ‘programming’ presentation to the basic tactics of the system. The ⇐ construct is just McBride’s ‘elimination with a motive’ tactic =-=[McB02a]-=- which synthesizes an appropriate ‘P’ parameter for any induction-like rule. The |scrutinee construct is just ‘cut’. The details of the process by which Epigram code is elaborated into the underlying ... |

32 | The Generic Haskell user’s guide - Clarke, Hinze, et al. - 2001 |

30 | Practical Implementation of a Dependently Typed Functional Programming Language
- Brady
- 2005
(Show Context)
Citation Context ...de is elaborated into the underlying type theory—a variation of Luo’s UTT [Luo94]—are given in [MM04]. Edwin Brady’s compiler for UTT, which erases extraneous information at run time, is presented in =-=[Bra05]-=-. The point is this: UTT is not our programming language—UTT is our language for describing how programming works. Epigram has no hard-wired construct for constructor case analysis or constructor-guar... |

29 | Faking It (Simulating Dependent Types in Haskell
- McBride
- 2002
(Show Context)
Citation Context ...ose. 3 2005/4/14sNested types provide a poor man’s approach to many indexed data structures such as square matrices or well scoped λ-terms, e.g. see [Hin01]. McBride suggested a more general approach =-=[McB02b]-=-, exploiting that Haskell’s class system provides a static logic programming language. Having realized the power of indexed data structures, Cheney and Hinze [CH03] proposed to extend the type system ... |

26 | Coercive subtyping in type theory
- Luo
- 1997
(Show Context)
Citation Context ...ation mechanism naturally lends itself to the approach of coercive subtyping, where subsumptions in source code elaborate to explicit coercion functions—typically projections—in the underlying theory =-=[Luo97]-=-. Universe Polymorphism. What is the type of types, and how do we quantify over them safely and consistently? In [MM04], we follow the predicative fragment of Luo’s Extended Calculus of Constructions ... |

25 | Type checking with universes
- Harper, Pollack
- 1991
(Show Context)
Citation Context ... installing a cumulative hierarchy of universes ⋆0, ⋆1, . . . each of which both inhabits and embeds in the next, so that ⋆i : ⋆i+1 holds and T : ⋆i implies T : ⋆i+1. As Harper and Pollack have shown =-=[HP91]-=-, the user need never write a universe level explicitly—the machine can maintain a graph of relative level constraints and protest if any construction induces a cycle. This much is certainly safe, and... |

24 | Manufacturing datatypes
- Hinze
- 2001
(Show Context)
Citation Context ... | notation. As a consequence its code is more verbose. 3 2005/4/14sNested types provide a poor man’s approach to many indexed data structures such as square matrices or well scoped λ-terms, e.g. see =-=[Hin01]-=-. McBride suggested a more general approach [McB02b], exploiting that Haskell’s class system provides a static logic programming language. Having realized the power of indexed data structures, Cheney ... |

20 | Extensional equality in intensional type theory - Altenkirch - 1999 |

15 |
Doaitse Swierstra. Typing dynamic typing
- Baars, S
- 2002
(Show Context)
Citation Context ...quation (like Nat = Nat → Nat) induces a run-time type error. When Q is total, the compiler can erase {Q}. Contrast this with the proposal to represent type equations in Haskell by isomorphisms, e.g. =-=[BS02]-=-, — even though good programmers always try to ensure that these functions turn out at run-time to be functorial liftings of id, there is no way to guarantee this to the compiler, so the isomorphisms ... |

15 | Z.: An implementation of LF with coercive subtyping and universes - Callaghan, Luo - 2001 |

14 | Dependently typed records for representing mathematical structure
- Pollack
- 2000
(Show Context)
Citation Context ...ions. Manifest record types, which specify the values of some of their fields, can be used to express sharing between records, and between the the inputs and outputs of record-transforming operations =-=[Pol00]-=-. Epigram’s first-class notion of programming pattern allows an abstract datatype to offer admissible notions of pattern matching which hide the actual data representation but are guaranteed to be fai... |

12 | Dynamic optimization for functional reactive programming using generalized algebraic data types - Nilsson - 2005 |

10 | Programming with arrows - Hughes - 2004 |

8 | Generic programming—an introduction - Backhouse, Jansson, et al. - 1999 |