Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is XNoMonomorphismRestriction?

This page usages

$ ghci -XNoMonomorphismRestriction

to start the haskell interpreter.

What does XNoMonomorphismRestriction switch mean?

like image 414
Pratik Deoghare Avatar asked Jan 01 '11 18:01

Pratik Deoghare


1 Answers

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.

like image 191
sepp2k Avatar answered Sep 20 '22 08:09

sepp2k