notcpp: Avoiding the C preprocessor via cunning use of Template Haskell

[ bsd3, library, template-haskell ] [ Propose Tags ]

notcpp is a library that attempts to provide an alternative to using CPP as a mechanism for conditional compilation. It provides facilities for determining if specific names or class instances exist and responding accordingly.

When a value or class instance appears between minor releases of a third-party package, a common way of dealing with the problem is to use CPP to conditionally use one block of code or another. The trouble with CPP is it's hard to statically analyse: tools based on haskell-src-exts will outright refuse to parse it, for example. It turns out Template Haskell will do the same job in some cases.


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 0.0.1, 0.1,, 0.2,,,
Dependencies base (<5), template-haskell (>=2.7 && <2.8) [details]
License BSD-3-Clause
Copyright 2012 Ben Millwood
Author Ben Millwood <>
Maintainer Ben Millwood <>
Category Template Haskell
Bug tracker
Source repo head: git clone git://
Uploaded by BenMillwood at 2012-04-13T20:28:26Z
Distributions NixOS:
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 4666 total (16 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]