[Haskell-cafe] getting haddock to cooperate with cpp

Evan Laforge qdunkan at gmail.com
Fri Jul 12 23:31:08 CEST 2013


I'm calling haddock myself. Cabal might have some special magic for CPP,
when I searched for "haddock CPP" I got some old bugs about adding cabal
support. So presumably it's possible.
On Jul 12, 2013 1:15 PM, "Felipe Almeida Lessa" <felipe.lessa at gmail.com>
wrote:

> Are you using `cabal haddock` or calling haddock manually?
>
> Cheers,
>
> On Fri, Jul 12, 2013 at 3:25 PM, Evan Laforge <qdunkan at gmail.com> wrote:
> > So haddock ignores {-# LANGUAGE CPP #-}, which makes it crash on any
> > file that uses it.  But if you pass --optghc=-cpp, it runs CPP on
> > everything, which makes it crash on any file that uses string gaps, or
> > happens to contain a /*.  /* is rare and easily fixed, but not string
> > gaps.
> >
> > It looks like a workaround would be to manually inspect the files for
> > LANGUAGE CPP and run two haddock passes, but then I would have to get
> > the two passes to cooperate creating a single TOC and index.
> >
> > Isn't there some way to run haddock on files that use CPP?
> >
> > In the broader scheme, it seems perverse to be using CPP in the first
> > place.  I use it to configure imports and exports, e.g. to swap out a
> > driver backend on different OSes, and to export more symbols when
> > testing.  Would it make sense to have a haskell version of CPP that
> > provides only these features (e.g. just #ifdef, #else, #endif, and
> > #define) and leaves out the problematic C comments and backslash
> > expectations?
> >
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
> --
> Felipe.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130712/9e452eb3/attachment.htm>


More information about the Haskell-Cafe mailing list