Formatting unspaced operators
- Dominant language
- Haskell
- Stars
- 1.3k
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Description
I (too often) have code like this
Input:
```elm
a = f>>.field
b = g|>.field
```
Actual output (version 0.8.5):
```elm
a =
f >>. field
b =
g |>. field
```
Expected output:
```elm
a =
f >> .field
b =
g |> .field
```
I think the current behavior was correct for older versions of Elm, where `>>.` was potentially a valid Elm operator. Since 0.19, the operators are all known, and my thinking is that we could decide to try to end up in a state that it is more likely correct code (but is less agnostic about the operators).
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue using the Elm snippets in the report and compare the current output with the expected spacing around >>. and |>. Then trace the formatter behavior responsible for these operators and add coverage for both examples; done means the output matches the expected formatting without regressing older operator cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elm
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100