Damas-Hindley-Milner 类型推理算法实现

发布于 2024-09-17 08:24:07 字数 390 浏览 1 评论 0原文

我正在寻找有关著名的 Damas-Hindley-Milner 算法 为函数式语言进行类型推断,尤其是有关实现的信息。

我已经知道如何执行算法W,但我听说关于基于约束生成器/求解器而不是通常的统一的最新新算法。然而,我无法找到任何关于这些新算法的实现的讨论。

知道在哪里可以找到有关 ML 推理的部分信息吗?

I'm looking for information about the well-known Damas-Hindley-Milner algorithm
to do type inference for functional languages, especially information about implementation.

I already know how to do the Algorithm W, but I heard about recent new algorithms based on constraint generator/solver rather than usual unification. However, I can't manage to find any discussions about the implementation of those new algorithm.

Any idea where I could find some partial information on ML inference ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

脸赞 2024-09-24 08:24:07

如果您对 ML 代码感到满意,那么找到这些内容的最佳方法就是简单地研究一下实际的实现。一个很好的参考实现是 HaMLet,它更多地被设计为一个测试平台,而不是比生产实施。

最近几乎所有对这些问题的严肃讨论都将在学术场所进行。可能感兴趣的一篇论文是 概括 Hindley-Milner 类型推理算法

此外,Pierce 的《类型和编程语言<中各种类型系统(包括 let 多态性)的实现/a>”,以及 Appel 的“ML 中的现代编译器实现 “比算法 W 的普通描述更接近实现这一点的现代方法。

If you're comfortable with ML code, the best way to find these things is to simply look into the implementations in the wild. A good reference implementation is HaMLet, which is designed as more of a test platform rather than a production implementation.

Almost all serious recent discussion of these issues is going to be in scholarly venues. One paper that might be of interest is Generalising Hindley-Milner type inference algorithms.

Also, the implementations of various type systems (including let polymorphism) in Pierce's "Types and Programming Languages", as well as Appel's "Modern Compiler Implementation in ML" more closely match modern approaches to implementing this than the vanilla description of algorithm W.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文