-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/zip fold #137
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
Feature/zip fold #137
Conversation
"Fold" gives the wrong impression that we are folding a binary operation
hctrdev
left a comment
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.
See inline comments
| /// in all the arrays.</returns> | ||
| public static TResult[,] ZipEnum<TVal, TOther, TResult>(this TVal[,] array, Func<TVal, IEnumerable<TOther>, TResult> zipper, IEnumerable<TOther[,]> others) | ||
| { | ||
| int minRows = others.Select(o => o.GetLength(0)).UnionMin(array.GetLength(0).AsSingleton()); |
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.
Would it be possible to do the .Union first and then a Min?
Something like:
others.Select(o => o.GetLength(0)).Union(array.GetLength(0)).Min();
Or even:
others.Union(array).Select(o => o.GetLength(0)).Min();
It might be slightly clearer and more standard. The same applies to the other places that use this format.
Removed Union Min extension function Marked union max as obsolete & specified to use Union followed by Max for this
Description
Added 4
ZipEnummethods on one/zero-based arrays and their 2D equivalents. Added unit tests for all. Also extendedIEnumerablewith some supporting extension methods.TODO