Add a zip operator
hnOsmium0001 opened this issue · 3 comments
Issue type:
- ➕ Feature request
Short description:
Add a zip function that works like the one from Python, which takes several lists and combines them to a list of lists containing elements from the same index.
For example zip([1,2,3,4],[20,19,18,17])
returns [[1,20],[2,19],[3,18],[4,17]]
I don't like the implied type signature of this operator. I'd rather see one of two alternatives:
transpose([[1,2,3,4],[20,19,18,17]])
returns[[1,20],[2,19],[3,18],[4,17]]
zip([1,2,3,4],[20,19,18,17])
returns[(1,20),(2,19),(3,18),(4,17)]
(requires that we add tuple types)
... requires that we add tuple types
I don't personally think that it is worth adding tuple types just for the sake of the type signature. If we have more than just this reason, great, but it seems overkill just for a fixed-length list