[Haskell-cafe] Binding of an integer variable

Henning Thielemann lemming at henning-thielemann.de
Thu Jul 28 20:52:41 CEST 2011


On Thu, 28 Jul 2011, Paul Reiners wrote:

> I have a question about the following GHCi interaction:
> 
> Prelude> let x = 23
> Prelude> :show bindings
> x :: Integer = _
> 
> What is the meaning of the underscore in the third line?  Why doesn't it say this, instead?
> 
> x :: Integer = 23

I have never used ':show bindings' before ... in other cases like
    let x='a'
and
    let x=23::Int
  the value of 'x' is shown. If 'x' is bound to a function, the underscore 
is shown. Thus I assume, that ':show bindings' uses the underscore for 
types without text representation. But it seems not to use the 'Show' 
class, since in this case Integers could be shown.

The documentation does not mention the output of values, at all:
   http://www.haskell.org/ghc/docs/7.0-latest/html/users_guide/ghci-commands.html



More information about the Haskell-Cafe mailing list