Midio docs
  • Getting Started
    • Welcome
    • Quick Start Guide
  • Your First Midio App
  • Guides
    • HTTP
      • Making HTTP Requests
      • Responding to HTTP Requests
      • How to reach your own endpoints
      • CORS
      • Server-Sent Events (SSE)
    • Branching
    • Loops
    • Map, filter, reduce
    • Working with Data
    • Expressions
    • Building Agents
      • Streaming Agent API (experimental)
    • Debugging
    • Secrets and Environment variables
    • Convert JSON to data nodes
    • Writing tests
    • Cleaning up your flows
  • Package Manager
  • Integrating with third party services
  • Troubleshooting
  • Tutorials
    • Connecting LLMs to MCP-servers using the MCP-client package
    • Making Your Own MCP Server in Midio
    • A Fast Path to Functional RAG Agents
    • How to build a streaming agent using Server-Sent Events (SSE)
  • Reference
    • The Midio Editor
      • The Node Editor
      • User Traces
      • Traces (execution)
      • Processes
      • Log
      • Services
      • Problems
      • Function Signature
      • Data
      • Settings
    • The Midio Language
      • Nodes and execution
      • Functions and Events
        • Anonymous functions
      • Modules
      • Contexts
      • Data type
      • Local variables
      • Portals
      • Waypoint node
      • Partial function application
  • The Midio Engine
  • Built in Nodes
    • Core (std)
    • HTTP
    • LLM
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Guides

Map, filter, reduce

PreviousLoopsNextWorking with Data

Last updated 2 months ago

Was this helpful?

The functions in the module can be used for functional-style transformation of data structures. , 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 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

Anonymous function handlers

- used to transform each item into new items

- used to filter out items in the list that don't pass some criterion

- used to reduce a list into a single item, like for example summing up a list of numbers

- used to find a specific item that matches some criterion

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 namespace. Read more about anonymous functions .

here
Iteration
Map
Iteration
Map
Filter
Reduce
Find
Iteration