Proposal: remove string gaps

String gaps are barely necessary, being only a small syntactic convenience. e.g.

f = "abc\

can be written

f = "abc" ++

GHC compiles the same code in both cases.


  • simplifies the lexical syntax (good for automatic syntax colouring tools, which often get string gaps wrong).
  • string gaps cause problems with CPP, which doesn't like the backslash at the end of the line. (a minor consideration, since CPP is not part of the language, and in any case there is cpphs).


  • string gaps are sometimes really helpful for formatting/pretty printing code neatly; the ++ alternative often necessecitates additional bracketing
  • breaks some code
  • the simplification of the lexical syntax is very minor
  • arguably, the syntax highlighting ought to be fixed as that's what at fault, not the language as such
  • naive compilers won't implement the optimisation, and hence will perform an unnecessary append.
Last modified 10 years ago Last modified on Apr 1, 2008 8:12:33 PM