Conversation
- TaskSeq.groupBy / groupByAsync: groups elements by key, returns Task<('Key * 'T[])[]>
- TaskSeq.countBy / countByAsync: counts per key, returns Task<('Key * int)[]>
- TaskSeq.partition / partitionAsync: splits into two arrays by predicate, returns Task<'T[] * 'T[]>
- Adds ProjectorAction struct DU for sync/async projection
- 195 tests covering empty, immutable, and side-effect variants
- ref #289
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
11 tasks
dsyme
approved these changes
Mar 8, 2026
…026-03-7606207c355db1fa
…026-03-7606207c355db1fa
…026-03-7606207c355db1fa
github-actions bot
added a commit
that referenced
this pull request
Mar 8, 2026
Mark as implemented (✅) following the wave of PRs merged for v0.6.0: - TaskSeq.average, averageBy, averageByAsync (#304) - TaskSeq.sum, sumBy, sumByAsync (#304) - TaskSeq.distinct, distinctBy, distinctByAsync, distinctUntilChanged (#305) - TaskSeq.mapFold, mapFoldAsync (#306) - TaskSeq.groupBy, groupByAsync (#307) - TaskSeq.countBy, countByAsync — add missing table row (#307) - TaskSeq.partition, partitionAsync — add missing table row (#307) Also: - Fix typo 'dictinctBy' → 'distinctBy' - Update 'Status & planning' checklist to reflect completed work - Add PR link definitions (#304–#307) at the bottom Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds six new combinators to
TaskSeq, completing a common set of aggregation and splitting operations that mirrorList,Array, andSeqequivalents:TaskSeq.groupByTask<('Key * 'T[])[]>TaskSeq.groupByAsyncTask<('Key * 'T[])[]>TaskSeq.countByTask<('Key * int)[]>TaskSeq.countByAsyncTask<('Key * int)[]>TaskSeq.partitionTask<'T[] * 'T[]>TaskSeq.partitionAsyncTask<'T[] * 'T[]>Design notes
groupBy/countByreturnTask<...>(notTaskSeq<...>) because they must consume the entire sequence before forming groups — the same reasonList.groupByreturns a list rather than a lazy sequence.Seq.groupBy/Seq.countBybehaviour.HashIdentity.Structuralfor structural equality, consistent withexcept/distinctBy.[(Struct)] ProjectorActionDU was added alongside the existingFolderAction,PredicateAction, etc. to share one internal implementation for sync/async projections.partitionreuses the existingPredicateActionDU.Examples
Files changed
src/FSharp.Control.TaskSeq/TaskSeqInternal.fs—ProjectorActionDU +groupBy,countBy,partitionimplementationssrc/FSharp.Control.TaskSeq/TaskSeq.fs— 6 new static memberssrc/FSharp.Control.TaskSeq/TaskSeq.fsi— full XML doc signatures withwhen 'Key: equalityconstraintssrc/FSharp.Control.TaskSeq.Test/TaskSeq.GroupBy.Tests.fs— 195 tests (null checks, empty, immutable, side-effect variants for all 6 functions)src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj— adds new test filerelease-notes.txt— updated for 0.5.0Test Status
✅ Build succeeded — 0 warnings, 0 errors
✅ All 4045 existing tests pass (release configuration)
✅ 195 new GroupBy/CountBy/Partition tests pass
✅ Formatting clean (
dotnet fantomas . --checkpasses)ref #289