What is XNoMonomorphismRestriction?

2020-08-09 10:50发布

This page usages

$ ghci -XNoMonomorphismRestriction

to start the haskell interpreter.

What does XNoMonomorphismRestriction switch mean?

1条回答
欢心
2楼-- · 2020-08-09 11:05

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.

查看更多
登录 后发表回答