Skip to content

[Design] chunkBy #25

@dsyme

Description

@dsyme

This is an adhoc location for a recorded discussion of adding "chunkBy" to Seq/Array/List modules in F# 4.0 - See

Signatures:

Seq.chunkBy : ('T -> 'Key) -> seq<'T> -> seq<seq<'Key * 'T>>
List.chunkBy : ('T -> 'Key) -> 'T list -> ('Key * 'T list) list
Array.chunkBy : ('T -> 'Key) -> 'T[] -> ('Key * 'T[]) []

where elements are repeatedly collected into one chunk until the key changes, left to right. This has been a commonly requested function.

An implementation would of course be needed, with performance checks.

Please use this thread to discuss, e.g.

  • comment on proposed name
  • would we need "countChunksBy"?
  • send links to equivalent functions in other data programming libraries

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions