
29 Jul
2008
29 Jul
'08
6:14 a.m.
"Philip Weaver"
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? {-# LANGUAGE CPP #-} #define STRING(bar) #bar main :: IO () main = putStrLn FOO ghc -DFOO="STRING(hello world)" --make Main.hs -o test Regards, Malcolm