| configuration: +t
| Expected behaviour:
| Fib>f
| <<Function>> Num a: a -> a
| Observed behaviour:
| Fib> f
| <<Function>> Int -> Int
| ...
| Code:
| module Fib where
|
| f n = n+1
This is not a bug. If you want to find the most general type of a
function named f, you should use the command :info f (or :i f).
If you want to find the most general type of an expression (a special
case of which is the name of a function), then you should use the
command :type expr (or :t expr).
If you type in an expression to be evaluated, and if that expression
has an overloaded principal type, then Hugs would not, under normal
circumstances, be able to evaluate it at all. Instead, it would
produce an error message about unresolved overloading. To avoid
this behaviour, Hugs first tries to use the current defaults to
resolve the overloading. In this case, that means replacing the
type var a with Int, at which point the overloading is resolved
and evaluation proceeds, to be followed (in the presence of +t)
by the type at which the expression was evaluated.
All the best,
Mark