joined(by:)

Returns the concatenation of the elements in this sequence of sequences, inserting the separator produced by the closure between each sequence.

Joined.swift:384
func joined(by separator: (Element, Element) throws -> Element.Element) rethrows -> [Element.Element]
for x in [[1, 2], [3, 4], [5, 6]].joined(by: { $0.last! * $1.first! }) {
    print(x)
}
// 1, 2, 6, 3, 4, 20, 5, 6