# 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

- $\displaystyle \operatorname{map\_thread}\left(\operatorname{plus}, \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\right) = \left[ 4, 6 \right]$

  `map_thread(plus, [[1, 2], [3, 4]])`

  In the solver, `map_thread(plus, [[1, 2], [3, 4]])` gives `[4, 6]`.

  [Open in the solver](https://hilberon.com/?q=map_thread%28plus%2C%20%5B%5B1%2C%202%5D%2C%20%5B3%2C%204%5D%5D%29)

## Related functions

- [map](https://hilberon.com/library/map)

  Apply a function to every element of a list.
- [thread](https://hilberon.com/library/thread)

  Apply a function to corresponding elements of lists.
- [most](https://hilberon.com/library/most)

  A list without its last element.
- [nest](https://hilberon.com/library/nest)

  Apply a function again and again to a value.
- [list](https://hilberon.com/library/list)

  A list of the arguments.
- [nest_list](https://hilberon.com/library/nest_list)

  The steps of nest: the value after each application, starting from the first.

---
Source: https://hilberon.com/library/map_thread
