-
Notifications
You must be signed in to change notification settings - Fork 145
[Design] chunkBy #25
Copy link
Copy link
Closed
Description
This is an adhoc location for a recorded discussion of adding "chunkBy" to Seq/Array/List modules in F# 4.0 - See
- the fslang.uservoice discussion at https://fslang.uservoice.com/forums/245727-f-language/suggestions/6402339-add-chunkby-and-countgroupsby-functions-to-seq
- the overall proposed collection library normalization and additions at https://github.com/fsharp/FSharpLangDesign/blob/master/CoreLibraryFunctions.md
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels