cabal: question on compiling build prerequisites

Erik Hesselink hesselink at gmail.com
Sun Dec 8 20:37:33 UTC 2013


On Sun, Dec 8, 2013 at 7:50 PM, Peter Selinger <selinger at mathstat.dal.ca> wrote:
> thanks for your reply! So say my package directory contains two files:
>
>  Test.hs
>  PreProc.hs
>
> What you are suggesting is:
>
>  ghc Test.hs -F -pgmF ./PreProc
>
> However, this gives the error message:
>
>  ghc: could not execute: ./PreProc
>
> And indeed, while GHC is smart enough to automatically run a
> preprocessor, it is not smart enough to automatically *compile* the
> preprocessor. So it needs to be compiled beforehand, which would be
> Cabal's job.

Not per se. You could try making it executable, and prepending a line like:

#!/usr/bin/env runhaskell

That way you can run your preprocessor like a script, without compiling it.

Erik


More information about the cabal-devel mailing list