-
Notifications
You must be signed in to change notification settings - Fork 30
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
Option existential quantifiers #124
base: main
Are you sure you want to change the base?
Conversation
doc improvements better docs rename exists to isSomeAnd like Rust changelog
How about this @zth @aspeddro @DZakh and anyone else? This is a small part of #85 and based on analogous functions in Rust and the Array module. As long as we have an Option module I think we should make it more complete and convenient. I am happy to get feedback from the community on a larger set of improvements. |
I agree that since we have There are a few reasons why I don't like the proposed functions:
So instead, I'd suggest adding |
Thanks for the thoughtful analysis. As for naming, some alternate names would be Without Alternately you could accomplish both with Piping? Don’t understand that argument. If I’m also a big fan of falling into the pit of success. I don’t think that means minimalist and only one way to do something. It means finding a good balance. Technically we don’t need One last thing. There is an |
This adds two functions -
Option.isSomeAnd
andOption.isNoneOr
. Full and really good documentation and tests. These are convenience functions that lead to shorter and easier-to-understand code. These correspond to the quantifiers "forAll" and "exists" in mathematics. We have analogous functions on the Array module.isSomeAnd
is likeArray.some
. Another common name isexists
. But I like the parallel usage here.isNoneOr
is likeArray.every
. Another common name isforAll
. But I and other people find this naming a little confusing for empty collections. For every PR I've received money for, I got $1 million dollars. Technically true.Rust discussion on isSomeAnd: rust-lang/rust#93050
F#: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-optionmodule.html