# \[Pitch\] Primary Associated Types in the Standard Library

**URL:** <https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426>\
**Category:** Pitches\
**Tags:** generics, protocols, stdlib\
**Created:** [April 1, 2022, 12:31am UTC](https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426 "2022-04-01T00:31:19Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![lorentey](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lorentey/32/1299_2.png) [@lorentey](https://forums.swift.org/u/lorentey)\
**Post date:** [April 1, 2022, 6:02pm UTC](https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426/10 "2022-04-01T18:02:37Z")

</div>

> [@sjavora](#):
>
> I'd like to echo a concern from @Karl from the review thread - `some Identifiable<Int>` reads like "identifiable int"... which is not what this is.

> [@xwu](#):
>
> This would apply to `Strideable` as well, though, and more broadly to any `*able` (and `*ing` ) protocol (since the "-able" always refers to an ability of `Self` and the primary associated type would never be `Self` ).

I 100% get this, but on the other hand, this is an inherent trade off in this feature -- we don't have labels for things within angle brackets, so it isn't at all obvious what `Int` means in `MyProtocol<Int>` or `MyGenericStruct<Int>`. To understand these, I have to go look at the declaration/documentation of the protocol/struct.

(Incidentally, the first cut of SE-0346 highlighted that we don't have a formal way to add API docs for type parameters of a generic type or generic function.)

If we were to take this objection seriously, then that would effectively mean that SE-0346 will be strictly limited to `Sequence`-style container protocols. Then again, I'm sure even `Collection<Int>` will confuse somebody: is it providing a collection interface to access individual bits in an integer?

My impression from reading the [Core Team's verdict](https://forums.swift.org/t/se-0346-second-review-lightweight-same-type-requirements-for-primary-associated-types/56414) is that this is intended to be a general-purpose alternative to the classic generic declaration syntax, not some niche feature that is dedicated to sequences.

---

_[View the full topic](https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426)._
