-
Notifications
You must be signed in to change notification settings - Fork 99
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
add @array.zip and @array.zip_with #1575
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 5446Details
💛 - Coveralls |
c82b1f9
to
01aafb4
Compare
I have an API design concern, with Array zip, what about FixedArray? What about other linearly traversable structures? This leads to the discussion that Iter::zip, but our Iter can't do zip... cc @bobzhang |
It seems |
related issue. |
There is a zip function in /// Zip two lists.
/// If the lists have different lengths, it will return None.
pub fn zip[A, B](self : T[A], other : T[B]) -> T[(A, B)]? It's a method that returns an option. To make the API more consistent, consider changing the API like this: // in immut/list
pub fn zip[A, B](self : T[A], other : T[B]) -> T[(A, B)]
// in array
pub fn zip[A, B](self : T[A], other : T[B]) -> T[(A, B)]
pub fn zip_with[A, B, C](self : T[A], other : T[B], merge~ : (A,B)->C) -> T[C] |
bb37517
to
3c82d74
Compare
3c82d74
to
eb98c89
Compare
So that the zip for FixedArray is a todo issue? |
No description provided.