什么是XNoMomoMorphorphismRestriction? [英] What is XNoMonomorphismRestriction?

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

问题描述

此页用法



$ ghci -XNoMonomorphismRestriction



启动haskell解释器。



XNoMonomorphismRestriction 开关是什么意思?

解决方案

它关闭 Monomorphism限制,限制值为没有使用函数表示法1定义为非多态类型。




1通过not using function notation我的意思是它们被定义为 foo = something 而不是 foo bar = something ,即定义不包含显式参数。


This page usages

$ ghci -XNoMonomorphismRestriction

to start the haskell interpreter.

What does XNoMonomorphismRestriction switch mean?

解决方案

It turns off the Monomorphism restriction, which restricts values which are not defined using "function notation"¹ to have a non-polymorphic type.


¹ By "not using function notation" I mean that they're defined as foo = something and not foo bar = something, i.e. the definition does not contain explicit arguments.

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

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