[Haskell-cafe] Human-friendly compiler errors for GHC

wren ng thornton wren at freegeek.org
Sat Jul 12 23:45:47 EDT 2008

Max Bolingbroke wrote:
> Agreed: I've implemented this too. I've also added fuzzy matching to
> package search:
> """
> $ stage2/ghc-inplace --make ../Test1.hs
> ../Test1.hs:3:7:
>     Could not find module `Data.Lost':
>       Use -v to see a list of the files searched for.
>       Maybe you meant `Data.List'
> $ stage2/ghc-inplace --make ../Test2.hs
> [1 of 1] Compiling Main             ( ../Test2.hs, ../Test2.o )
> ../Test2.hs:7:14:
>     Not in scope: `isSpace'
>     Maybe you meant `Char.isSpace'
> """

In terms of making error messages more helpful, I don't find general 
typos are much of an issue, but this part would be really nice! I've 
always been annoyed that GHC just says "no" rather than offering 
suggestions (-v is rarely helpful), especially since it knows about what 
modules are installed et al. Granted it's still an easy class of bugs to 
fix, but this is a much friendlier way of fixing them.

Live well,

More information about the Haskell-Cafe mailing list