I was just wrestling with a Haskell error for an hour, and then traced it to the use of a specific function name it
. Can someone explain why function names fu
and it
behave differently in the transcript below? Specifically, why does the type of it
change when it is called?
λ> fu x = x + 1
λ> :t fu
fu :: Num a => a -> a
λ> fu 1
2
λ> :t fu
fu :: Num a => a -> a
λ> it x = x + 1
λ> :t it
it :: Num a => a -> a
λ> it 1
2
λ> :t it
it :: Num a => a
When ghci is started fresh, it reports that it
is not in scope, so I do not think it
should have any special meaning by default.