thread function
Apply a function to corresponding elements of lists.
How to write it
thread(call)
- call
- A call whose arguments are lists of the same length. Takes an expression.
Examples
thread(f([1, 2], [3, 4]))In the solver,
Open in the solverthread(f([1, 2], [3, 4]))gives[f(1, 3), f(2, 4)].
Related functions
- map_thread
Apply a function to corresponding elements of several lists.
- total
Sum of the elements of a list.
- tally
How often each element occurs: a list of element and count pairs.
- union
The elements in any of some lists, each once, in order.
- take
The first elements of a list.
- accumulate
Running totals of a list.