## Simply Easy! An Implementation of a Dependently Typed Lambda Calculus (2007)

Citations: | 2 - 0 self |

### BibTeX

@MISC{Löh07simplyeasy!,

author = {Andres Löh and et al.},

title = {Simply Easy! An Implementation of a Dependently Typed Lambda Calculus},

year = {2007}

}

### OpenURL

### Abstract

We present an implementation in Haskell of a dependently-typed lambda calculus that can be used as the core of a programming language. We show that a dependently-typed lambda calculus is no more difficult to implement than other typed lambda calculi. In fact, our implementation is almost as easy as an implementation of the simply typed lambda calculus, which we emphasize by discussing the modifications necessary to go from one to the other. We explain how to add data types and write simple programs in the core language, and discuss the steps necessary to build a full-fledged programming language on top of our simple core.

### Citations

760 |
Types and Programming Languages
- Pierce
- 2002
(Show Context)
Citation Context ...d type checking. Taking the simply-typed lambda calculus as starting point, we move on to a dependently typed lambda calculus (Section 3). Inspired by Pierce’s incremental development of type systems =-=[21]-=-, we highlight the changes, both in the specification and the implementation, necessary to shift to a dependently typed lambda calculus. Perhaps surprisingly, the modifications necessary are comparati... |

515 |
Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. An EATCS series
- Bertot, Castéran
- 2004
(Show Context)
Citation Context ...ubject. More recent books by Nordström et al. [19] and Thompson [22] are freely available online. There are several dependently typed programming languages and proof assistants readily available. Coq =-=[2]-=- is a mature, welldocumented proof assistant. While it is not primarily designed for dependently typed programming, learning Coq can help get a feel for type theory. Haskell programmers may feel more ... |

353 |
Intuitionistic Type Theory
- Martin-Löf
- 1984
(Show Context)
Citation Context ...iscussion There is a large amount of relevant literature regarding both implementing type systems and type theory. Pierce’s book [21] is an excellent place to start. Martin-Löf’s notes on type theory =-=[12]-=- are still highly relevant and form an excellent introduction to the subject. More recent books by Nordström et al. [19] and Thompson [22] are freely available online. There are several dependently ty... |

308 | Functional programming with bananas, lenses, envelopes and barbed wire
- Meijer, Paterson
- 1991
(Show Context)
Citation Context ...cc (plus k n) In our calculus so far, we can neither pattern match nor make recursive calls. How could we hope to define plus? In Haskell, we can define recursive functions on data types using a fold =-=[18]-=-. Rather than introduce pattern matching and recursion, and all the associated problems, we define functions over natural numbers using the corresponding fold. In a dependently type setting, however, ... |

273 |
Programming in Martin-Löf ’s Type Theory, an introduction
- Nordstrom, Petersson, et al.
- 1990
(Show Context)
Citation Context ...e’s book [21] is an excellent place to start. Martin-Löf’s notes on type theory [12] are still highly relevant and form an excellent introduction to the subject. More recent books by Nordström et al. =-=[19]-=- and Thompson [22] are freely available online. There are several dependently typed programming languages and proof assistants readily available. Coq [2] is a mature, welldocumented proof assistant. W... |

224 | Cayenne – a Language with Dependent Types
- Augustsson
- 1998
(Show Context)
Citation Context ...to encapsulate IO. It is clear that dependently typed programming languages must come to terms with partial functions. Finding the right solution, however, is still very much an open problem. Cayenne =-=[1]-=-, for instance, allowed programmers to freely define functions using general recursion. As a result, Cayenne’s type checker could loop. Similar problems arise when we allow Haskell’s case construct: t... |

163 |
The view from the left
- McBride, McKinna
(Show Context)
Citation Context ...al functions. As our examples illustrate, however, programming with eliminators does not scale. Epigram uses a clever choice of motive to make programming with eliminators a great deal more practical =-=[13, 17]-=-. By choosing the right motive, we can exploit type information when defining complicated functions. Eliminators may not appear to be terribly useful, but they form the foundations on which dependentl... |

102 | Type Theory and Functional Programming
- Thompson
- 1991
(Show Context)
Citation Context ...n excellent place to start. Martin-Löf’s notes on type theory [12] are still highly relevant and form an excellent introduction to the subject. More recent books by Nordström et al. [19] and Thompson =-=[22]-=- are freely available online. There are several dependently typed programming languages and proof assistants readily available. Coq [2] is a mature, welldocumented proof assistant. While it is not pri... |

73 | Dependently typed functional programs and their proofs
- McBride
- 1999
(Show Context)
Citation Context ...al functions. As our examples illustrate, however, programming with eliminators does not scale. Epigram uses a clever choice of motive to make programming with eliminators a great deal more practical =-=[13, 17]-=-. By choosing the right motive, we can exploit type information when defining complicated functions. Eliminators may not appear to be terribly useful, but they form the foundations on which dependentl... |

70 | An Analysis of Girard’s Paradox
- Coquand
- 1986
(Show Context)
Citation Context ...ind check for τ no longer refers to the well-formedness rules for types, but is an ordinary type check itself. The kind ∗ is itself of type ∗. Although there are theoretical objections to this choice =-=[6]-=-, we believe that for the purpose of this paper, the simplicity of our implementation outweighs any such objections. The rule for the dependent function space is somewhat similar to the well-formednes... |

51 |
Epigram: Practical programming with dependent types
- McBride
- 2005
(Show Context)
Citation Context ...paper sources, which can be downloaded via the λ� homepage [11]. More about suitable data types for dependently typed languages and writing dependently-typed programs can be found in another tutorial =-=[16]-=-. 5. Toward dependently-typed programming The calculus we have described is far from a real programming language. Although we can write, type check, and evaluate simple expressions there is still a lo... |

46 | An algorithm for type-checking dependent types
- Coquand
- 1996
(Show Context)
Citation Context ...he initial implementation is far from perfect, many of Epigram’s ideas are not yet implemented elsewhere. Other implementations of the type system we have presented here have been published elsewhere =-=[7, 8]-=-. These implementations are given in pseudocode and accompanied by a proof of correctness. The focus of our paper is somewhat different: we have chosen to describe a concrete implementation as a vehic... |

39 | Inductive families need not store their indices
- Brady, McBride, et al.
- 2004
(Show Context)
Citation Context ...checking and evaluation to compute the result of your program. Edwin Brady covers this, together with various optimizations only possible due to the presence of richer type information, in his thesis =-=[3, 4]-=-. 6. Discussion There is a large amount of relevant literature regarding both implementing type systems and type theory. Pierce’s book [21] is an excellent place to start. Martin-Löf’s notes on type t... |

38 | Elimination with a motive
- McBride
- 2002
(Show Context)
Citation Context ...ds us to the following type of natElim: natElim :: ∀m :: Nat → ∗. m Zero → (∀k :: Nat.m k → m (Succ k)) → ∀n :: Nat.m n The first argument of the eliminator is the sometimes referred to as the motive =-=[14]-=-; it explains the reason we want to eliminate natural numbers. The second argument corresponds to the base case, where n is Zero; the third argument corresponds to the inductive case where n is Succ k... |

30 | Practical Implementation of a Dependently Typed Functional Programming Language
- Brady
- 2005
(Show Context)
Citation Context ...checking and evaluation to compute the result of your program. Edwin Brady covers this, together with various optimizations only possible due to the presence of richer type information, in his thesis =-=[3, 4]-=-. 6. Discussion There is a large amount of relevant literature regarding both implementing type systems and type theory. Pierce’s book [21] is an excellent place to start. Martin-Löf’s notes on type t... |

30 | General recursion via coinductive types
- Capretta
- 2005
(Show Context)
Citation Context ...l recursion, encapsulated in a suitable monad. Just as the IO monad encapsulates impure functions in Haskell, monads can 11 2007/6/18also be used to introduce partial functions into a total language =-=[5]-=-. Finding the right way to tackle partiality, without sacrificing theoretical properties of the type system, requires both more research and practical experience. Real world programming Although we ha... |

30 | Faking it – simulating dependent types in haskell
- McBride
(Show Context)
Citation Context ...row for the non-dependent case. The identity on vectors then has the following, equivalent, type: ∀α :: ∗.∀n :: Nat.Vec α n → Vec α n In Haskell, one can sometimes ‘fake’ the dependent function space =-=[15]-=-, for instance by defining natural numbers on the type level (i.e., by defining data types Zero and Succ). Since the type level numbers are different from the value level natural numbers, one then end... |

2 |
and Makoto Takeyama. An implementation of Type: Type
- Coquand
- 2000
(Show Context)
Citation Context ...he initial implementation is far from perfect, many of Epigram’s ideas are not yet implemented elsewhere. Other implementations of the type system we have presented here have been published elsewhere =-=[7, 8]-=-. These implementations are given in pseudocode and accompanied by a proof of correctness. The focus of our paper is somewhat different: we have chosen to describe a concrete implementation as a vehic... |