GHC error message on type mismatch

Daniel Trstenjak daniel.trstenjak at gmail.com
Fri Nov 8 04:54:49 UTC 2013


Hi Simon,

On Thu, Nov 07, 2013 at 02:02:06PM +0000, Simon Peyton-Jones wrote:
> The motivation is this. Consider
> 
> 	f True
> 
> where f :: Int -> Char
> 
> Then 
>   f *expects* an argument of type Int
>   but the *actual* argument has type Bool
> 
> Does that help?

If you would switch the meaning of 'Expected' and 'Actual', than it
still could make perfectly sense and my brain seems to tend to this
switched meaning.

I think my main issue is the word 'Actual'. I seem to associate
something more authoritative with this word and not just a wrongly given
type by the user, and on the other side 'Expected' doesn't feel authoritative
enough.

Yes, I think the combination of the words 'Expected' and 'Actual' is
irritating me and that I'm perceiving 'Actual' as the more authoritative one.


Perhaps:

Couldn't match type `A' with `B´
    Real  type: B
    Given type: A


Or instead of 'Given', like others have suggested: 'Provided' or 'Supplied'.


Greetings,
Daniel


More information about the Glasgow-haskell-users mailing list