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
Adds four new API functions that return the *last* element satisfying a
predicate, mirroring Array.tryFindBack / Array.findBack / List.tryFindBack /
List.findBack in the F# standard library:
- AsyncSeq.tryFindBack : ('T -> bool) -> AsyncSeq<'T> -> Async<'T option>
- AsyncSeq.findBack : ('T -> bool) -> AsyncSeq<'T> -> Async<'T>
- AsyncSeq.tryFindBackAsync: ('T -> Async<bool>) -> AsyncSeq<'T> -> Async<'T option>
- AsyncSeq.findBackAsync : ('T -> Async<bool>) -> AsyncSeq<'T> -> Async<'T>
Each function scans the full sequence once, keeping the last match seen in a
mutable local (no buffering of the whole sequence). findBack/findBackAsync
raise KeyNotFoundException when no match is found. 10 new tests added; all
382 existing tests continue to pass (386 total with the new tests).
Co-authored-by: Copilot <[email protected]>
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
### 4.12.0
2
+
3
+
* Added `AsyncSeq.tryFindBack` — returns the last element for which the predicate returns true, or `None` if no match. Mirrors `Array.tryFindBack` / `List.tryFindBack`.
4
+
* Added `AsyncSeq.tryFindBackAsync` — async-predicate variant of `tryFindBack`.
5
+
* Added `AsyncSeq.findBack` — returns the last element for which the predicate returns true; raises `KeyNotFoundException` if no match. Mirrors `Array.findBack` / `List.findBack`.
6
+
* Added `AsyncSeq.findBackAsync` — async-predicate variant of `findBack`.
7
+
1
8
### 4.11.0
2
9
3
10
* Code/Performance: Modernised ~30 API functions to use `mutable` local variables instead of `ref` cells (`!`/`:=` operators). Affected: `tryLast`, `tryFirst`, `tryItem`, `compareWithAsync`, `reduceAsync`, `scanAsync`, `pairwise`, `windowed`, `pickAsync`, `tryPickAsync`, `tryFindIndex`, `tryFindIndexAsync`, `threadStateAsync`, `zipWithAsync`, `zipWithAsyncParallel`, `zipWithAsync3`, `allPairs`, `takeWhileAsync`, `takeUntilSignal`, `skipWhileAsync`, `skipWhileInclusiveAsync`, `skipUntilSignal`, `tryTail`, `splitAt`, `toArrayAsync`, `concatSeq`, `interleaveChoice`, `chunkBySize`, `chunkByAsync`, `mergeChoiceEnum`, `distinctUntilChangedWithAsync`, `emitEnumerator`, `removeAt`, `updateAt`, `insertAt`. This eliminates heap-allocated `ref`-cell objects for these variables, reducing GC pressure in hot paths, and modernises the code style to idiomatic F#.
0 commit comments