---
title: "Flattening"
canonical: "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Coproducts/flat.html"
source: "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Coproducts/flat.md"
part: "Sets, Sequences, and Mappings"
chapter: "Coproducts"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Sets, Sequences, and Mappings", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/index-sets-sequences-mappings.md"}
  - {"title": "Coproducts", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Coproducts/index-coproducts.md"}
prev: {"title": "Retrieve", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Coproducts/retrieve.md"}
next: {"title": "Universal Map", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Coproducts/universal.md"}
intrinsics:
  - {"name": "Flat", "signature": "Flat(C): Cop -> Cop"}
---

# Flattening

The function described here enables the ‘concatenation’ of coproducts into a single one.

<a id="function-flat-cop"></a>
## `Flat(C): Cop -> Cop`

Given a coproduct $C$ of structures which may themselves be coproducts, return the coproduct of the base structures, considered in depth-first order.
