gren-lang / gren-lang/core

`Result.Err` recovering

Open
#34 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
48
Forks
14
Avg merge
4h 14m
Merged PRs (30d)
1

Description

Currently there's only

Result.withDefault :
    a -> Result x a -> a

which the issue suggests to replace with

  • Result.valueElseOnError/recover :
        (x -> a) -> Result x a -> a
    

    which is lazy by default and makes it nearly impossible to forget error values.

  • additionally, an andThen but for the error case would be a common helpful operation

    Result.onErrorTry/recoverTry :
        (x -> Result a y) -> Result x a -> Result y a
    

Contributor guide

Open the contributing guide

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

Start by locating the existing Result.withDefault implementation and the surrounding Result API in the core package. Review how error-handling helpers are named and tested, then determine whether the proposed recovery and error-retry operations fit the package's conventions; done means the agreed API is implemented with coverage for its lazy recovery and error-case 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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.