[swift-evolution] [Idea] NonEmptyArray
charlie at charliemonroe.net
Tue Jan 17 03:40:32 CST 2017
I've come across multiple cases, where you simply know the array is never empty and hence the optionality on first, last and behavior of a few other members is slightly different. Also, there are cases where you want to declare that you shouldn't pass an empty array e.g. into an initializer.
I was wondering whether Swift could have a specialized NonEmptyArray that could be used throughout the stdlib - e.g. String.components(separatedBy:) would return NonEmptyArray.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution