No subject

Thu Feb 24 17:58:36 CET 2011

:info [<name> ...]          display information about the given names

By "names", it's referring to existing definitions, either in imported
modules or defined within ghci using let, e.g.:

Prelude> let foo =3D "foo"
Prelude> :i foo
foo :: [Char]   -- Defined at <interactive>:1:5-7

So, ":info g" would work; as would ":info g T" (by getting the info of
both g and T _separately_)..  But ":info g 4" doesn't because of the
_4_, as it is a literal value, not a name of a value.  This also
happens with literal Strings, etc.

Doing ":t g 4" tells ghci to determine the type of the expression "(g
4)".  Note that even if you did ":info g T" it will _not_ give you the
info of the expression "(g T)".

Ivan Lazar Miljenovic
Ivan.Miljenovic at

More information about the Haskell-Cafe mailing list