GHCI Can't Find Module But GHC Can

Simon Marlow
Thu, 27 Jun 2002 15:00:59 +0100

> The hmake parser specifically doesn't depend on layout.  A=20
> module doing
> crazy stuff like
>     module M where
>       import qualified {- " -}
>         N
> is perfectly fine, and all it takes to implement is the addition of a
> `concatMap' over and above the version which expects the whole import
> on one line.  (FWIW, the hmake parser is ~200 lines, of which ~150
> lines deals with cpp, ~30 lines deals with comments, and ~20 lines
> actually reads the imports.)

But the point is you *can* construct valid modules which will confuse
hmake (I just did).  Our experience with GHC has told us, if nothing
else, that the obscure cases always crop up eventually :-)

> > But ghci already contains a Haskell parser - so it should=20
> be much less
> > work.
> Agreed, except that you don't want to fully-parse each module
> twice, nor in general do you want to report all parse errors on the
> import-gathering pass!

Yes, that is indeed a problem.