Monadic computations built by interpreting, or ``handling,'' operations of a free monad, are a compelling formalism for modeling language semantics and defining the behaviors of effectful systems, especially in dependent type theories such as Coq’s. The resulting layered semantics offer the promise of modular reasoning principles based on the equational theory of the underlying monads. However, there are a number of obstacles to using such layered interpreters in practice. With more layers comes more boilerplate and glue code needed to define the monads and interpreters involved. That overhead is compounded by the need to define (and justify) the relational reasoning principles that characterize the equivalences at each layer.
This paper addresses these problems by significantly extending the capabilities of the Coq Interaction Trees (ITrees) library, which supports layered monadic interpreters. We characterize a rich class of interpretable monads''---obtained by applying monad transformers to ITrees ---and show how to generically lift interpreters through them. We also introduce a corresponding framework for relational reasoning about
equivalence of monads up to a relation $R$.'' This collection of typeclasses, instances, new reasoning principles, and tactics greatly generalizes the existing theory of the ITrees library, eliminating large amounts of unwieldy boilerplate code and dramatically simplifying proofs.
Wed 14 SepDisplayed time zone: Belgrade, Bratislava, Budapest, Ljubljana, Prague change
13:40 - 15:20 | Programming and Reasoning About EffectsICFP Papers and Events at Linhart Chair(s): William J. Bowman University of British Columbia | ||
13:40 20mTalk | Monadic Compiler CalculationFunctional Pearl ICFP Papers and Events DOI | ||
14:00 20mTalk | Formal Reasoning About Layered Monadic Interpreters ICFP Papers and Events Irene Yoon University of Pennsylvania, Yannick Zakowski Inria, Steve Zdancewic University of Pennsylvania DOI | ||
14:20 20mTalk | Program Adverbs and Tlön EmbeddingsDistinguished PaperVirtual ICFP Papers and Events DOI Pre-print | ||
14:40 20mTalk | Flexible presentations of graded monads ICFP Papers and Events Shin-ya Katsumata National Institute of Informatics, Dylan McDermott Reykjavik University, Tarmo Uustalu Reykjavik University, Nicolas Wu Imperial College London DOI | ||
15:00 20mTalk | Fusing Industry and Academia at GitHubExperience Report ICFP Papers and Events Patrick Thomson GitHub, Rob Rix GitHub, Inc., Tom Schrijvers KU Leuven, Nicolas Wu Imperial College London DOI |