Haskell – Using ghci to find type

ghcihaskell

When I do something simple in ghci, like the following:

let x = 7 + 2

I expect ghci to give a response of the type that x holds, like:

x :: Integer

When I run ghci, I do not get that the above line. How do I get that response?

Best Answer

To show types automatically use :set +t:

μ> :set +t
μ> let x = 7 + 2
x :: Integer
μ>
Related Topic