arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1202.2922cs.PL
收藏

跟踪一元计算并表示效果

Tracing monadic computations and representing effects

Maciej Piróg, Jeremy Gibbons

摘要:

在函数式编程中,monad应该封装计算,有效地产生最终结果,但保持自己的方式获得它。出于各种原因,我们有时想揭示计算的内部。为了实现这一点,在本文中,我们引入了monad Transformers,它增加了自动积累关于执行过程的观察结果的能力。我们发现,如果我们将结果跟踪视为计算的实际结果,我们可以在现有的monad中找到新的功能,特别是在处理非终止计算时。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑