[Haskell-cafe] cpp question

S. Doaitse Swierstra doaitse at swierstra.net
Sun Feb 1 21:42:14 UTC 2015

With the new version of GHC (7.8.3) I am running into problems with cpp.

The header of one of the files of my uu-parsinglib library reads as follows:

{-# LANGUAGE NoMonomorphismRestriction,
             CPP  #-}
#define DEMO(p,i) demo "p" i p
#define DEMOG(p,i) demo "p" i (mkP (p))
module Text.ParserCombinators.UU.Demo.MergeAndPermute where


However when I try to compile this file I get error messages like:

    Not in scope: data constructor ‘DEMOG’

So it seems that the cpp is no longer called at all.

Any hints? I am running:

MacBook-Doaitse:src doaitse$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3
MacBook-Doaitse:src doaitse$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
MacBook-Doaitse:src doaitse$ 

Any help is appreciated,

 Doaitse Swierstra

More information about the Haskell-Cafe mailing list