We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given an input of type IEnumerable<IEnumerable<T>> its hard to call Interleave on it:
IEnumerable<IEnumerable<T>>
Interleave
Enumerable.Empty<T>.Interleave(input); input.First().Interleave(input.Skip(1));
I propose to add an Interleave overload as a classic static method:
public static IEnumerable<T> Interleave<T>(IEnumerable<IEnumerable<T>> otherSequences); // usage MoreEnumerable.Interleave(input);
Or as an extension method:
public static IEnumerable<T> Interleave<T>(this IEnumerable<IEnumerable<T>> otherSequences); // usage input.Interleave();
We can also add an overload with the SelecMany pattern:
SelecMany
public static IEnumerable<TResult> Interleave<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> selector); // usage new [] {"AAA", "BBB", "CCC"}.Interleave(e => e); // 'A', 'B', 'C', 'A', 'B', 'C', 'A', 'B', 'C'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Given an input of type
IEnumerable<IEnumerable<T>>
its hard to callInterleave
on it:I propose to add an
Interleave
overload as a classic static method:Or as an extension method:
We can also add an overload with the
SelecMany
pattern:The text was updated successfully, but these errors were encountered: