ghc-exactprint 0.6.3.1 (ghc-8.10.1) works well on Windows for most code, but it seems to insert extra carriage returns in comments.
For example,
--Another comment
--
newtype N a = Int a
data D a = A a | B | C a
gets turned into:
--Another comment
--
newtype N a = Int a
data D a = A a | B | C a
(there are \r\n, rather than \n at the end of each comment line. (Multi-line comments ({-) also have all their internal newlines replaced by cr+nl.)
There are two solutions:
get newline to push out \r\n, rather than \n, under Windows
always replace \r\nby\nwithin comments
Or you could offer both in different print styles, I suppose, because different people will have different git settings to handle this and golden test case output should be cross-platform.
ghc-exactprint 0.6.3.1 (ghc-8.10.1) works well on Windows for most code, but it seems to insert extra carriage returns in comments.
For example,
gets turned into:
(there are
\r\n
, rather than\n
at the end of each comment line. (Multi-line comments ({-
) also have all their internal newlines replaced by cr+nl.)There are two solutions:
newline
to push out\r\n
, rather than\n
, under Windows\r\n
by\n
within commentsOr you could offer both in different print styles, I suppose, because different people will have different git settings to handle this and golden test case output should be cross-platform.