lspitzner / lspitzner/brittany
List in last line of do-block prevents formatting
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 686
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
I have the following function:
```haskell
wnums :: [Double] -> [Double]
wnums nums = do
a <- nums
b <- nums \\ [a]
c <- nums \\ [a, b]
d <- nums \\ [a, b, c]
o1 <- opts
o2 <- opts
o3 <- opts
[ (a `o1` b) `o2` (c `o3` d)
, ((a `o1` b) `o2` c) `o3` d
, a `o1` (b `o2` (c `o3` d))
, (a `o1` (b `o2` c)) `o3` d
, a `o1` ((b `o2` c) `o3` d)
]
```
This function compiles but when i run brittany on the source file then it errors out with `ERROR: brittany pretty printer returned syntactically invalid result.`
Without this function the source file can be reformatted just fine.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure by adding the Haskell function from the issue to a source file and running brittany on it. Inspect the formatter output and its syntax validity; done means this do-block formats successfully without the syntactically invalid result error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100