You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add four backward-search functions that mirror F# standard library:
- tryFindBack : ('T -> bool) -> AsyncSeq<'T> -> Async<'T option>
- findBack : ('T -> bool) -> AsyncSeq<'T> -> Async<'T>
- tryFindBackAsync : ('T -> Async<bool>) -> AsyncSeq<'T> -> Async<'T option>
- findBackAsync : ('T -> Async<bool>) -> AsyncSeq<'T> -> Async<'T>
These iterate the entire source sequence and return the last element
satisfying the predicate, complementing the existing tryFind / find
(which return the first match). findBack raises KeyNotFoundException
when no element satisfies the predicate; tryFindBack returns None.
All four are documented in AsyncSeq.fsi. 10 new tests added; all
358/358 tests pass.
Co-authored-by: Copilot <[email protected]>
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@
12
12
* Added `AsyncSeq.delay` — defers sequence creation to enumeration time by calling a factory function each time `GetAsyncEnumerator` is called. Mirrors `TaskSeq.delay`.
13
13
* Added `AsyncSeq.collectAsync` — like `collect` but the mapping function is asynchronous (`'T -> Async<AsyncSeq<'U>>`). Mirrors `TaskSeq.collectAsync`.
14
14
* Added `AsyncSeq.partition` / `AsyncSeq.partitionAsync` — splits a sequence into two arrays using a (optionally async) predicate; the first array contains matching elements, the second non-matching. Mirrors `TaskSeq.partition` / `TaskSeq.partitionAsync`.
15
+
* Added `AsyncSeq.tryFindBack` / `findBack` — returns the **last** element in a sequence for which the predicate returns `true`. Mirrors `Seq.tryFindBack` / `Seq.findBack`.
16
+
* Added `AsyncSeq.tryFindBackAsync` / `findBackAsync` — async-predicate variants of the above.
0 commit comments