fsharp / fsharp/fslang-design

[style-guide] Parameter owner patterns should be consistent with prefix application expressions

Open
#712 10 comments 0 reactions 0 assignees View on GitHub
style-guide
Dominant language
F#
Stars
557
Forks
149
Avg merge
4d 13h
Merged PRs (30d)
2

Description

Union cases patterns should be consistent with their creation expressions, like this:
```fsharp
let _ = Foo x
let _ = Bar(1, 2)

match s with
| Foo x -> ()
| Bar(1, 2) -> ()
```

Currently Fantomas adds an extra space in the last pattern, which makes it inconsistent. I propose we should fix this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating Fantomas's handling of union-case creation and pattern expressions, then compare the formatting paths for `Foo x` and `Bar(1, 2)` shown in the issue. Confirm the current output and identify the relevant formatter tests; done means parameter-owner patterns use the same spacing as their corresponding creation expressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.