---
title: FlattenSequence
framework: swift
role: symbol
role_heading: Structure
path: swift/flattensequence
---

# FlattenSequence

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

## Declaration

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

## Overview

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

## Topics

### Instance Methods

- [formIndex(_:offsetBy:)](swift/flattensequence/formindex(_:offsetby:).md)
- [formIndex(_:offsetBy:limitedBy:)](swift/flattensequence/formindex(_:offsetby:limitedby:).md)

### Default Implementations

- [BidirectionalCollection Implementations](swift/flattensequence/bidirectionalcollection-implementations.md)
- [Collection Implementations](swift/flattensequence/collection-implementations.md)
- [Sequence Implementations](swift/flattensequence/sequence-implementations.md)

## Relationships

### Conforms To

- [BidirectionalCollection](swift/bidirectionalcollection.md)
- [Collection](swift/collection.md)
- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Sequence](swift/sequence.md)

## See Also

### Wrappers for Algorithms

- [CollectionDifference](swift/collectiondifference.md)
- [DropFirstSequence](swift/dropfirstsequence.md)
- [DropWhileSequence](swift/dropwhilesequence.md)
- [EnumeratedSequence](swift/enumeratedsequence.md)
- [FlattenCollection](swift/flattencollection.md)
- [JoinedSequence](swift/joinedsequence.md)
- [PrefixSequence](swift/prefixsequence.md)
- [Repeated](swift/repeated.md)
- [ReversedCollection](swift/reversedcollection.md)
- [StrideTo](swift/strideto.md)
- [StrideThrough](swift/stridethrough.md)
- [UnfoldSequence](swift/unfoldsequence.md)
- [Zip2Sequence](swift/zip2sequence.md)
