Explicit Effect Subtyping

Georgios Karachalias, Matija Pretnar, Amr Hany Saleh, Stien Vanderhallen, Tom Schrijvers
5/28/2020
cs.PL

Official code: matijapretnar/proofs (19 stars, AMPL, last commit 2020-02-04).

Abstract

As popularity of algebraic effects and handlers increases, so does a demand for their efficient execution. Eff, an ML-like language with native support for handlers, has a subtyping-based effect system on which an effect-aware optimizing compiler could be built.

Show full abstract

Unfortunately, in our experience, implementing optimizations for Eff is overly error-prone because its core language is implicitly-typed, making code transformations very fragile. To remedy this, we present an explicitly-typed polymorphic core calculus for algebraic effect handlers with a subtyping-based type-and-effect system. It reifies appeals to subtyping in explicit casts with coercions that witness the subtyping proof, quickly exposing typing bugs in program transformations. Our typing-directed elaboration comes with a constraint-based inference algorithm that turns an implicitly-typed Eff-like language into our calculus. Moreover, all coercions and effect information can be erased in a straightforward way, demonstrating that coercions have no computational content. Additionally, we present a monadic translation from our calculus into a pure language without algebraic effects or handlers, using the effect information to introduce monadic constructs only where necessary.

View on arXivView PDF

Code Implementations(1)

A collection of mechanised proofs

190AMPL, Standard MLNov 28, 20136 years ago

Similar Papers

Cite this paper

@article{karachalias2020explicit,
  title  = {Explicit Effect Subtyping},
  author = {Georgios Karachalias and Matija Pretnar and Amr Hany Saleh and Stien Vanderhallen and Tom Schrijvers},
  year   = {2020},
  eprint = {2005.13814},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2005.13814}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2005.13814.svg)](https://codeofpaper.com/paper/2005.13814)

Discussion