Re: [Haskell-cafe] Cabal and Strings and CPP

2008-07-29 Thread Malcolm Wallace
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?

Re: [Haskell-cafe] Cabal and Strings and CPP

2008-07-29 Thread Philip Weaver
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

[Haskell-cafe] Cabal and Strings and CPP

2008-07-28 Thread Philip Weaver
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:

Re: [Haskell-cafe] Cabal and Strings and CPP

2008-07-28 Thread Duncan Coutts
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