avh4 / avh4/elm-format

More flexible handling of infix operators

Open
#201 10 comments 1 reaction 0 assignees View on GitHub
discussion
Dominant language
Haskell
Stars
1.3k
Forks
147
PR merge metrics
No merged PRs in 30d

Description

I'd like to throw out there that instead of special casing `<|` we just give more flexibility to infix operators, and not manipulate them by default. Instead if a operator is found on a new line, elm-format could line it up with other operators found on new lines, but leave them alone otherwise. Right now I find myself frequently adding parenthesis to stop elm-format from making my code less readable.

If I wrote the following, I'd prefer elm-format not alter it in any way:

``` elm
foo x =
fn ++ bar
<| a 1
<| b 2 ++ baz
<| c 3
```

I don't find the above code to be unreasonable, or unreadable.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points. Begin by locating elm-format’s handling of infix operators and comparing it with the provided Elm example. Done requires an agreed rule for preserving or aligning operators and tests that demonstrate the intended formatting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.