## A System F with call-by-name exceptions

Citations: | 2 - 0 self |

### BibTeX

@MISC{Lebresne_asystem,

author = {Sylvain Lebresne},

title = {A System F with call-by-name exceptions},

year = {}

}

### OpenURL

### Abstract

Abstract. We present an extension of System F with call-by-name exceptions. The type system is enriched with two syntactic constructs: a union type A ⋆ ∪ {ε} for programs of type A whose execution may raise the exception ε at top level, and a corruption type A {ε} for programs that may raise the exception ε in any evaluation context (not necessarily at top level). We present the syntax and reduction rules of the system, as well as its typing and subtyping rules. We then study its properties, such as confluence. Finally, we construct a realizability model using orthogonality techniques, from which we deduce that well-typed programs are weakly normalizing and that the ones who have the type of natural numbers really compute a natural number, without raising exceptions. 1

### Citations

733 | Notions of Computation and Monads
- Moggi
- 1991
(Show Context)
Citation Context ... tagged as correct values or exceptional values (this idea is nicely explained, for the Haskell programming language, in [9]). It has later been realized that the Maybe type constructor forms a monad =-=[7, 14]-=-. And P. Wadler and P. Thiemann proposed in [15] to add effects to monads, allowing for the detection of uncaught exceptions in such monadic encoding. However, this approach has some drawbacks: – Term... |

458 | Comprehending Monads
- Wadler
- 1990
(Show Context)
Citation Context ... tagged as correct values or exceptional values (this idea is nicely explained, for the Haskell programming language, in [9]). It has later been realized that the Maybe type constructor forms a monad =-=[7, 14]-=-. And P. Wadler and P. Thiemann proposed in [15] to add effects to monads, allowing for the detection of uncaught exceptions in such monadic encoding. However, this approach has some drawbacks: – Term... |

183 | The Lambda Calculus
- Barendregt
- 1984
(Show Context)
Citation Context ...en there exists a term P such that N ≻ ∗ P and N ′ ≻ ∗ P. Proof. We straightforwardly adapt the proof originated by Tait and Martin-Löf for the confluence of pure lambda-calculus that can be found in =-=[1]-=- for example. We define the notion of parallel reduction ≫, show that it satisfies the diamond property and conclude since ≻ ∗ = ≫ ∗ . We give in appendix A the definition of the parallel reduction fo... |

102 |
Polymorphic type inference and containment
- Mitchell
- 1988
(Show Context)
Citation Context ...the definition of the parallel reduction for Fx. 3.2 The type system As stressed in Section 2.3, Fx uses a subtyping relation ≤. Thus, Fx is in fact an extension of System Fη (System F with subtyping =-=[6, 16]-=-). Besides, we can use more than one exception so that type constructions handle sets of exceptions names. The syntax of types for Fx is built upon the one of System F: A, B ::= α | N | A → B | ∀α. A ... |

92 | The Marriage of Effects and Monads
- Wadler
- 1998
(Show Context)
Citation Context ...is idea is nicely explained, for the Haskell programming language, in [9]). It has later been realized that the Maybe type constructor forms a monad [7, 14]. And P. Wadler and P. Thiemann proposed in =-=[15]-=- to add effects to monads, allowing for the detection of uncaught exceptions in such monadic encoding. However, this approach has some drawbacks: – Terms using exceptions are crippled by extra clutter... |

61 | X.: Type-based analysis of uncaught exceptions
- Pessaux, Leroy
(Show Context)
Citation Context ...or the OCaml languages, J.C. Guzmán and A. Suárez [5] have proposed an extension of the type system where arrows are annotated by which exceptions a function can raise. Later, X. Leroy and F. Pessaux =-=[8]-=- proposed a similar system but add polymorphism over these annotations. Their solution is efficient and covers all the Ocaml language, including modularity. However, all these works consider exception... |

60 |
Locus solum: From the rules of logic to the logic of rules
- Girard
(Show Context)
Citation Context ...function, we instantiate the type of the recursion operator by the type (N → N ⋆∪ ∆) ⋆∪ ∆. 5 Realizability model 5.1 Daimon, weak head reduction and contexts We add a daimon, �, similar to the one of =-=[4]-=-. It has no typing rules and computationally behaves like an uncatchable exception. A (closed) term is in weak head normal form, if it is in one of the following forms (where V is a value): whnf ::= V... |

58 | Typability and Type Checking in System F are Equivalent and Undecidable
- Wells
- 1999
(Show Context)
Citation Context ...he dependent product: if T is a type and Ux a type family indexed by x, we will take | Πx : T. U |ρ = � { M · C | M ∈ � T ∆ �ρ ∧ C ∈ | U ∆ M |ρ } ∆ ⊆ E – Type inference in Fx is obviously undecidable =-=[17]-=-. However, type inference for the restriction of Fx to first-order types remains to be studied, and we have good hopes that it is decidable, since we know that in such a restriction, the subtyping rel... |

52 | A semantics for imprecise exceptions
- Jones, Reid, et al.
- 1999
(Show Context)
Citation Context ... exceptions to lazy languages is more difficult since an expression is evaluated only when needed and thus, programs do not have a readily-predictable control flow. As noted by S. Peyton Jones et al. =-=[9]-=-, “(. . . ) the only productive way to think about an expression is to consider the value it computes, not the way in which the value is computed”. That is why they proposed the idea of exceptions-as-... |

41 | A functional theory of exceptions - Spivey - 1990 |

26 |
How to replace failure by a list of successes; a method for exception handling, backtracking, and pattern matching in lazy functional languages
- Wadler
- 1985
(Show Context)
Citation Context ...s-values? There are essentially two designs for exceptions as values: either we encode explicitly exceptions in the language, or we make them primitives. Encoding explicitly exceptions is an old idea =-=[13, 10]-=-: to each type A is associated a type Maybe A which is either values of A tagged as correct values or exceptional values (this idea is nicely explained, for the Haskell programming language, in [9]). ... |

23 | Semantic types: A fresh look at the ideal model for types
- Vouillon, Melliès
(Show Context)
Citation Context ....3 A model for Fx S ⊥ = { M | ∀ C ∈ S, C[M] ≻ ∗ � } ↓∆ S = S ◦ { try [ ] with ∆ ↦→ � } ↑∆ S = { try [ ] with ∆ ↦→ � } ◦ S We define a realizability model for Fx using techniques of orthogonality (see =-=[12]-=- for examples of use of such techniques). We call valuation function any function ρ from type variables to the powerset of C minus the empty set (ρ : A → (P(C)) + ). To each type A we associate two se... |

17 | 2002, ‘Comparing Control Constructs by Double-barrelled CPS
- Thielecke
(Show Context)
Citation Context ... exceptions are often considered as control operators. Note however that exceptions have a dynamic semantic, and as such, cannot be compared to static control operators like first-class continuations =-=[11]-=-. In particular, the typing of exceptions does not necessarily lift the logic to a classical one. Besides, in this paper, we address the problem of the static detection of uncaughtsexceptions. We do n... |

16 | An Extended Type System for Exceptions
- Guzmán, Suárez
- 1994
(Show Context)
Citation Context ...producing errors. 6 Related Works Many works about the static detection of uncaught exceptions have been done, based on typing or not. For instance, for the OCaml languages, J.C. Guzmán and A. Suárez =-=[5]-=- have proposed an extension of the type system where arrows are annotated by which exceptions a function can raise. Later, X. Leroy and F. Pessaux [8] proposed a similar system but add polymorphism ov... |

13 |
The undecidability of Mitchell’s subtyping relation
- Wells
- 1995
(Show Context)
Citation Context ...the definition of the parallel reduction for Fx. 3.2 The type system As stressed in Section 2.3, Fx uses a subtyping relation ≤. Thus, Fx is in fact an extension of System Fη (System F with subtyping =-=[6, 16]-=-). Besides, we can use more than one exception so that type constructions handle sets of exceptions names. The syntax of types for Fx is built upon the one of System F: A, B ::= α | N | A → B | ∀α. A ... |

2 | An intuitionistic λ-calculus with exceptions
- David, Mounier
(Show Context)
Citation Context ...xceptions. We do not know of previous works on control operators dealing with this particular problem. Exceptions in type theoretical settings have been less studied. However, R. David and G. Mounier =-=[2]-=- have designed a typed mechanism of exceptions for the language AF2. But their exceptions are restricted in the sense that only data types can carry exceptions and for example, exceptions cannot be us... |