Code refactoring: single case union deconstruction
Open
Area-LangService-CodeRefactorings
Feature Request
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
Refactor this code:
```fsharp
type CustomerId = CustomerId of id: int
let ProcessCustomerId (cid: CustomerId) =
match cid with
| CustomerId id -> printfn $"{id}"
```
into the following code:
```fsharp
type CustomerId = CustomerId of id: int
let ProcessCustomerId (CustomerId id) =
printfn $"{id}"
```
Thanks @vzarytovskii for the idea.
Contributor guide
Assessment
This issue has not been assessed yet.