
15 Feb
2014
15 Feb
'14
6 p.m.
On Sun, Feb 16, 2014 at 12:53:42AM +0200, Alexander Batischev wrote:
But type defaulting doesn't kick in until the very last moment. Up until binding the result, it stays as polimorphic as possible:
λ: :t 36 36 :: Num a => a
The moment you bind the result, though, it gets concrete type:
λ: let x = 36 λ: :t x x :: Integer
It has nothing to do with binding, actually. The above is just due to the monomorphism restriction. If you turn it off (highly recommended!):
:set -XNoMonomorphismRestriction let x = 36 :t x Num a => a
-Brent