[Haskell-cafe] Human-friendly compiler errors for GHC
Isaac Dupree
isaacdupree at charter.net
Sun Jul 13 06:11:22 EDT 2008
wren ng thornton wrote:
> 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.
It sounds like it only searches for modules you've imported (after all
they might've been brought into scope with an as-clause, and ghc has no
business poking in un-imported modules), but perhaps since in GHCi all
modules are in scope (under their original names -- in addition to any
imports in an interpreted file), it (ghci) searches all modules then?
If I want a "perhaps you meant to import" message, I want it to be a
*complete* listing of modules available that export that symbol, both
local ones and library ones, ideally :-) (certainly don't want a
recommendation to import e.g. List without at least an equal
recommendation of Data.List...)
-Isaac
More information about the Haskell-Cafe
mailing list