Tracing monadic computations and representing effects
Programming Languages
2012-02-15 v1
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.
Cite
@article{arxiv.1202.2922,
title = {Tracing monadic computations and representing effects},
author = {Maciej Piróg and Jeremy Gibbons},
journal= {arXiv preprint arXiv:1202.2922},
year = {2012}
}
Comments
In Proceedings MSFP 2012, arXiv:1202.2407