[Haskell-beginners] curry in a hurry

Daniel Fischer daniel.is.fischer at web.de
Sat Jul 3 19:41:29 EDT 2010


On Sunday 04 July 2010 01:18:24, MAN wrote:
> The Integer/Num discrepancy you experience is due to ghci
> pushing the types a bit... put your code in a file for better results.
>
That depends. If you put the definition

g = curry f

at the top level of the module *and g is exported from the module*, the 
monomorphism restriction still applies. If g is not exported from the 
module (be it by not putting it in the module's explicit export list or 
because it's a local definition and not a top level definition), the MR 
does not apply and g has its fully polymorphic type.

Yes, MR is fun, fun, fun.

But generally, MR problems occur far more seldomly in source files than 
ghci sessions.
>
> part 3:
> I refuse to put myself through that twisted experiment of yours :P

It's not so bad actually. It looks daunting at first, but if it's broken 
down a bit, it's understandable, I think.



More information about the Beginners mailing list