[Haskell-cafe] ghc-mod and cabal targets

CJ van den Berg cj at vdbonline.com
Fri Feb 8 12:50:47 CET 2013


On 08/02/13 12:25, Francesco Mazzoli wrote:
> At Fri, 08 Feb 2013 11:39:19 +0100,
> CJ van den Berg wrote:
>> I downloaded your package and tried it. It does work.
> 
> So, what I have is
> 
>    bitonic at clay ~/src/kant (git)-[master] % cat .ghci
>    :set -isrc
> 
> And I still get the mentioned error.  Did you take any other measures to make
> things work?  I’m using ghc-mod version 1.11.3.

Ah, I only just realised that you’re talking about the flymake error,
not the inferior-mode error. The problem is pretty much the same though.
flymake uses ghc --make, which can’t import the Kant module because it
doesn’t know how to build Parser.y.
ghc-ghc-options is the right place for flymake options to ghc.

>> Kant.REPL, which it is trying to load, is in the kant package. So it is
>> looking for either the installed kant package, or the source files for
>> the kant package modules.
>>
>> How is that not a package dependency? Telling it where to find the
>> source files will remove the need to find an installed kant package.
> 
> OK, now I understand what you are doing: instead of making ghc-mod rely on
> cabal, you simply make it load the files directly.  Which is a bit annoying in
> my case because I have some files that need to be preprocessed (alex/happy), but
> it would still be better than nothing.  I can achieve the same result by simply
> moving the ‘cabal’ file, or by deleting the target.  I guess that the ‘.ghci’
> has (or should have) the same effect.

Options in .ghci won’t fix flymake, only inferior-mode. ghc-ghc-options
is the place to fix flymake, although it won’t help if the import fails
anyway.

Can’t you manually preprocess Parser.y so that ghc --make has a .hs file
it can use?

-- 
CJ van den Berg

mailto:cj at vdbonline.com
xmpp:neurocyte at gmail.com
	



More information about the Haskell-Cafe mailing list