|
|
|
# Proposal: remove string gaps
|
|
|
|
|
|
|
|
|
|
|
|
String gaps are barely necessary, being only a small syntactic convenience. e.g.
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
f = "abc\
|
|
|
|
\def"
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
can be written
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
f = "abc" ++
|
|
|
|
"def"
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
GHC compiles the same code in both cases.
|
|
|
|
|
|
|
|
## Pros
|
|
|
|
|
|
|
|
- simplifies the lexical syntax (good for automatic syntax colouring tools, which often get string gaps wrong).
|
|
|
|
|
|
|
|
- a better alternative is HereDocuments?
|
|
|
|
|
|
|
|
- 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`).
|
|
|
|
|
|
|
|
## Cons
|
|
|
|
|
|
|
|
- breaks some code
|
|
|
|
|
|
|
|
- naive compilers won't implement the optimisation, and hence will perform an unnecessary append. |