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.
Thoughts?
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution