Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Either mapError #1882

Closed
wants to merge 1 commit into from

Conversation

sukovanej
Copy link
Contributor

@@ -98,7 +98,7 @@ Added in v2.0.0
- [getApplicativeValidation](#getapplicativevalidation)
- [getOrElse](#getorelse)
- [getOrElseW](#getorelsew)
- [mapLeft](#mapleft)
- [mapError](#maperror)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conceptually Either contains 2 values. Don't think there is a certainty for Left to be an "error".

Copy link
Owner

@gcanti gcanti May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: Yeah, mapError in Either.ts was intentionally omitted (no mapError in @effect/data/Either as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, kinda makes sense. The inconsistency is unfortunate tho as now the TaskEither or ReaderTaskEither have the mapError while the Either doesn't.

True, the Either doesn't need to represent success / fail and can be used for anything where distinction for two outcomes is desired. But, at least from my experience, it is used for failable computations most of the time.

@sukovanej sukovanej closed this May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants