-
Notifications
You must be signed in to change notification settings - Fork 9
Add TaskSeq.concat
overloads for seq, list, array, resizearray
#237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,14 +215,55 @@ type TaskSeq = | |
|
||
/// <summary> | ||
/// Combines the given task sequence of task sequences and concatenates them end-to-end, to form a | ||
/// new flattened, single task sequence. Each task sequence is awaited item by item, before the next is iterated. | ||
/// new flattened, single task sequence, like <paramref name="TaskSeq.collect id"/>. Each task sequence is | ||
/// awaited and consumed in full, before the next one is iterated. | ||
/// </summary> | ||
/// | ||
/// <param name="sources">The input task-sequence-of-task-sequences.</param> | ||
/// <returns>The resulting task sequence.</returns> | ||
/// <returns>The resulting, flattened task sequence.</returns> | ||
/// <exception cref="T:ArgumentNullException">Thrown when the input task sequence of task sequences is null.</exception> | ||
static member concat: sources: TaskSeq<#TaskSeq<'T>> -> TaskSeq<'T> | ||
|
||
/// <summary> | ||
/// Combines the given task sequence of sequences and concatenates them end-to-end, to form a | ||
/// new flattened, single task sequence. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also these are Combinators, so I guess they do Combine in that technical sense (which we all know is the best sense!) Everything is always "new" for all TaskSeq operators (hence my campaign for a keyword like yield conveying the fact that stuff comes in, has treatments applied, and flows out, remaining lazy) I'm not sure 'new' is a useful word; if there is a 'Combines' in the description, then there is something new happening. Hence mq quest for a workd like 'renders' or 'yields' to convey that while we are combining things, there is not really anything 'new' except in the sense that any function that does not return its input results in a 'new' value. Again, just musing... |
||
/// </summary> | ||
/// | ||
/// <param name="sources">The input task sequence of sequences.</param> | ||
/// <returns>The resulting, flattened task sequence.</returns> | ||
/// <exception cref="T:ArgumentNullException">Thrown when the input task sequence of task sequences is null.</exception> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess Seq doesnt either but I'd like to see mention of NRE happening if there is a But kudos for having the test in the first instance so it's all good I guess |
||
static member concat: sources: TaskSeq<'T seq> -> TaskSeq<'T> | ||
|
||
/// <summary> | ||
/// Combines the given task sequence of arrays and concatenates them end-to-end, to form a | ||
/// new flattened, single task sequence. | ||
/// </summary> | ||
/// | ||
/// <param name="sources">The input task sequence of arrays.</param> | ||
/// <returns>The resulting, flattened task sequence.</returns> | ||
/// <exception cref="T:ArgumentNullException">Thrown when the input task sequence of task sequences is null.</exception> | ||
static member concat: sources: TaskSeq<'T[]> -> TaskSeq<'T> | ||
|
||
/// <summary> | ||
/// Combines the given task sequence of lists and concatenates them end-to-end, to form a | ||
/// new flattened, single task sequence. | ||
/// </summary> | ||
/// | ||
/// <param name="sources">The input task sequence of lists.</param> | ||
/// <returns>The resulting, flattened task sequence.</returns> | ||
/// <exception cref="T:ArgumentNullException">Thrown when the input task sequence of task sequences is null.</exception> | ||
static member concat: sources: TaskSeq<'T list> -> TaskSeq<'T> | ||
|
||
/// <summary> | ||
/// Combines the given task sequence of resizable arrays and concatenates them end-to-end, to form a | ||
/// new flattened, single task sequence. | ||
/// </summary> | ||
/// | ||
/// <param name="sources">The input task sequence of resizable arrays.</param> | ||
/// <returns>The resulting, flattened task sequence.</returns> | ||
/// <exception cref="T:ArgumentNullException">Thrown when the input task sequence of task sequences is null.</exception> | ||
static member concat: sources: TaskSeq<ResizeArray<'T>> -> TaskSeq<'T> | ||
|
||
/// <summary> | ||
/// Concatenates task sequences <paramref name="source1" /> and <paramref name="source2" /> in order as a single | ||
/// task sequence. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the given task sequence of task sequences" feels like a mouthful, and Combines does not really help (Flattens would be a great one word TL;DR intro to my mind if I didnt know what concat did)
If I was writing something random from scratch:
Yields a task sequence that unrolls each task sequence emanating from the source, concatenating them end to end,