Explicit Effect Subtyping

05/28/2020
by   Georgios Karachalias, et al.
0

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

READ FULL TEXT

page 9

page 35

page 36

page 37

page 38

page 40

page 41

page 42

research
05/31/2021

Elegant elaboration with function invocation

We present an elegant design of the core language in a dependently-typed...
research
10/14/2021

Parallel Algebraic Effect Handlers

Algebraic effects and handlers support composable and structured control...
research
04/19/2023

A Calculus for Scoped Effects Handlers

Algebraic effects handlers have become a standard approach for side-...
research
03/29/2022

On Reinforcement Learning, Effect Handlers, and the State Monad

We study the algebraic effects and handlers as a way to support decision...
research
05/27/2020

Local Algebraic Effect Theories

Algebraic effects are computational effects that can be described with a...
research
07/18/2023

Soundly Handling Linearity

We propose a novel approach to soundly combining linear types with effec...
research
03/15/2018

Tracing sharing in an imperative pure calculus

We introduce a type and effect system, for an imperative object calculus...

Please sign up or login with your details

Forgot password? Click here to reset