Bookmark

OpenURL

Abstract

We show that the call-by-name monad translation of simply typed lambda calculus extended with sum and product types extends to special and general inductive and coinductive types so that its crucial property of preserving typings and - and commuting reductions is maintained. Speci c similar-purpose translations such as CPS translations follow from the general monad translations by specialization for appropriate concrete monads.

Citations

...Specific similar-purpose translations such as CPS translations follow from the general monad translations by specialization for appropriate concrete monads. 1 Introduction Thanks to the work of Moggi =-=[14]-=-, monads have become a popular structuring device in programming language semantics, as many notions of computation have the structure of a monad together with additional operations.Monad translations...

...ult of instantiating the context f with term M.The notation M[P/f[z]] stands for the result of replacing in M every subterm f[N] with P [N/z] (cf.the structural substitutions of Parigot’s λµ-calculus =-=[15]-=-). Although this system involves elements of higher-order abstract syntax (as used in logical frameworks), this higher-orderness is quite shallow.It features310 Tarmo Uustalu Typing environment forma...

...of simply typed lambda calculus with sum and product types extends to natural number and stream types and further to general positive (co)inductive types, but also to (co)inductive types à la Mendler =-=[13, 12]-=-.The property of preserving typings and β- and commuting reductions is maintained in each case except for that of positive (co)inductive types in which case a special reformulation of the system is ne...

...guage of the extension of λ+,× with positive non-interleaving inductive and coinductive types (with iteration and coiteration as the primitively available (co)recursion schemes), λ+,×,µ,ν (cf., e.g., =-=[11, 9]-=-) is given by the grammar A, B, C ::= ...| µZ. A | νZ.A M,N,P ::= ...| inZ. A(M) | iter(N, u. P ) | coit(M,y.Q) | outZ. A(N) (λZ. A positive and with no free occurrence of Z under a µ or a ν) The typi...

...guage of the extension of λ+,× with positive non-interleaving inductive and coinductive types (with iteration and coiteration as the primitively available (co)recursion schemes), λ+,×,µ,ν (cf., e.g., =-=[11, 9]-=-) is given by the grammar A, B, C ::= ...| µZ. A | νZ.A M,N,P ::= ...| inZ. A(M) | iter(N, u. P ) | coit(M,y.Q) | outZ. A(N) (λZ. A positive and with no free occurrence of Z under a µ or a ν) The typi...

...er the language of types, so that if, e.g., a new connective or modality is added, these definitions would have to be revised adequately.An alternative approach, due to Nax Mendler [12, 13] (see also =-=[11, 9, 17]-=-), which is free of this shortcoming and therefore sometimes gives smoother solutions, is essentially based on the type isomorphisms A[C/Z] ∼ = ∃Z. (Z → C) × A, A[C/Z] ∼ = ∀Z. (C → Z) → A, which hold ...

...o languages combining inductive and coinductive types with impure features. One possible continuation would be to consider extensions to dependently typed and higher-order settings along the lines of =-=[2, 3]-=-.But a more important and interesting exercise will be to give a semantic (category-theoretic) foundation to the translations.This worked out, we intend to consider also tighter monad translations (su...

...o languages combining inductive and coinductive types with impure features. One possible continuation would be to consider extensions to dependently typed and higher-order settings along the lines of =-=[2, 3]-=-.But a more important and interesting exercise will be to give a semantic (category-theoretic) foundation to the translations.This worked out, we intend to consider also tighter monad translations (su...

...-wellfounded data structures.They are central in type-theoretic proof assistants, but also appear in experimental programming languages inspired from type theory and categorical logic such as Charity =-=[6]-=-. In this paper, our project is to investigate monad translatability of languages with inductive and coinductive types.The question has not been studied, but makes sense, as one may well conceive a la...

...antiation of a context variable, but no context-producing operators, in particular, no schematization of a term.The operators iter m and coit m are third-order.(Cf. the formulation of Parigot’s λµ in =-=[1]-=- where µ-variables are treated as context variables and the µ-operator is third-order.) Alternatively, context variables could have been replaced by ordinary function-type variables and context instan...