Brittany not idempotent -- spaces get inserted #68

Closed
opened 2017-11-28 05:30:17 +01:00 by eschnett · 2 comments
eschnett commented 2017-11-28 05:30:17 +01:00 (Migrated from github.com)

Brittany inserts one additional space every time it is run on this expression.

This is the original input:

cs0 = 0 : [ c / Interval n | c <- cs | n <- [1..] ]

The first output is:

cs0 = 0 : [ c / Interval n |  c <- cs | n <- [1..] ]

with an additional space before c <- cs. Each run inserts an additional space there.

This is with

$ brittany --version
brittany version 0.8.0.3
Brittany inserts one additional space every time it is run on this expression. This is the original input: ``` cs0 = 0 : [ c / Interval n | c <- cs | n <- [1..] ] ``` The first output is: ``` cs0 = 0 : [ c / Interval n | c <- cs | n <- [1..] ] ``` with an additional space before `c <- cs`. Each run inserts an additional space there. This is with ``` $ brittany --version brittany version 0.8.0.3 ```
lspitzner commented 2017-11-28 18:29:36 +01:00 (Migrated from github.com)

(This is -XParallelListComp, right?)

This is more or less a bug in the workaround code for (yet) unhandled extensions. I have just added a Text.trim which fixes this particular issue, but this workaround fixup might break other such cases (for other unhandled extensions..)

The real fix is of course to support -XParallelListComp, which is the only way to properly and safely support (multiline) parallel list comps. I don't have time to implement this. PR welcome.

(This is `-XParallelListComp`, right?) This is more or less a bug in the workaround code for (yet) unhandled extensions. I have just added a `Text.trim` which fixes this particular issue, but this workaround fixup might break other such cases (for other unhandled extensions..) The real fix is of course to support `-XParallelListComp`, which is the only way to properly and safely support (multiline) parallel list comps. I don't have time to implement this. PR welcome.
lspitzner commented 2017-11-28 18:32:17 +01:00 (Migrated from github.com)

Nonetheless I will consider this fixed. Please open another issue if you desire support for -XParallelListComp.

Nonetheless I will consider this fixed. Please open another issue if you desire support for `-XParallelListComp`.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#68
There is no content yet.