[Haskell-cafe] Improved message for GHC "No instance for" Errors

Victor Mateus Oliveira rhapsodyv at gmail.com
Thu Dec 24 14:25:31 EST 2009


Hi,

I would like to propose a modification in the ghc message for "no
instance for" errors.
In the message, the ghc tells that there's no instance for the type
you are using and it give you a hint that you can fix it adding a new
instance for your type. But it don't tell me any instance alternative
that already exists. So, if I don't know the correct type, I need to
look at the documentation.

At least for me, I get this message when I'm using the function in the
wrong way or when I forget to specify the some function signature.
It's quite rare the I want to add a new instance.
Of course that it's not a problem to look at the documentation, but
improving it can save a significant time and help the beginers to
guess the error and how fix it.

In C++ and Java, when I use g++ or javac and I make a wrong
overloading, the compiler show me some alternatives. I think it help
more than tell me to add a new overload to the function.

It's possible to do it in ghc?

I'm new haskell programmer and I enjoying a lot this language.

[]s
Victor

-- 
GNU/Linux user #446397 - http://counter.li.org


More information about the Haskell-Cafe mailing list