map_thread function
Apply a function to corresponding elements of several lists.
How to write it
map_thread(f, lists)
- f
- The function to apply. Takes a function.
- lists
- A list of lists of the same length. Takes a list.
Examples
map_thread(plus, [[1, 2], [3, 4]])In the solver,
Open in the solvermap_thread(plus, [[1, 2], [3, 4]])gives[4, 6].
Related functions
- map
Apply a function to every element of a list.
- thread
Apply a function to corresponding elements of lists.
- most
A list without its last element.
- nest
Apply a function again and again to a value.
- list
A list of the arguments.
- nest_list
The steps of nest: the value after each application, starting from the first.