Yields the first element in an input sync iterable that satisfies an optional predicate function.
If no predicate is provided, the first element in the iterable is yielded.
Returns
A function that accepts an input sync iterable and returns a new sync iterable.
Yields the first element in an input sync iterable that satisfies an optional predicate function. If no predicate is provided, the first element in the iterable is yielded.
Returns
A function that accepts an input sync iterable and returns a new sync iterable.
Example
Remarks
Available as
first
when imported frompeter-piper/sync
.