[Haskell] Redundant entries in .cabal file?
Andrew Morris
lists at andy-morris.xyz
Sat Aug 15 16:46:06 UTC 2015
On 15 Aug 2015, at 16:03, David Banas <capn.freako at gmail.com> wrote:
>
> Hi all,
>
> Does anyone know why I’m getting redundant entries in my ‘cabal init’ generated .cabal file:
>
> library
> exposed-modules: Language.Broker, Language.Broker
>
> ?
>
> Is it because I’m using a *.hsc file, as my source, and cabal is finding both files:
> • Broker.hsc, and
> • Broker.hs
> in the Language directory?
Yes. You can (and probably should) remove the `Broker.hs`; if you put:
build-tools: hsc2hs
(plus version constraint) in your cabal file, then Cabal knows how to generate the Haskell file itself.
Which programs are allowed in `build-tools` doesn't seem to be documented as far as I can tell, but it is some or all of the things listed here:
https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/Program/Builtin.hs
In any case, it certainly includes hsc2hs, and also alex, happy, cpphs, c2hs, and greencard (but not uuagc :( ). And, btw, you can put support for custom preprocessors in your `Setup.hs`, should you need that in future.
> Thanks,
> -db
More information about the Haskell
mailing list