[Haskell-cafe] Re: Error message reform

wren ng thornton wren at freegeek.org
Thu May 28 23:35:14 EDT 2009

Claus Reinke wrote:
> Still, I would really like a "just the facts, please" mode for GHC, with 
> less text and more type signatures (especially for the contexts of type 
> mismatches). Error messages simply not including the
> information I need has become my main issue with GHC messages,
> and seems to be a common thread over many tickets and threads
> apparently discussing phrasing (eg, expected/inferred: who expects
> and why, and what is the inference based on?).

FWIW, the suggestion I floated has less text than the current message 
while preserving all the type and expression information ;)

(Though it doesn't necessarily generalize to cover similar messages like:

     Prelude> :t (\x -> x) :: a -> b
         Couldn't match expected type `b' against inferred type `a'
           `b' is a rigid type variable bound by
           the polymorphic type `forall a b. a -> b' at <interactive>:1:0
           `a' is a rigid type variable bound by
           the polymorphic type `forall a b. a -> b' at <interactive>:1:0
         In the expression: x

> Just, please, keep in mind that there is no one-size-fits-all:
> improving a message for one group of users might well make
> it less useful for another group.


There're worlds of difference between the kinds of error messages 
suitable for beginners, vs "regular users", vs type-level programmers. 
Also, while a user may have some given level of understanding, the level 
of messaging they'll want can vary a lot depending on the task a hand.

Live well,

More information about the Haskell-Cafe mailing list