GHC error message on type mismatch

Evan Laforge qdunkan at gmail.com
Fri Nov 8 08:01:13 UTC 2013


On Thu, Nov 7, 2013 at 4:22 AM, David Luposchainsky
<dluposchainsky at googlemail.com> wrote:
> On 2013-11-07 12:52, Daniel Trstenjak wrote:
>> My problem is with 'Expected' and 'Actual', that I'm often unsure if
>> the compiler is "expecting" something or if I'm the expecting one
>> and the same goes for "actual".
>
> Funny you mention it; I think I just got too used to the fact that every
> time I see this error I have to take a step back to remember what it
> means exactly. Renaming it to "given" or "provided" would really help.

For what it's worth, I used to have the same confusion.  But after a
few years it went away.  Now it seems obvious and I don't really
understand how I was confused before, or how I got unconfused.

That's the classic problem with trying to make anything intuitive.

When I write my own typecheck msgs, I always write "Function expected
X, but received Y."  That's not too far off from expected / actual,
though at least it has an explicit subject.


More information about the Glasgow-haskell-users mailing list