# 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

- $\displaystyle \operatorname{thread}(f(\left[ 1, 2 \right], \left[ 3, 4 \right])) = \left[ f(1, 3), f(2, 4) \right]$

  `thread(f([1, 2], [3, 4]))`

  In the solver, `thread(f([1, 2], [3, 4]))` gives `[f(1, 3), f(2, 4)]`.

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

## Related functions

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

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

  Sum of the elements of a list.
- [tally](https://hilberon.com/library/tally)

  How often each element occurs: a list of element and count pairs.
- [union](https://hilberon.com/library/union)

  The elements in any of some lists, each once, in order.
- [take](https://hilberon.com/library/take)

  The first elements of a list.
- [accumulate](https://hilberon.com/library/accumulate)

  Running totals of a list.

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