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

Result.mapError #98

Merged
merged 1 commit into from
Jul 24, 2023
Merged

Result.mapError #98

merged 1 commit into from
Jul 24, 2023

Conversation

jmagaram
Copy link
Contributor

@jmagaram jmagaram commented Mar 13, 2023

This is a serious omission. Almost every functional library with Result or Either types have this. If you want to do railway-oriented programming you often need to convert the error types to a common type, and this function does it.

remove extra space before code comment

shorter docs, add Examples header

change log
@tsnobip
Copy link
Contributor

tsnobip commented Jul 24, 2023

hey, why don't we merge this? It'd definitely be welcome!

@DZakh
Copy link
Contributor

DZakh commented Jul 24, 2023

Agree. Actually, quite some time ago I wrote in the forum about adding the Result.mapError and people accepted the idea. Also, I read the source code of many libraries and almost all of them include the handwritten mapError function. I think there's no reason for it not to be a part of the Core lib. Ping @zth
https://forum.rescript-lang.org/t/suggestion-to-add-operations-on-result-type/3070

@zth zth merged commit 95ec318 into rescript-association:main Jul 24, 2023
4 checks passed
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

4 participants