# 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>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.midio.com/midio-docs/guides/map-filter-reduce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
