flatMap(_:)
Returns the concatenated results of mapping the given transformation over this sequence.
Declaration
func flatMap<SegmentOfResult>(_ transform: @escaping (Self.Elements.Element) -> SegmentOfResult) -> LazySequence<FlattenSequence<LazyMapSequence<Self.Elements, SegmentOfResult>>> where SegmentOfResult : SequenceDiscussion
Use this method to receive a single-level sequence when your transformation produces a sequence or collection for each element. Calling flatMap(_:) on a sequence s is equivalent to calling s.map(transform).joined().