Can GHCi tell me the type of a local Haskell function? -
Is it possible to query ghci for the estimated type of function inside any other function?
This is a quick and ugly hack, but what I usually do is use the function incorrectly And reads the error message:
inc x = x + 1 where f (y, z) = y + zg = f :: four
GHCI Output:
Estimated type `character 'from type' (T, T) - & gt; In T 'expression: f :: char
Although this reference is num t = & gt;
, it usually gives me enough information to continue.
Comments
Post a Comment