[swift-evolution] [Pitch] Unify joined(separator:) and flatten()

Ben Rimmington me at benrimmington.com
Fri Jul 22 10:35:00 CDT 2016

> On 22 Jul 2016, at 02:46, Jacob Bandes-Storch wrote:
> In the swift-lang Slack channel, a few of us were discussing joined(separator:) and realized that flatten() does almost exactly the same thing.
> Is there interest in renaming flatten() to joined()?  Since joined takes a separator that's any Sequence, we can't have a default value for the separator parameter, but we can have a variant of joined() with no arguments.

I'd like default separators for the joined() methods.


But renaming flatten() to joined() seems complicated.


And what would happen to the flatMap() methods? Is flatten() a term of art?


-- Ben

More information about the swift-evolution mailing list