diff options
author | David Waern <davve@dtek.chalmers.se> | 2008-01-07 16:32:26 +0000 |
---|---|---|
committer | David Waern <davve@dtek.chalmers.se> | 2008-01-07 16:32:26 +0000 |
commit | 44deff77bb19105571fba6559fd62b8ddf127af6 (patch) | |
tree | b7278abc18868cde02d1ce0d6bd8edfde4515bf1 /doc | |
parent | 25bfeadce997376b9bafbb7dfbeb8ee2f4924b6a (diff) |
Update the "Using literate or pre-processed source" section
Diffstat (limited to 'doc')
-rw-r--r-- | doc/haddock.xml | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/doc/haddock.xml b/doc/haddock.xml index 3e98e35f..18db92d4 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -788,29 +788,12 @@ <section id="cpp"> <title>Using literate or pre-processed source</title> - <para>Haddock only accepts plain, non-literate, Haskell source. - This means that if you program in Literate Haskell, or you need - to use the C pre-processor in your Haskell source, then you need - to pre-process the files before feeding them to Haddock. This - is easily accomplished using GHC; for example, suppose we have a - Literate Haskell source file <filename>Foo.lhs</filename>, on - which we also need to run the C pre-processor:</para> - -<screen> -$ ghc -cpp -E -optP-P -D__HADDOCK__ Foo.lhs -o Foo.hs -$ haddock -h Foo.hs ... -</screen> - - <para>The <option>-E</option> option to GHC says "stop after - pre-processing", the <option>-cpp</option> option turns on the C - pre-processor, the <option>-optP-P</option> option tells the C - pre-processor not to leave any extra dropping behind (see the - description of the <option>-P</option> option in the gcc manual - for details), and the <option>-D__HADDOCK__</option> option - defines the symbol <literal>__HADDOCK__</literal> when - pre-processing (this is sometimes handy if you need to any - pre-processing conditionals in your source which depend on - whether the source is going to be fed to Haddock).</para> + <para>Since Haddock uses GHC internally, both plain and + literate Haskell sources are accepted without the need for the user + to do anything. To use the C pre-processor, however, + the user must pass the the <option>-cpp</option> option to GHC + using <option>--optghc</option>. + </para> </section> </chapter> |