使Haskell的类型系统更“强大”比其他语言的类型系统? [英] What makes Haskell's type system more "powerful" than other languages' type systems?

查看:330
本文介绍了使Haskell的类型系统更“强大”比其他语言的类型系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读 Scala类型系统与Haskell的缺点? > ,我必须问:具体来说,它是什么使Haskell的类型系统比其他语言的类型系统(C,C ++,Java)更强大。显然,即使Scala也不能像Haskell的类型系统那样执行一些相同的功能。具体来说,这是什么使Haskell的类型系统(Hindley-Milner类型推断)如此强大?你可以举个例子吗?

解决方案


具体来说,Haskell的类型系统


在过去的十年里,它的设计灵活 - 作为属性验证的逻辑 - 功能强大。 >

Haskell的类型系统多年来一直在开发,以鼓励一个相对灵活,富有表现力的静态检查规则,并且有几组研究人员确定了类型系统技术,这些技术可以实现强大的新类编译时验证。 Haskell / GHC提供了一个功能强大的逻辑,旨在鼓励类型级编程。一些在函数式编程世界中相当独特的东西。



一些论文指出了Haskell类型系统工程方面的努力方向:




Reading Disadvantages of Scala type system versus Haskell?, I have to ask: what is it, specifically, that makes Haskell's type system more powerful than other languages' type systems (C, C++, Java). Apparently, even Scala can't perform some of the same powers as Haskell's type system. What is it, specifically, that makes Haskell's type system (Hindley–Milner type inference) so powerful? Can you give an example?

解决方案

What is it, specifically, that makes Haskell's type system

It has been engineered for the past decade to be both flexible -- as a logic for property verification -- and powerful.

Haskell's type system has been developed over the years to encourage a relatively flexible, expressive static checking discipline, with several groups of researchers identifying type system techniques that enable powerful new classes of compile-time verification. Scala's is relatively undeveloped in that area.

That is, Haskell/GHC provides a logic that is both powerful and designed to encourage type level programming. Something fairly unique in the world of functional programming.

Some papers that give a flavor of the direction the engineering effort on Haskell's type system has taken:

这篇关于使Haskell的类型系统更“强大”比其他语言的类型系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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