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

adding opt_map to simplify result function application over optionals #397

Merged
merged 2 commits into from
Jan 25, 2022

Conversation

ewenmaclean
Copy link
Contributor

A function I use a lot when applying CCResult over optionals - e.g. in a translation of ASTs a fragment like:

| AST_from.Return expr -> let+ expr = opt_map trans_expr expr in AST_to.Return expr

where expr is an optional expression of type a option and trans_expr maps from a -> ('b,'err) result

src/core/CCResult.mli Outdated Show resolved Hide resolved
src/core/CCResult.ml Outdated Show resolved Hide resolved
@c-cube c-cube merged commit 4e79b72 into c-cube:master Jan 25, 2022
@c-cube
Copy link
Owner

c-cube commented Jan 25, 2022

Thank you! 🕺

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.

2 participants