-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Hi Nils!
I couldn't find a method to check if an Option is empty or satisfies a given predicate.
I'm looking for an equivalent for scala's forall behaviour on Option.
I'm seeing two ways of getting this currently:
if (!opt.HasValue || opt.Exists(Predicate)) { ... }
if (opt.Map(Predicate).ValueOr(true)) { ... }
Is there some easier way that I missed?
If not, would you consider adding something like if (opt.IsEmptyOr(Predicate)), which would be more readable IMO. I might work on a PR if you are willing to accept it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels