π€ AI Summary
This work addresses the conflation of recoverable and non-recoverable effect operations in conventional program calculi, where a uniform `do` construct leads to vacuous resumption bindings. To resolve this, the paper introduces the because-calculus, which structurally separates effect registration (non-recoverable) from effect proof (recoverable) via a refined type system. Key innovations include dual effect rows and level-indexed types that statically eliminate invalid resumption clauses at compile time, and a novel Resumption Subconstraint that, for the first time, statically rules out vacuous resumptions. The authors establish a non-faithful collapse theorem mapping the calculus into a handler-based framework and formally prove progress, subject reduction, and tower progress properties. A categorical semantics further provides rigorous mathematical interpretations for all typing judgments.
π Abstract
Handler calculus conflates resumable and non-resumable effect operations through a single do construct, distinguished only by result type annotation. This conflation does not compromise type safety -- progress and preservation hold -- but it permits resumption bindings for non-resumable operations, creating vacuous bindings that the because-calculus eliminates at compile-time. The because-calculus structurally separates registration (non-resumable, void-returning) from attestation (resumable, non-void-returning) using dual effect rows and level-indexed typing, rejecting such clauses at compile-time via the Resumption Subconstraint. We prove the Conflation Theorem: collapsing the adjoint triple of existential, substitution, and universal functors into a single effect operation is non-faithful -- the erasure from the because-calculus to handler calculus maps rejected clauses to accepted ones. Four movements correspond to four natural transformations; categorical semantics maps each judgment to a category-theoretic construct. We establish progress, subject reduction, and tower progress for the full calculus.