state of the cabal (preprocessors)

Henrik Nilsson nhn at Cs.Nott.AC.UK
Mon Oct 25 11:43:45 EDT 2004

Malcolm Wallace wrote:

 > I think Simon was suggesting the pragma {-# LANGUAGE ... #-} for a
 > compiler-independent specification of the specific language extensions
 > required by a module - this could indeed be in a format derived from
 > Cabal.

Very good.

 > I don't see how the use of pragmas will directly reduce the need for
 > conditional imports.  Eventually, the libraries shipped with compilers
 > will converge sufficiently to reduce differences in imports, but that
 > is a separate issue.

I simply meant that it would be unfortunate if one had to resort to
CPP just because of some incompatibility between the command-line
syntax of the various compilers. E.g., I'd rather not write
things like

     #ifdef __GHC__
     {-# OPTIONS ... #-}
     #ifdef __NHC__
     {-# OPTIONS ... #-}


Henrik Nilsson
School of Computer Science and Information Technology
The University of Nottingham
nhn at

This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks.  Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

More information about the Libraries mailing list