# Are primary associated types supposed to be transitive?

**URL:** <https://forums.swift.org/t/are-primary-associated-types-supposed-to-be-transitive/72985>\
**Category:** Using Swift\
**Tags:** associatedtype, sequence, lazysequence\
**Created:** [July 6, 2024, 5:19pm UTC](https://forums.swift.org/t/are-primary-associated-types-supposed-to-be-transitive/72985 "2024-07-06T17:19:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![xwu](https://avatars.discourse-cdn.com/v4/letter/x/b487fb/32.png) [@xwu](https://forums.swift.org/u/xwu)\
**Post date:** [July 6, 2024, 6:33pm UTC](https://forums.swift.org/t/are-primary-associated-types-supposed-to-be-transitive/72985/3 "2024-07-06T18:33:39Z")

</div>

> [@CTMacUser](#):
>
> Unless someone can supply a reason why it's actually #3.

It's actually #3, because there was doubt about the right primary associated type, which would notably _not_ have been `Element`.

> [@\[Pitch\] Primary Associated Types in the Standard Library](https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426/26):
>
> > [@\[Pitch\] Primary Associated Types in the Standard Library](https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426/1):
> >
> > `LazySequenceProtocol` and `LazyCollectionProtocol` use `Elements` as their primary associated type, not `Element` . The idea here is that if we spell out `LazyCollectionProtocol` , we probably want to also say something about the wrapped collection, not just its element type -- for example, by constraining it to random access collections using `some LazyCollectionProtocol<some RandomAccessCollection<String>>` .
> 
> Personally, I'd rather we not add any primary associated types to `LazySequenceProtocol` and `LazyCollectionProtocol`. They aren't likely to be used often, and it feels odd to have them be based on `Elements` rather than `Element` like the other sequence/collection protocols. We could always add them later if compelling use cases show up in sufficient quantity.

> [@\[Pitch\] Primary Associated Types in the Standard Library](https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426/43):
>
> The document no longer proposes primary associated types for `LazySequenceProtocol` and `LazyCollectionProtocol`. I still think `Elements` is the right choice for these, but this is mostly based on speculation rather than actual use cases. I would like to add these back, but I'd love to see some actual example cases to confirm/reject this choice.

---

_[View the full topic](https://forums.swift.org/t/are-primary-associated-types-supposed-to-be-transitive/72985)._
