[Haskell-cafe] How to use cabal's data-files feature and run in-place?

Richard Cobbe cobbe at ccs.neu.edu
Sat Apr 23 15:28:03 CEST 2011


On Thu, Apr 21, 2011 at 11:27:10PM -0500, Antoine Latter wrote:
> 2. Here's what I do for the paths situation:
>
> In the package description, create a CPP option so you know you're
> compiling via Cabal:
>
> > Cpp-options: -DCABAL
>
> Then create a module to wrap around the autogenerated paths module,
> making sure to put the CPP Language pragma at the top:
>
> > {-# LANGUAGE CPP #-}
>
> You can then use #ifdef CABAL to decide to re-export the Cabal
> autogenerated paths functionality, or to use the ones you've written
> yourself (based on the current directory or whatever you need).
>
> I hope that this helps! I don't have any examples on hand at the moment.

Thanks -- works like a charm!  I'm particularly pleased to see that ghci
supports cpp.

Richard



More information about the Haskell-Cafe mailing list