Fails with multiple binders in let-in in do-notation #290
Labels
No Label
blocked: dependency
blocked: info-needed
bug
duplicate
enhancement
fixed in HEAD
help wanted
hs:arrows
hs:brackets
hs:classes
hs:comments
hs:do-notation
hs:guards
hs:lists
hs:operators
hs:patterns
hs:records
hs:types
invalid
language extension support
layouting
needs confirmation
priority: high
priority: low
question
revisit before next release
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: hexagoxel/brittany#290
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Given the following input:
Brittany (version 0.12.1.1) fails and produces this output:
If there's only one binder in the
let
and it's short enough, Brittany produces output that works:GHC is fine with
let ... in ...
insidedo
notation as long as everything after thelet
is indented enough. It's possible to format the first example using layout like so:Thanks for the report, need to keep track of this.
I have thought about this briefly before, and I thought we'd be able to transform it into
do
's variant oflet
(the one withoutin
). But that does not work in general, because you can have recursive bindings:So your last suggestion is the only working solution I think.
Alternatively you may be able to drop the
in
, although that might lead to weird scoping problems.