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

briand at aracnet.com briand at aracnet.com
Sun Feb 27 07:48:20 CET 2011


On Sat, 26 Feb 2011 22:42:15 -0700
Chris Smith <cdsmith at gmail.com> wrote:

> 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.
> 


aaaaargh !

this is needed in the .hs file generated by the .hsc.  It's not good
enough to put it in the source code which uses the library :

{-# LANGUAGE ForeignFunctionInterface #-}

what I don't understand is why the hsc processing and/or cabal build
doesn't automagically handle this.  maybe a ghc version thing ?  I'm
using 6.12.1.

the binding-DSL examples do NOT use the above PRAGMA anywhere in the
code.


Brian



More information about the Haskell-Cafe mailing list