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

Add a mapNullable #60

Open
pawlufelice opened this issue Apr 26, 2023 · 1 comment
Open

Add a mapNullable #60

pawlufelice opened this issue Apr 26, 2023 · 1 comment

Comments

@pawlufelice
Copy link

It would be awesome to have a map that caters for nullable values and would return none if it's so.

At the moment I use

just(4).chain(x => fromNullable(add2(x)))

but it's cumbersome and not point-free. https://github.com/AlexGalays/space-monad implemented it in the map itself which imo is great.

@JSMonk
Copy link
Owner

JSMonk commented Jul 16, 2023

It looks really useful. I will add it soon. Thank you for the proposal 🙏

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

No branches or pull requests

2 participants