BSD-3-Clause licensed by Anthony Cowley
Maintained by [email protected]
This version can be pinned in stack with:hpp-0.3.0.0@sha256:5ef421d204fc6528ed11e44bb4c507fd7f25e5afc33f80b6a78275af909aa0de,2688
Used by 2 packages in nightly-2015-12-04(full list with versions):

hpp is a Haskell pre-processor that is also a C89/C90-compatible pre-processor (with the addition of a --cpp flag). It is packaged as both a library and an executable.

To use as a Haskell preprocessor for resolving #ifdef conditionals and simple macro expansion while still allowing multi-line string literals, an invocation might look like,

hpp -DDEBUG Foo.hs

To use as a C preprocessor, an invocation might look like,

hpp -DDEBUG --cpp foo.c

To have GHC use hpp as the C pre-processor, add this line to the top of a Haskell source file that makes use of the CPP LANGUAGE pragma.

{-# OPTIONS_GHC -cpp -pgmPhpp -optP--cpp #-}

Changes

0.3

Switch to a stream processing model.

This library is designed to have minimal dependencies, so we now have a bespoke implementation of a cross between the pipes and machines libraries included.

This change was done to make some parsing operations easier, believe it or not. For example, most pre-processing is done on a line-by-line basis, but we must also support macro function applications that cross line boundaries. Thus the expansion logic can not merely be given one line at a time from an input file. Previously, a heuristic tried to combine consecutive lines before the parsing stage. Now, the parser itself is able to pull tokens in across lines when necessary.

TL;DR: The upshot is that processing /usr/include/stdio.h on OS X (a surprisingly complicated file!) now uses 78% of the time and 0.38% the memory of previous versions of hpp.

0.1

First release!