29 Jun
2008
29 Jun
'08
11:18 p.m.
(which isn't nice either, as Haskell doesn't have nice multi-line strings).
well, how about using the new quasiquoting to get HereDocs:-) {-# LANGUAGE TemplateHaskell #-} module Here where import Language.Haskell.TH import Language.Haskell.TH.Quote here :: QuasiQuoter here = QuasiQuoter (litE . stringL) (litP . stringL) then {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} import Here s = [$here| hello multiline world |] test = lines s gives us *Main> test [" \r"," hello\r"," multiline\r"," world\r"," "] Claus