hpp: A Haskell pre-processor

[ bsd3, development, library, program ] [ Propose Tags ]

See the README for usage examples


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.3.0.0, 0.3.1.0, 0.4.0, 0.4.1, 0.5.0, 0.5.0.1, 0.5.1, 0.5.2, 0.6.0, 0.6.0.1, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5
Change log CHANGELOG.md
Dependencies base (>=4.8 && <4.10), bytestring, bytestring-trie, directory, filepath, ghc-prim, hpp, semigroups (>=0.18 && <0.19), time (>=1.5), transformers (>=0.4) [details]
License BSD-3-Clause
Copyright (C) 2015-2016 Anthony Cowley
Author Anthony Cowley
Maintainer acowley@gmail.com
Category Development
Home page https://github.com/acowley/hpp
Source repo head: git clone http://github.com/acowley/hpp.git
Uploaded by AnthonyCowley at 2016-11-14T16:52:13Z
Distributions LTSHaskell:0.6.5, NixOS:0.6.5, Stackage:0.6.5
Reverse Dependencies 2 direct, 8 indirect [details]
Executables hpp
Downloads 11280 total (68 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for hpp-0.4.0

[back to package description]

hpp is a Haskell pre-processor that is also a 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 macro expansion, 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 #-}

Or add this line to your .cabal file:

ghc-options: -pgmPhpp

Note that you will need to ensure that the hpp executable is available in your build environment (e.g. you can add hpp as a build-depends in your .cabal file).