> For the complete documentation index, see [llms.txt](https://docs.midio.com/midio-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.midio.com/midio-docs/guides/map-filter-reduce.md).

# Map, filter, reduce

<figure><img src="/files/IUBmgKHZYpzQTURmx9iH" alt="" width="563"><figcaption></figcaption></figure>

The functions in the [`Iteration`](/midio-docs/built-in-nodes/core-std.md#iteration) module can be used for functional-style transformation of data structures. [`Map`](/midio-docs/built-in-nodes/core-std.md#map-iteration), for example, takes in a list and a function handler, and applies the function to every item in the list, returning a new list of transformed values. This is a convenient way of performing arbitrary transformations on items in lists.

The [`Iteration`](/midio-docs/built-in-nodes/core-std.md#iteration) module contains a set of these functions that operate on lists using handler functions that, when chained together, can be used to perform a variety of transformations.

The most important ones are

* [`Map`](/midio-docs/built-in-nodes/core-std.md#map-iteration) - used to transform each item into new items
* [`Filter`](/midio-docs/built-in-nodes/core-std.md#filter-iteration) - used to filter out items in the list that don't pass some criterion
* [`Reduce`](/midio-docs/built-in-nodes/core-std.md#reduce) - used to reduce a list into a single item, like for example summing up a list of numbers
* [`Find`](/midio-docs/built-in-nodes/core-std.md#find-iteration) - used to find a specific item that matches some criterion

## Anonymous function handlers

One can assign an anonymous function to the handler property by clicking the **f**-icon that appears when hovering the property of certain functions, like the ones in the [`Iteration`](/midio-docs/built-in-nodes/core-std.md#iteration) namespace. Read more about anonymous functions [here](/midio-docs/reference/the-midio-language/functions-and-events/anonymous-functions.md).

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdFpuRAnTVYgmlCXLLou%2Fuploads%2FNhqAA3i4gurftoXX62BC%2FClipboard-20250327-181728-066.mp4?alt=media&token=c04e6b13-11b1-419a-9d85-4bfe105d4f79>" %}
