GHC error message on type mismatch

Carter Schonwald carter.schonwald at gmail.com
Fri Nov 8 05:19:05 UTC 2013


i'm not sure how change the words to synonyms helps communicate the exact
same thing better, :)

That said, once you start digging into really really fancy types, you'll
certainly discover examples where the error messages are confusing and need
some care to better communicate what is indeed the error.

Point being: as you get into trying out really really fancy types, please
feel welcome to  share examples where the resulting error messages seem
lacking / down right confusing. (though asking for help on the cafe list or
#haskell on irc first is probably the first place to go, of course)


On Thu, Nov 7, 2013 at 11:54 PM, Daniel Trstenjak <
daniel.trstenjak at gmail.com> wrote:

>
> 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
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20131108/3dc5e66a/attachment.html>


More information about the Glasgow-haskell-users mailing list