[Haskell-cafe] Cabal and Strings and CPP

Philip Weaver philip.weaver at gmail.com
Tue Jul 29 13:02:50 EDT 2008


On Tue, Jul 29, 2008 at 3:14 AM, Malcolm Wallace <
Malcolm.Wallace at cs.york.ac.uk> wrote:

> "Philip Weaver" <philip.weaver at gmail.com> 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?
>
>    {-# LANGUAGE CPP #-}
>    #define STRING(bar) #bar
>     main :: IO ()
>    main = putStrLn FOO
>
>   ghc -DFOO="STRING(hello world)" --make Main.hs -o test
>

Yes, I have.  It does not seem to be supported.


> Regards,
>    Malcolm
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080729/cc42bc14/attachment.htm


More information about the Haskell-Cafe mailing list