Gabriella439 / Gabriella439/Haskell-Errors-Library

tryIO for cases when the action *both* uses Either *and* exceptions

Open
#15 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
65
Forks
22
PR merge metrics
No merged PRs in 30d

Description

I ran into an issue today where a library (`HTTP`) was using `Either` but could _also_ produce an exception. I ended up writing this, though something that ends up in `EItherT` might also be reasonable:

```
tryIO' :: (IOError -> e) -> IO (Either e b) -> IO (Either e b)
tryIO' mapErr io = eitherT (return . Left . mapErr) return (tryIO io)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the existing tryIO and eitherT entry points mentioned in the issue, then determine where a tryIO' helper belongs. Done means exceptions from the IO action are mapped with the supplied function into Left, while existing Either values remain unchanged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.