> 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/reference/the-midio-language/modules.md).

# Modules

Modules in Midio serve as an organizational tool for structuring your code, separating different parts of the program into distinct and manageable units.

A module can contain other modules, function definitions, and type definitions, allowing for a hierarchical organization of your program. In addition to these structural elements, modules can also contain flows.

Modules can also have instances of events, which is not possible inside functions.
