---
title: "Dual iterators in constructors"
canonical: "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/IntroductionToAggregates/dual-iterators.html"
source: "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/IntroductionToAggregates/dual-iterators.md"
part: "Sets, Sequences, and Mappings"
chapter: "Introduction to Aggregates"
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": "Introduction to Aggregates", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/IntroductionToAggregates/index-introduction-to-aggregates.md"}
prev: {"title": "Restrictions on Sets and Sequences", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/IntroductionToAggregates/restriction.md"}
next: {"title": "Nested Aggregates", "source": "https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/IntroductionToAggregates/nesting.md"}
---

# Dual iterators in constructors

Most aggregate types support various constructors (as described in their specific sections), some of which use the syntax `x in S` to iterate over the elements of a structure $S$ during the construction. If this structure $S$ supports dual iteration, then the syntax `i -> x in S` is also allowed in such situations (and consequently both $i$ and $x$ may be used in the associated expressions). The meanings assigned to $i$ and $x$ during dual iteration will be explained in the sections for those types which support it.
