[Haskell-cafe] why is ghci trying to load hsc file ??

Chris Smith cdsmith at gmail.com
Sun Feb 27 06:42:15 CET 2011


On Sat, 2011-02-26 at 21:36 -0800, briand at aracnet.com wrote:
> [1 of 2] Compiling Bindings.HDF5    ( dist/build/Bindings/HDF5.hs,
> interpreted ) *** Parser:
> 
> src/Bindings/HDF5.hsc:49:8: parse error on input `import'

So it's in HDF5.hs ultimately, but LINE directives are telling it to
report a different location.

> HDF5.hs file has LINE scattered throughout, but they are in comments:
> 
> {-# LINE 15 "src/Bindings/HDF5.hsc" #-}

Those {-# ... #-} things are pragmas.  As far as the language spec goes
they are comments, but actually, compilers read them and interpret their
contents.  In this case, it causes the compiler to report a different
location for errors.

> regardless, there is NO "LINE 49" directive, and the HDF5.hs file is
> blank on line 49.

Line 49 of HDF5.hs doesn't matter.  What's on line 49 of the hsc file?

If you don't want to debug using the hsc file (which is the way this is
designed), you'll have to find the LINE directive in the .hs file
nearest to (but before) 49, and count lines from there.

-- 
Chris Smith




More information about the Haskell-Cafe mailing list