expanding type synonyms in error messages

Gabor Greif ggreif at gmail.com
Tue Jun 16 17:53:44 UTC 2015


Clang (and recent GCC versions) do something like this in error
messages. They say

   MyString (aka std::string<...lots of junk...>) is uncool

maybe a similar system would help you?

Cheers,

    Gabor

On 6/16/15, Ömer Sinan Ağacan <omeragacan at gmail.com> wrote:
> Hi all,
>
> While working with complex types with lots of arguments etc. errors are
> becoming annoying very fast. For example, GHC prints errors in this way:
>
>     Expected type: <type without any synonyms>
>       Actual type: <type with synonyms>
>
> Now I have to expand that synonym in my head to understand the error.
>
> I was wondering if implementing something like this is possible:
>
> In type error messages, GHC also prints types that are cleaned from type
> synonyms. Maybe something like this:
>
>          Expected type: <type1>
>     (without synonyms): <type1, synonyms are expanded>
>            Actual type: <type2>
>     (without synonyms): <type2, synonyms are expanded>
>
> If this is not always desirable for some reason, we can hide this behavior
> behind a flag.
>
> What do GHC devs think about this? Is this, in theory, possible to do? How
> hard
> would it be to implement this?
>
> Thanks.
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>


More information about the ghc-devs mailing list