Pick
Applies the given chooser
function to successive elements, returning the first result where function returns an option value that IsSome
.
It works similar to Choose
function, but in this case only the first value is returned.
Parameters | Returns |
Func<T, Option<T2>> chooser IEnumerable<T> source | T2 |
Exceptions
Type | When |
InvalidOperationException | The chooser function returns options with IsNone for all elements. |
Usage
Getting the double of first odd number in a collection
Last updated