[Haskell-cafe] Code that writes code

Christopher Done chrisdone at googlemail.com
Fri Aug 20 05:22:43 EDT 2010


Check out the userHooks in Cabal[1]. I believe you can use, e.g.
hookedPreProcessors[2], or preBuild to preprocess your files into
regular Haskell files before building takes place.

[1]: http://www.haskell.org/ghc/docs/6.12.1/html/libraries/Cabal/Distribution-Simple-UserHooks.html#t%3AUserHooks
[2]: http://www.haskell.org/ghc/docs/6.12.1/html/libraries/Cabal/Distribution-Simple-UserHooks.html#v%3AhookedPreProcessors

On 19 August 2010 23:00, Andrew Coppin <andrewcoppin at btinternet.com> wrote:
> I'm working on a small Haskell package. One module in particular contains so
> much boilerplate that rather than write the code myself, I wrote a small
> Haskell program that autogenerates it for me.
>
> What's the best way to package this for Cabal? Just stick the generated file
> in there? Or is there some (easy) way to tell Cabal how to recreate this
> file itself?
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list