Is there a way to find out the type of a variable inside a function?

Andrew Wilcox andrew at andrewwilcox.name
Thu Aug 17 09:02:08 EDT 2006


I'm learning Haskell, and I've been reading through various source
code examples.

I find the ":type" commend in GHCi very helpful in finding out what
the type of top-level declarations are.

However, it only works on top-level declarations (as far as I know).

I find myself looking at code like

f x =
    ...
    where g = ...

wondering what f does, and so I try to figure out what the type of g
is... and I get lost pretty quickly!  :-)

Is there a way to find out the type of g?

Thanks!

Andrew


More information about the Glasgow-haskell-users mailing list