gpt4 book ai didi

functional-programming - "Monad transformers more powerful than effects"- 示例?

转载 作者:行者123 更新时间:2023-12-03 05:17:25 30 4
gpt4 key购买 nike

论文"Programming and reasoning with algebraic effects and dependent types" by Edwin C. Brady关于 Idris 中的效果包含(未引用)声明:

Although [effects and monad transformers] are not equivalent in power — monads and monad transformers can express more concepts — many common effectful computations are captured.

有哪些示例可以通过 monad 转换器建模,但不能通过效果建模?

最佳答案

延续可以使用 CPS 建模为单子(monad),但它们不是代数效应,因为它们不能使用 Lawvere 理论建模。参见 Martin Hyland 和 John Power,2007,The Category Theoretic Understanding of Universal Algebra: Lawvere Theories and Monads (pdf) ,ENTCS 172:437-458。

关于functional-programming - "Monad transformers more powerful than effects"- 示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31335805/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com