question about expected and inferred types in error messages
Frederik Eaton
frederik at a5.repetae.net
Tue Mar 13 17:18:18 EDT 2007
> Couldn't match expected type `Bool -> [a]'
> against inferred type `()'
> In the first argument of `a', namely `()'
> In the expression: a ()
> In the definition of `d': d = a ()
Also, I don't know what other people will think, but something bothers
me about the "In" on the third line - perhaps if we replaced, on just
that line, "In" with "For":
> Couldn't match expected type `Bool -> [a]'
> against inferred type `()'
> For the first argument of `a', namely `()'
> In the expression: a ()
> In the definition of `d': d = a ()
then it would help reinforce the idea that the given expression E :=
`()' is the referent of the words "expected" and "inferred" - i.e.
that the first type is "expected" *of* E by the context, and the
second type is "inferred" *for* E from other judgments. Does that make
sense?
Otherwise, since from different perspectives both types are both
expected and inferred, I think there is potential for confusion (the
other perspective is, respecting the context).
Thanks,
Frederik
More information about the Glasgow-haskell-bugs
mailing list