[Haskell-cafe] Re: Error message reform

wren ng thornton wren at freegeek.org
Thu May 28 00:31:11 EDT 2009


Max Rabkin wrote:
> Jeff Wheeler wrote:
> > I absolutely agree about expected/inferred. I always forget which is
> > which, because I can figure both could apply to each.
> 
> That's actually true for me too. When you say it like that, I remember
> times when I've had the same confusion.
> 
[...]
> My preference is still to include the words "expected" and "inferred"
> which indicate (to me) that *either* could be wrong. And they don't
> seem to me to be compiler writers' jargon. They're both ordinary (if
> not everyday) English words. But definitely we should use language
> which more clearly indicates which is which.

"
     Inferred the type `Bool' for the argument `True',
     but couldn't match it against the type `Int'
     expected for the first argument of `f'.
     in the ... at ... blah ...
"?


The problem with "expecting" is that there are many different actors 
(the function, the argument, the type inferer,...) and they could all 
plausibly be expecting something. Similarly, the types of both the 
argument and the function are inferred. The current message doesn't 
clarify the subjects of "expected" and "inferred", which is what makes 
it confusing. I think the vocabulary is very good, the message just 
needs to clear up the subjects of the two verbs.

-- 
Live well,
~wren


More information about the Haskell-Cafe mailing list