[Haskell-cafe] A restricted subset of CPP included in a revision of Haskell 98

Henning Thielemann lemming at henning-thielemann.de
Sun Aug 20 16:37:45 EDT 2006


On Thu, 17 Aug 2006, Brian Smith wrote:

> I find it strange that right now almost every Haskell program directly or
> indirectly (through FPTOOLS) depends on CPP, yet there is no effort to
> replace CPP with something better or standardize its usage in Haskell.

I think there should be more effort to avoid CPP completely. My
experiences with Modula-3 are, that you can nicely separate
special-purpose stuff into modules which are included depending on some
conditions. Say you want the same module both for Windows and Unix, you
provide directories WIN32 and POSIX containing implementations with the
same interface and then the make system can choose the appropriate
directory.

See for example the handling of line end coding in Windows and Unix:
 http://www.elego-software-solutions.com/cgi-bin/cvsweb.cgi/cm3/m3-libs/libm3/src/rw/


More information about the Haskell-Cafe mailing list