[Pitch] Have all adapters in the standard library uniformly expose their `base`

At least for wrapper types that narrow/filter their base collection, adding a base property would feel like an abstraction violation to me. (A pragmatic one, but still -- I would not like to make it easy for a function that takes, say, a LazyFilterSequence to just call base and completely escape the abstraction behind my back.)

(I've been particularly annoyed at base properties on concrete slice types such as Substring.base and ArraySlice.base recently. I've seen little to no legitimate use cases for these so far, outside of the slice/collection implementations themselves.)

Clearly, this doesn't really apply to EnumeratedSequence itself. But even for that, instead of encouraging folks to add retroactive conditional conformances that would be all but guaranteed to become a liability later, I'd much prefer if we either trimmed back & revived SE-0312 (which ran into some trouble further down the collection hierarchy), or if we rather recommended/normalized building one's own custom type that is tailored to their specific needs.

7 Likes