<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/FlattenSequence",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s15FlattenSequenceV"
  },
  "title" : "FlattenSequence"
}
-->

# FlattenSequence

A sequence consisting of all the elements contained in each segment
contained in some `Base` sequence.

```
@frozen struct FlattenSequence<Base> where Base : Sequence, Base.Element : Sequence
```

## Overview

The elements of this view are a concatenation of the elements of
each sequence in the base.

The `joined` method is always lazy, but does not implicitly
confer laziness on algorithms applied to its result.  In other
words, for ordinary sequences `s`:

- `s.joined()` does not create new storage
- `s.joined().map(f)` maps eagerly and returns a new array
- `s.lazy.joined().map(f)` maps lazily and returns a `LazyMapSequence`

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)