
20 Nov
2023
20 Nov
'23
8:07 p.m.
On Mon, Nov 20, 2023 at 02:47:39PM -0500, Viktor Dukhovni wrote:
It looks like there's some sort of syntax conflict between CPP and long string literals folded across multiple lines. Is there a way to have both CPP and folded long string literals?
I may have found an acceptable work-around: {-# LANGUAGE CPP #-} module Main(main) where hello :: String hello = "Hello\ \ \ World!" main :: IO () main = print hello Is this trick "well known"? CPP turns the above into: {-# LANGUAGE CPP #-} module Main(main) where hello :: String hello = "Hello\ \ World!" main :: IO () main = print hello which is then valid Haskell syntax and yields the right value. -- Viktor.