限制单子的现状是什么? [英] What's the current status of restricted monads?

查看:122
本文介绍了限制单子的现状是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

回顾至少在20世纪90年代后期,有人希望整合受限单子以友好的方式加入到Haskell中。

例如,如果没有受限制的单子,你不能从 Set Map 概率分布。这是几年前的一个SO 问题,其他人发生了冲突这个问题。



人们提出了各种解决方法,包括:



然而,方法似乎是规范的。我在Don Stewart的评论中发现了这篇博文<在2007年,他表示我们与限制monads的相当接近索引类型



目前状态如何?现在是否有一种规范的方式来限制单子?或者我们仍然与解决方法生活在一起?

解决方案

最近Anders Persson,Emil Axelsson和Josef Svenningson发表了一篇论文,编码限制单子的方法。我已经忘记了细节,但我记得这是一篇很好的论文。


Persson,A.; Axelsson,E.; Svenningsson,J。(2011)。 嵌入式语言的通用单点构造 。 IFL 2011,第23届功能语言实施与应用研讨会。


Going back to at least the late 1990s there have been people wishing for the integration of restricted monads into Haskell in a friendly way.

For example, without restricted monads you can't make an efficient monad out of Set, Map or probability distributions. Here's a SO question from a few years ago where someone else ran afoul of this problem.

There are various workarounds that people have come up with, including:

None of these approaches seem to be "canonical" however. I found a comment from Don Stewart on this blog post, in 2007, where he intimated that we were "quite close" to having restricted monads with Indexed types.

What is the current status? Is there now a 'canonical' way to do restricted monads? Or we are still living with workarounds?

解决方案

There's a recent paper by Anders Persson, Emil Axelsson, and Josef Svenningson that shows a way to encode restricted monads. I've forgotten the details, but I remember it was a nice paper.

Persson, A. ; Axelsson, E. ; Svenningsson, J. (2011). Generic monadic constructs for embedded languages. IFL 2011, the 23rd Symposium on Implementation and Application of Functional Languages.

这篇关于限制单子的现状是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆