avh4 / avh4/elm-format

Replace `_ as foo` with `foo`

Open
#438 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
1.3k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

At some point I ended up with a pattern that looked like this:

case stuff of
    -- other patterns...

    _ as foo ->
        foo

Any _ as foo -> pattern can be (and seems like it should be) rewritten as foo ->. The latter seems like a strictly better way to write it. 😅

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by searching the formatter for handling of Elm pattern syntax and existing pattern-formatting tests, using the example as the minimal case. Done means _ as foo -> is formatted as foo -> without changing other patterns, with regression coverage.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.