Skip to content

Align set of supported functions with latest FSharp.Control.AsyncSeq #289

Closed

Description

@dsyme

FSharp.Control.AsyncSeq has added a lot of supported functions (here methods) which should also be supported here if possible

Repo Assist: Do this in multiple independent PRs bit by bit rather than all at once, and don't label PRs as "fixing" this issue until it's really all completed.

Activity

  1. github-actions commented on Mar 7, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    Here's a progress update on aligning FSharp.Control.TaskSeq with the latest FSharp.Control.AsyncSeq API.

    What's already been done (open PRs)

    Function PR Notes
    TaskSeq.pairwise #293 (open) seq<'T * 'T> — pairs of adjacent elements
    TaskSeq.scan / TaskSeq.scanAsync #296 (open) Fold that emits each intermediate accumulator state

    Good next candidates

    These are pure streaming operations — no buffering needed — making them a natural fit:

    • unfold — ('State -> ('T * 'State) option) -> 'State -> TaskSeq<'T> and unfoldAsync variant. Dual of fold; generates a sequence from a seed state. AsyncSeq: AsyncSeq.unfold.

    • windowed — int -> TaskSeq<'T> -> TaskSeq<'T[]>. Sliding window of size n; emits overlapping sub-arrays. AsyncSeq: AsyncSeq.windowed.

    • reduce / reduceAsync — ('T -> 'T -> 'T) -> TaskSeq<'T> -> Task<'T>. Fold without an initial state; raises on empty sequence. Analogous to Seq.reduce.

    • sumBy / averageBy / sumByAsync / averageByAsync — numeric aggregations. Currently missing; useful alongside maxBy/minBy.

    Functions that would need full materialization

    The following AsyncSeq functions require consuming the entire sequence into memory, which is a larger design decision:

    • sortBy / sort — requires materializing to sort
    • groupBy / countBy — requires materializing to group/count

    These are worth discussing separately, as they change the memory profile of the library. For now the functions above (streaming) are likely the right priority.

    I'll continue adding these incrementally per @dsyme's guidance — one concern per PR.

    Generated by Repo Assist · ◷

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@ec7d342403c9912c87320110f8822a8fbb817a0c
    
  2. added 3 commits that reference this issue on Mar 7, 2026
  3. added a commit that references this issue on Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions