Line endings in quasiquotations are not normalised
Consider the following simple quasiquoter:
foo = QuasiQuoter {
quoteExp = return . LitE . StringL
[...]
When used like this:
bar :: String
bar = [foo|FOO
BAR
BAZ|]
the string bar
will contain either LF or CRLF line endings depending on which convention is used in the file.
This is consistent with documentation, if a bit surprising. However, the problem is that version control systems (e.g. Git) usually store text files using Unix line endings, but allow checking them out in a platform-specific format. So this behaviour gives rise to subtle semantics changes in the compiled program that depend on the user's VCS settings. Therefore IMO it makes sense to always normalise CRLF to LF in quasiquotations.
Originally reported here, a test case can be found here.
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Parser) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |