Hostname: page-component-7b7567c8c-kwt9d Total loading time: 0 Render date: 2026-11-14T02:40:31.009Z Has data issue: false hasContentIssue false

No value restriction is needed for algebraic effects andhandlers*

Published online by Cambridge University Press:  24 January 2017

OHAD KAMMAR
Affiliation:
Computer Laboratory, University of Cambridge, England (e-mail: ohad.kammar@cl.cam.ac.uk)Department of Computer Science, University of Oxford, England (e-mail: ohad.kammar@cs.ox.ac.uk)
MATIJA PRETNAR
Affiliation:
Faculty of Mathematics and Physics, University of Ljubljana, Slovenia (e-mail: matija.pretnar@fmf.uni-lj.si)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

We present a straightforward, sound, Hindley–Milner polymorphic typesystem for algebraic effects and handlers in a call-by-value calculus, which, toour surprise, allows type variable generalisation of arbitrary computations, andnot just values. We first recall that the soundness of unrestrictedcall-by-value Hindley–Milner polymorphism is known to fail in thepresence of computational effects such as reference cells and continuations, andthat many programming examples can be recast to use effect handlers instead ofthese effects. After presenting the calculus and its soundness proof, formalisedin Twelf, we analyse the expressive power of effect handlers with respect tostate effects. We conjecture handlers alone cannot express reference cells, butshow they can simulate dynamically scoped state, establishing that dynamicbinding also does not need a value restriction.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2017 
Supplementary material: File

Kammar and Pretnar supplementary material

Kammar and Pretnar supplementary material 1

Download Kammar and Pretnar supplementary material(File)
File 38.5 KB
Submit a response

Discussions

No Discussions have been published for this article.