## Monad Translating Inductive and Coinductive Types (2003)

Venue: | In Proc. Partial Evaluation and Semantics-Based Program Manipulation |

Citations: | 6 - 0 self |

### BibTeX

@INPROCEEDINGS{Uustalu03monadtranslating,

author = {Tarmo Uustalu},

title = {Monad Translating Inductive and Coinductive Types},

booktitle = {In Proc. Partial Evaluation and Semantics-Based Program Manipulation},

year = {2003},

pages = {131--142},

publisher = {Springer}

}

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

762 | Notions of Computation and Monads
- Moggi
- 1991
(Show Context)
Citation Context ...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... |

466 | Combining Monads
- King, Wadler
- 1993
(Show Context)
Citation Context ... another ✸-elimination can immediately follow a ✸-elimination): . A ✸A ✸I ✸C A .... ✸C ✸E ✄ . A .... ✸C A .... . ✸A ✸C ✸E ✸C ✸D C .... ✸D ✸E ✄ A .... C .... . ✸C ✸D ✸E ✸A ✸D ✸E ✸D The translation, cf.=-=[14, 18]-=-, is given in figure Fig.3.The main translation function for types prefixes every type in a type by ✸.In the term translation, a term’s constructor subterms are prefixed by val while each destructor s... |

337 |
An algorithmic interpretation of classical natural deduction
- Parigot
- 1992
(Show Context)
Citation Context ...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... |

220 | Call-by-name, call-by-value, and the *-calculus - Plotkin - 1975 |

210 |
Call-by-name, call-by-value and the λ-calculus
- Plotkin
- 1976
(Show Context)
Citation Context ...r optimization move take the monad translations of λ+,×, λ+,×,µ,ν and λ m +,×,µ,ν from Figs.3, 9, 11 to translations presented in Figs.12, 13, 14, which are call-by-name CPS translations à la Plotkin =-=[16]-=- in Translation of types: cpst�A� = ¬¬cps�A� cps�X� = X cps�A → B� = cpst�A� → cpst�B� cps�A1 + A2� = cpst�A1� + cpst�A2� cps�0� =0 cps�A1 × A2� = cpst�A1� × cpst�A2� cps�1� =1 Translation of terms: c... |

100 |
Recursive types and type constraints in second-order lambda calculus
- Mendler
- 1987
(Show Context)
Citation Context ...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... |

87 | A generic account of continuationpassing styles
- Hatcliff, Danvy
- 1994
(Show Context)
Citation Context ...Fig. 11. Monad translation of λ m +,×,µ,ν 6 Example Specialization: CPS Translations Specific translations are obtainable from monad translations by specializing for an appropriate specific monad, cf.=-=[10]-=-.Some standard examples of monads relevant for programming language semantics are the following: – The continuations monad: ✸A = ¬¬A val(M) =λk. k M bind(N, u. P )=λk. N (λu. (P k)) (¬A = A →⊥where ⊥ ... |

61 | Propositional lax logic
- Fairtlough, Mendler
- 1997
(Show Context)
Citation Context ...η-reduction rule, not included here, is bind(N,u.val(u))✄N).The Curry-Howard counterpart of λ✸ is a meaningful system of intuitionistic modal logic known variously as computational logic or lax logic =-=[5, 8]-=- and first conceived already by Curry [7].InMonad Translating Inductive and Coinductive Types 301 Typing environment formation rules: ⋄ env Γ env Γ, x : C env Typing rules: Γ ⊢ x : C if (x : C) inΓ Γ... |

56 | Computational types from a logical perspective
- Benton, Bierman, et al.
- 1998
(Show Context)
Citation Context ...η-reduction rule, not included here, is bind(N,u.val(u))✄N).The Curry-Howard counterpart of λ✸ is a meaningful system of intuitionistic modal logic known variously as computational logic or lax logic =-=[5, 8]-=- and first conceived already by Curry [7].InMonad Translating Inductive and Coinductive Types 301 Typing environment formation rules: ⋄ env Γ env Γ, x : C env Typing rules: Γ ⊢ x : C if (x : C) inΓ Γ... |

52 | Inductive and coinductive types with iteration and recursion
- Geuvers
- 1992
(Show Context)
Citation Context ...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... |

36 |
Contracting proofs to programs
- Leivant
- 1990
(Show Context)
Citation Context ...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... |

20 |
The elimination theorem when modality is present
- Curry
- 1952
(Show Context)
Citation Context ...(N,u.val(u))✄N).The Curry-Howard counterpart of λ✸ is a meaningful system of intuitionistic modal logic known variously as computational logic or lax logic [5, 8] and first conceived already by Curry =-=[7]-=-.InMonad Translating Inductive and Coinductive Types 301 Typing environment formation rules: ⋄ env Γ env Γ, x : C env Typing rules: Γ ⊢ x : C if (x : C) inΓ Γ, x : A ⊢ M : B Γ ⊢ λx. M : A → B Γ ⊢ N :... |

14 |
Type fixpoints: Iteration vs. recursion
- Splawski, Urzyczyn
- 1999
(Show Context)
Citation Context ...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 ... |

10 | CPS translations and applications: The cube and beyond
- BARTHE, HATCLIFF, et al.
- 1999
(Show Context)
Citation Context ...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... |

8 | P.: Monadic type systems: Pure type systems for impure settings (preliminary report
- Barthe, Hatcliff, et al.
- 1997
(Show Context)
Citation Context ...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... |

8 |
About Charity, Yellow Series Report 92/480/18
- Cockett, Fukushima
- 1992
(Show Context)
Citation Context ...-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... |

7 | A third-order representation of the λµ-Calculus
- Abel
- 2001
(Show Context)
Citation Context ...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... |

5 | Type Iteration vs. recursion - lawski, Z, et al. - 1999 |

3 | A third-order representation of the -calculus - Abel - 2001 |

2 | T.: CPS translating inductive and coinductive types (extended abstract
- Barthe, Uustalu
- 2002
(Show Context)
Citation Context ...uvers and F. Wiedijk (Eds.): TYPES 2002, LNCS 2646, pp. 299–315, 2003. c○ Springer-Verlag Berlin Heidelberg 2003300 Tarmo Uustalu The project grew out of earlier work of Gilles Barthe and the author =-=[4]-=- on CPS translatability of inductive and coinductive types.The call-by-name CPS translations proposed in that paper follow from the translations developed here as specializations. The organization of ... |