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
331/331 tests pass.
Co-authored-by: Copilot <[email protected]>
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,8 @@
1
+
### 4.11.0
2
+
3
+
* Added `AsyncSeq.tryFindBack` / `findBack` — returns the **last** element in a sequence for which the predicate returns `true`. Mirrors `Seq.tryFindBack` / `Seq.findBack`.
4
+
* Added `AsyncSeq.tryFindBackAsync` / `findBackAsync` — async-predicate variants of the above.
5
+
1
6
### 4.10.0
2
7
3
8
* Added `AsyncSeq.withCancellation` — returns a new `AsyncSeq` that passes the given `CancellationToken` to `GetAsyncEnumerator`, overriding whatever token would otherwise be supplied. Mirrors `TaskSeq.withCancellation` and is useful when consuming sequences from libraries (e.g. Entity Framework) that accept a cancellation token through `GetAsyncEnumerator`. Part of ongoing design-parity work with FSharp.Control.TaskSeq (see #277).
0 commit comments