> > Either, cpp (or some preprocessor standard), should be made 
> part of the
> > Haskell language definition or Haskell files that require a 
> preprocessor
> > should have a different extension. 

GHC dodges this by allowing you to say

{-# OPTIONS -cpp #-}

at the start of your Haskell file Foo.hs.  Any such OPTIONS
are simply added to the command line.  It's a great way to
record *in the source file*, rather than in your Makefile,
what non-standard things your module does.  I often put
-fglasgow-exts, or -syslib misc, in such an OPTIONS line.

I think this is a lot better than using filename suffixes.
I mention it here because it's a facility that may not be
widely known.  I don't know whether other implementations support it.
Of course, even if they do the meaning of the command line 
args may vary between compilers!

> programming language.  IMHO all uses of cpp in Haskell have
> either to do with other non-standard-conformance (eg, using
> unboxed values in GHC, but wanting to use Hugs also) or are
> plainly unnecessary, 

I'm not sure I agree with this.  Keith Wansbrough has an interesting
paper that identifies the ways in which a macro processor can
do thing that ordinary functions can't.   One solution is to add
macros (presumably in a more hygienic form than cpp), but I'm reluctant
to advocate that, because macros undoubtedly do overlap with functions.

So I'm waiting and hoping that someone will have a Really Good Idea.
(And using cpp meanwhile.)

Simon



Reply via email to