Tracing monadic computations and representing effects
Maciej Pir\'og (Department of Computer Science, University of Oxford),, Jeremy Gibbons (Department of Computer Science, University of Oxford)

TL;DR
This paper introduces monad transformers that enable automatic tracing of computations, revealing internal effects and observations, which enhances the functionality of monads, especially for non-terminating processes.
Contribution
It presents a novel approach to expose internal computation details by treating traces as results, expanding monad capabilities in functional programming.
Findings
Trace as result allows new functionalities in monads
Enhanced handling of non-terminating computations
Automatic accumulation of execution observations
Abstract
In functional programming, monads are supposed to encapsulate computations, effectfully producing the final result, but keeping to themselves the means of acquiring it. For various reasons, we sometimes want to reveal the internals of a computation. To make that possible, in this paper we introduce monad transformers that add the ability to automatically accumulate observations about the course of execution as an effect. We discover that if we treat the resulting trace as the actual result of the computation, we can find new functionality in existing monads, notably when working with non-terminating computations.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
