|
|
# Proposal: remove string gaps
|
|
# Proposal: remove string gaps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String gaps are barely necessary, being only a small syntactic convenience. e.g.
|
|
String gaps are barely necessary, being only a small syntactic convenience. e.g.
|
|
|
|
|
|
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
|
f = "abc\
|
|
f = "abc\
|
|
|
\def"
|
|
\def"
|
| ... | @@ -11,6 +13,7 @@ f = "abc\ |
... | @@ -11,6 +13,7 @@ f = "abc\ |
|
|
|
|
|
|
|
can be written
|
|
can be written
|
|
|
|
|
|
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
|
f = "abc" ++
|
|
f = "abc" ++
|
|
|
"def"
|
|
"def"
|
| ... | @@ -19,8 +22,14 @@ f = "abc" ++ |
... | @@ -19,8 +22,14 @@ f = "abc" ++ |
|
|
|
|
|
|
|
GHC compiles the same code in both cases.
|
|
GHC compiles the same code in both cases.
|
|
|
|
|
|
|
|
|
|
|
|
## Pros
|
|
## Pros
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- simplifies the lexical syntax (good for automatic syntax colouring tools, which often get string gaps wrong).
|
|
- simplifies the lexical syntax (good for automatic syntax colouring tools, which often get string gaps wrong).
|
|
|
|
|
|
|
|
- a better alternative is HereDocuments?
|
|
- a better alternative is HereDocuments?
|
| ... | @@ -30,13 +39,7 @@ GHC compiles the same code in both cases. |
... | @@ -30,13 +39,7 @@ GHC compiles the same code in both cases. |
|
|
|
|
|
|
|
## Cons
|
|
## Cons
|
|
|
|
|
|
|
|
- string gaps are sometimes really helpful for formatting/pretty printing code neatly; the ++ alternative often necessecitates
|
|
|
|
|
additional bracketing
|
|
|
|
|
|
|
|
|
|
- breaks some code
|
|
- 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. |
|
- naive compilers won't implement the optimisation, and hence will perform an unnecessary append. |