The cpphs package

[Tags:lgpl, library, program]

Cpphs is a re-implementation of the C pre-processor that is both more compatible with Haskell, and itself written in Haskell so that it can be distributed with compilers.

This version of the C pre-processor is pretty-much feature-complete and compatible with traditional (K&R) pre-processors. Additional features include: a plain-text mode; an option to unlit literate code files; and an option to turn off macro-expansion.

[Skip to Readme]


Versions 1.3, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.13.1, 1.13.2, 1.13.3, 1.14, 1.15, 1.16, 1.17, 1.17.1, 1.18, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.18.6, 1.18.7, 1.18.8, 1.18.9, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6, 1.20.7, 1.20.8 (info)
Change log CHANGELOG
Dependencies base (<4.4), haskell98 [details]
License LGPL
Copyright 2004-6, Malcolm Wallace
Author Malcolm Wallace <>
Maintainer Malcolm Wallace <>
Category Development
Home page
Uploaded Fri Nov 3 14:59:05 UTC 2006 by RossPaterson
Updated Wed Dec 24 20:29:08 UTC 2014 by HerbertValerioRiedel to revision 2
Distributions Arch:1.20.8, Debian:1.19.3, Fedora:1.20.3, FreeBSD:1.19, LTSHaskell:1.20.8, NixOS:1.20.8, Stackage:1.20.8, Tumbleweed:1.20.8
Downloads 163418 total (6052 in the last 30 days)
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for cpphs

Readme for cpphs-1.3

This directory contains 'cpphs', a simplified re-implementation of cpp,
the C pre-processor, in Haskell.

Just use
    hmake cpphs [-package base]
    ghc --make cpphs [-o cpphs]		#  -o needed for ghc <= 6.4.1 ]
    runhugs cpphs	# or rename the script cpphs.hugs to cpphs

	cpphs  [filename | -Dsym | -Dsym=val | -Ipath]+  [-Ofile]
               [ --cpp compatopts ]

For fuller details, see docs/index.html

If you want to use cpphs as a completely drop-in replacement for the
real cpp, that is, to accept the same arguments, and have broadly
the same behaviour in response to them, then use the --cpp compatibility

Copyright (c) 2004-2006 Malcolm Wallace (
except for Text.ParserCombinators.HuttonMeijer (Copyright (c) 1995
Graham Hutton and Erik Meijer).

These library modules are distributed under the terms of the LGPL.
The application module 'cpphs.hs' is GPL.

This software comes with no warranty.  Use at your own risk.

darcs get