ListFunctions3(A, B, C)ΒΆ
list.spad line 335 [edit on github]
ListFunctions3 implements utility functions that operate on three kinds of lists, each with a possibly different type of element.
- map: ((A, B) -> C, List A, List B) -> List C
map(fn, u1, u2)
applies the binary functionfn
to corresponding elements of listsu1
andu2
and returns a list of the results (in the same order). Thusmap(/, [1, 2, 3], [4, 5, 6]) = [1/4, 2/5, 1/2]
. The computation terminates when the end of either list is reached. That is, the length of the result list is equal to the minimum of the lengths ofu1
andu2
.