Philip Weaver [EMAIL PROTECTED] wrote:
I'm trying to use CPP-defined strings in a Haskell module, like this:
main :: IO ()
main = putStrLn FOO
This of course will not work:
ghc -DFOO=hello world --make Main.hs -o test
Have you tried using ANSI cpp's stringification operator?
On Tue, Jul 29, 2008 at 3:14 AM, Malcolm Wallace
[EMAIL PROTECTED] wrote:
Philip Weaver [EMAIL PROTECTED] wrote:
I'm trying to use CPP-defined strings in a Haskell module, like this:
main :: IO ()
main = putStrLn FOO
This of course will not work:
ghc -DFOO=hello world --make
Hello all,
I'm trying to use CPP-defined strings in a Haskell module, like this:
main :: IO ()
main = putStrLn FOO
This of course will not work:
ghc -DFOO=hello world --make Main.hs -o test
You'll get this error message:
./Main.hs:6:16: Not in scope: `hello'
./Main.hs:6:22:
On Mon, 2008-07-28 at 15:02 -0700, Philip Weaver wrote:
However, passing the same CPP definition via cabal does not work.
runhaskell Setup.hs build --ghc-options=-DFOO=\hello world\
runhaskell Setup.hs build --ghc-options=-DFOO='hello world'
With either of these commands, I get