## 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

704 |
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... |

470 |
P.: Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions
- 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 ... |

342 |
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... |

298 | Functional programming with bananas, lenses, envelopes and barbed wire
- Meijer, Fokkinga, et al.
- 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, ... |

261 |
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... |

216 | 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... |

153 |
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... |

97 | 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... |

70 | 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... |

67 | 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... |

44 | An algorithm for type-checking dependent types
- Coquand
- 1995
(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... |

44 |
Epigram: practical programming with dependent types, in
- 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... |

37 | 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... |

37 | Elimination with a motive
- McBride
- 2000
(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... |

29 | General Recursion via Coinductive Types
- Capretta
(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... |

28 | 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... |

27 | Faking It (Simulating Dependent Types in Haskell
- McBride
- 2002
(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... |