
21 Oct
2021
21 Oct
'21
6:47 p.m.
On Thu, Oct 21, 2021 at 08:40:45PM +0200, Matthias Güdemann wrote:
This is what I get using ghci
λ> :t (\a b -> a + b) (\a b -> a + b) :: Num a => a -> a -> a
but when loading a .hs file with just this function (without signature)
add = \a b -> a + b
I get
λ> :t add add :: Integer -> Integer -> Integer
Compare: $ ghci -XNoMonomorphismRestriction λ> x = \a b -> a + b λ> :t x x :: Num a => a -> a -> a with $ ghci -XMonomorphismRestriction λ> x = \a b -> a + b λ> :t x x :: Integer -> Integer -> Integer -- Viktor.