2005-02-18 23:49:00 -05:00
|
|
|
Rightly or wrongly, the C pre-processor is widely used in Haskell
|
|
|
|
source code. It enables conditional compilation for different
|
|
|
|
compilers, different versions of the same compiler, and different OS
|
|
|
|
platforms. It is also occasionally used for its macro language, which
|
|
|
|
can enable certain forms of platform-specific detail-filling, such as
|
|
|
|
the tedious boilerplate generation of instance definitions and FFI
|
|
|
|
declarations. However, there are two problems with cpp, aside from the
|
|
|
|
obvious aesthetic ones:
|
|
|
|
|
|
|
|
* For some Haskell systems, notably Hugs on Windows, a true cpp is
|
|
|
|
not available by default.
|
|
|
|
* Even for the other Haskell systems, the common cpp provided by the
|
2007-06-29 06:59:07 -04:00
|
|
|
gcc 3.x and 4.x series has changed subtly in ways that are
|
|
|
|
incompatible with Haskell's syntax. There have always been
|
|
|
|
problems with, for instance, string gaps, and prime characters
|
|
|
|
in identifiers. These problems are only going to get worse.
|
2005-02-18 23:49:00 -05:00
|
|
|
|
2007-06-29 06:59:07 -04:00
|
|
|
So, it seemed right to provide an alternative to cpp, both more
|
|
|
|
compatible with Haskell, and itself written in Haskell so that it
|
2005-02-18 23:49:00 -05:00
|
|
|
can be distributed with compilers. This version of the C pre-processor
|
|
|
|
is pretty-much feature-complete, and compatible with the -traditional
|
|
|
|
style.
|