iodevs / iodevs/result

Refactor catch error functions

Open
#15 0 comments 0 reactions 1 assignee Claimed by @s-m-i-t-a View on GitHub
enhancement hacktoberfest
Dominant language
Elixir
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Examples of use:

```elixir
iex> e = {:error, :bad}
iex> Result.catch_error(e, fn :bad -> {:ok, 123} end)
{:ok, 123}
iex> Result.catch_error(e, fn :wrong -> {:ok, 345} end)
{:error, :bad}
iex> Result.catch_error({:ok, 987}, fn :bad -> {:ok, 123} end)
{:ok, 987}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.