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

Change the implementation of optional #131

Open
mlms13 opened this issue Apr 8, 2023 · 0 comments
Open

Change the implementation of optional #131

mlms13 opened this issue Apr 8, 2023 · 0 comments
Labels
code quality Internal improvements
Milestone

Comments

@mlms13
Copy link
Owner

mlms13 commented Apr 8, 2023

Now that we have a null decoder, we can decode optional values as:

let optional =
  decoder => alt(null |> map(() => None), decoder |> map(Option.pure))

See #124

@mlms13 mlms13 added the code quality Internal improvements label Apr 8, 2023
@mlms13 mlms13 added this to the v2.0-alpha.1 milestone Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Internal improvements
Projects
None yet
Development

No branches or pull requests

1 participant