# \[SE-0011\] Re-considering the replacement keyword for "typealias"

**URL:** <https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669>\
**Category:** Discussion\
**Created:** [December 19, 2015, 5:46pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669 "2015-12-19T17:46:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loic\_Lecrenier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/loic_lecrenier/32/5650_2.png) [@Loic\_Lecrenier](https://forums.swift.org/u/Loic_Lecrenier)\
**Post date:** [December 19, 2015, 5:46pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/1 "2015-12-19T17:46:31Z")

</div>

Hi,

I’m starting a new thread for this proposal [swift-evolution/0011-replace-typealias-associated.md at master · apple/swift-evolution · GitHub](https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md)

So far, everybody agreed that using distinct keywords for type alias and associated type declarations is a good idea.  
However, some people think that “associated” is not an ideal replacement because it is too vague.  
I would like to choose a better keyword before the review, but I’m struggling to find a good replacement.

So, here are some keywords that were proposed by the community.

1. associated\_type  
This is the original proposed keyword. It is extremely clear, but snake\_cases are un-Swifty.

2. associatedtype (or typeassociation)  
This was the first alternative to associated\_type. Its purpose is still extremely clear.  
I like it a lot, but it is a bit long and difficult to read.

3. associated  
This is the keyword I chose for the proposal because it was the most well-received initially.  
It is quite short, very different from “typealias", and sounds good. However, it is also vaguer.  
Because the word “type” is not in it, it’s unclear what should follow it, and it’s unclear what it declares.  
For example, one could think that it is an associated \*value\* and write  
protocol FixedSizeCollectionProtocol {  
&nbsp;&nbsp;associated size : Int  
}  
Although honestly I doubt many people would write that.

4. withtype (or needstype)  
It is short, somewhat easy to read, has the word “type” in it, and some concept of association thanks to “with”. I like it.  
But it doesn’t sound very good, and is still vaguer than “associatedtype”.

5. type  
This keyword was proposed by several people, but I strongly dislike it.  
It conflicts with an other proposal about unifying the “static” and “class” keywords for type-level members.  
I think the fact that it was proposed for two completely different purposes shows that it is too abstract.  
It would make searching for help more difficult because of its bad googleability.

Personally, I would like to either keep “associated”, or use “associatedtype” because they are the most obvious choices.

1) Do you agree about using “associatedtype”?  
2) If not, which keyword would you prefer to use? why? (you can introduce a new one)  
Bonus) Maybe some twitter-famous person could make a quick poll and see which one developers prefer? 😁 (after they read this email)  
I would gladly do it myself, but I don’t think my twenty (mostly fake) followers will give me a lot of information.

Loïc

---

<div class="post-metadata">

**Author:** ![Erica\_Sadun](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/erica_sadun/32/243_2.png) [@Erica\_Sadun](https://forums.swift.org/u/Erica_Sadun)\
**Post date:** [December 20, 2015, 1:21am UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/2 "2015-12-20T01:21:57Z")

</div>

> Maybe [some person] could make a quick poll and see which one developers prefer? 😁 (after they read this email)

Ask. Receive.

[https://www.surveymonkey.com/r/S8F59XF](https://www.surveymonkey.com/r/S8F59XF)

---

<div class="post-metadata">

**Author:** ![Tino](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tino/32/1073_2.png) [@Tino](https://forums.swift.org/u/Tino)\
**Post date:** [December 19, 2015, 6:07pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/3 "2015-12-19T18:07:03Z")

</div>

> snake\_cases are un-Swifty

amen.

My first thought for a name was "placeholder", and I just saw that this was used in the description of the concept as well… so maybe this would be an option?

Tino

---

<div class="post-metadata">

**Author:** ![Janosch\_Hildebrand](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@Janosch\_Hildebrand](https://forums.swift.org/u/Janosch_Hildebrand)\
**Post date:** [December 19, 2015, 6:09pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/4 "2015-12-19T18:09:09Z")

</div>

> 1) Do you agree about using “associatedtype”?

I would be fine with either "associatedtype", "typeassociation" or "associated" but "associatedtype" is my favorite.

> 2) If not, which keyword would you prefer to use? why? (you can introduce a new one)

Not sure if that has been proposed before but "assoctype" might be another option that still includes the word "type" but is a bit shorter.  
But personally I'd prefer "associatedtype" since it's clearer and it's not a keyword that is used often enough for the shortening to be worth it.

- Janosch

> **···**
>
> > On 19 Dec 2015, at 18:46, Loïc Lecrenier via swift-evolution \<swift-evolution@swift.org\> wrote:

---

<div class="post-metadata">

**Author:** ![Tino](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tino/32/1073_2.png) [@Tino](https://forums.swift.org/u/Tino)\
**Post date:** [December 19, 2015, 10:52pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/5 "2015-12-19T22:52:04Z")

</div>

Another spontaneous idea (not sure weather I actually like it — take it as brainstorming):  
Variable deklarations have the form  
thatIsTheName: ThatIsWhatIAm  
so the ambiguity could be resolved by  
ElementType: typealias  
which would say "ElementType is a associated type", like  
let i: Int  
says "i is an integer"

---

<div class="post-metadata">

**Author:** ![Andrey\_Tarantsov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/andrey_tarantsov/32/9434_2.png) [@Andrey\_Tarantsov](https://forums.swift.org/u/Andrey_Tarantsov)\
**Post date:** [December 20, 2015, 11:21am UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/6 "2015-12-20T11:21:13Z")

</div>

Aren't we bikeshedding here? These are all good names; I think we can pick one, and leave the final choice to the core team.

My personal preference is for something like “associated type X” or “associated typealias X” — no need for an underscore when you can require a space. Right now “typealias” is probably the word to use, although if Swift later introduces “type”, that would be a better choice. And I see “associated” as a context-specific modifier anyway; could even be spelled “@associated” (I'm still unclear about the rules about @/no-@).

A.

---

<div class="post-metadata">

**Author:** ![pierremb](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/pierremb/32/2020_2.png) [@pierremb](https://forums.swift.org/u/pierremb)\
**Post date:** [December 23, 2015, 12:50pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/7 "2015-12-23T12:50:50Z")

</div>

+1 for `type`, it is consistent with `func`, `var` and `init`. It looks good to me.

eg:

protocol Stream {  
&nbsp;&nbsp;&nbsp;&nbsp;type Payload  
&nbsp;&nbsp;&nbsp;&nbsp;var ready: Bool { get }  
&nbsp;&nbsp;&nbsp;&nbsp;func read() -\> Payload?  
}

protocol Collection {  
&nbsp;&nbsp;&nbsp;&nbsp;type Element  
&nbsp;&nbsp;&nbsp;&nbsp;var count: Int { get }  
&nbsp;&nbsp;&nbsp;&nbsp;func contains(element: Element) -\> Bool  
}

> **···**
>
> --  
> Pierre
> 
> > Le 19 déc. 2015 à 18:46, Loïc Lecrenier via swift-evolution \<swift-evolution@swift.org\> a écrit :
> > 
> > Hi,
> > 
> > I’m starting a new thread for this proposal [https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md](https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md)
> > 
> > So far, everybody agreed that using distinct keywords for type alias and associated type declarations is a good idea.  
> > However, some people think that “associated” is not an ideal replacement because it is too vague.  
> > I would like to choose a better keyword before the review, but I’m struggling to find a good replacement.
> > 
> > So, here are some keywords that were proposed by the community.
> > 
> > 1. associated\_type  
> > This is the original proposed keyword. It is extremely clear, but snake\_cases are un-Swifty.
> > 
> > 2. associatedtype (or typeassociation)  
> > This was the first alternative to associated\_type. Its purpose is still extremely clear.  
> > I like it a lot, but it is a bit long and difficult to read.
> > 
> > 3. associated  
> > This is the keyword I chose for the proposal because it was the most well-received initially.  
> > It is quite short, very different from “typealias", and sounds good. However, it is also vaguer.  
> > Because the word “type” is not in it, it’s unclear what should follow it, and it’s unclear what it declares.  
> > For example, one could think that it is an associated \*value\* and write  
> > protocol FixedSizeCollectionProtocol {  
> > &nbsp;&nbsp;associated size : Int  
> > }  
> > Although honestly I doubt many people would write that.
> > 
> > 4. withtype (or needstype)  
> > It is short, somewhat easy to read, has the word “type” in it, and some concept of association thanks to “with”. I like it.  
> > But it doesn’t sound very good, and is still vaguer than “associatedtype”.
> > 
> > 5. type  
> > This keyword was proposed by several people, but I strongly dislike it.  
> > It conflicts with an other proposal about unifying the “static” and “class” keywords for type-level members.  
> > I think the fact that it was proposed for two completely different purposes shows that it is too abstract.  
> > It would make searching for help more difficult because of its bad googleability.
> > 
> > Personally, I would like to either keep “associated”, or use “associatedtype” because they are the most obvious choices.
> > 
> > 1) Do you agree about using “associatedtype”?  
> > 2) If not, which keyword would you prefer to use? why? (you can introduce a new one)  
> > Bonus) Maybe some twitter-famous person could make a quick poll and see which one developers prefer? 😁 (after they read this email)  
> > I would gladly do it myself, but I don’t think my twenty (mostly fake) followers will give me a lot of information.
> > 
> > Loïc
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![michelf](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michelf/32/1180_2.png) [@michelf](https://forums.swift.org/u/michelf)\
**Post date:** [December 23, 2015, 9:53pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/8 "2015-12-23T21:53:42Z")

</div>

inferredtype

> **···**
>
> --  
> Michel Fortin  
> [https://michelf.ca](https://michelf.ca)

---

<div class="post-metadata">

**Author:** ![Andrew\_Hoos](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/andrew_hoos/32/905_2.png) [@Andrew\_Hoos](https://forums.swift.org/u/Andrew_Hoos)\
**Post date:** [December 20, 2015, 9:06am UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/9 "2015-12-20T09:06:23Z")

</div>

I second placeholder as the most rational keyword. Every description of the distinct usage of type alias refers to is a placeholder type. placeholder is one word(circumventingCase\_issues) and is more descriptive of what it is than associated\*. Seems like an easy win. Is there a some reason I am missing why \*type\* or associated\* are better keyword fits?

Andrew Hoos

> **···**
>
> > On Dec 19, 2015, at 10:07, Tino Heth via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > > snake\_cases are un-Swifty
> > 
> > amen.
> > 
> > My first thought for a name was "placeholder", and I just saw that this was used in the description of the concept as well… so maybe this would be an option?
> > 
> > Tino  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![Loic\_Lecrenier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/loic_lecrenier/32/5650_2.png) [@Loic\_Lecrenier](https://forums.swift.org/u/Loic_Lecrenier)\
**Post date:** [December 20, 2015, 10:54am UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/10 "2015-12-20T10:54:19Z")

</div>

-1  
I understand the idea. But we would still need a replacement for “typealias” because “Element: typealias” says “Element is a type alias” and not “Element is an associated type”.  
Also, it would be difficult to add inheritance clauses and default values.  
“Element is an associated type that conforms to SequenceType, and is an Array of Int by default”  
is currently  
typealias Element : SequenceType = Array\<Int\>  
but I don’t see how it could be written with your proposed syntax.

- Loïc

> **···**
>
> > On Dec 19, 2015, at 11:52 PM, Tino Heth \<2th@gmx.de\> wrote:
> > 
> > Another spontaneous idea (not sure weather I actually like it — take it as brainstorming):  
> > Variable deklarations have the form  
> > thatIsTheName: ThatIsWhatIAm  
> > so the ambiguity could be resolved by  
> > ElementType: typealias  
> > which would say "ElementType is a associated type", like  
> > let i: Int  
> > says "i is an integer"

---

<div class="post-metadata">

**Author:** ![Loic\_Lecrenier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/loic_lecrenier/32/5650_2.png) [@Loic\_Lecrenier](https://forums.swift.org/u/Loic_Lecrenier)\
**Post date:** [December 20, 2015, 11:47am UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/11 "2015-12-20T11:47:00Z")

</div>

> Aren't we bikeshedding here? These are all good names; I think we can pick one, and leave the final choice to the core team.

Yes, we are :(  
I was reluctant to start this thread, but I think it’s worse if the core team has this debate during the review.  
I promise I’ll choose a keyword before the end of the week (and it will most likely be requiredtype)

Loïc

> **···**
>
> > My personal preference is for something like “associated type X” or “associated typealias X” — no need for an underscore when you can require a space. Right now “typealias” is probably the word to use, although if Swift later introduces “type”, that would be a better choice. And I see “associated” as a context-specific modifier anyway; could even be spelled “@associated” (I'm still unclear about the rules about @/no-@).
> > 
> > A.

---

<div class="post-metadata">

**Author:** ![James\_Campbell](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@James\_Campbell](https://forums.swift.org/u/James_Campbell)\
**Post date:** [December 23, 2015, 12:59pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/12 "2015-12-23T12:59:35Z")

</div>

I think we should use "placeholder" it more accurately describes what it  
does. For a bigger change then I would propose my protocol generics idea.

> **···**
>
> On Wed, Dec 23, 2015 at 12:50 PM, Pierre Monod-Broca via swift-evolution \< swift-evolution@swift.org\> wrote:
> 
> > +1 for `type`, it is consistent with `func`, `var` and `init`. It looks  
> > good to me.
> > 
> > eg:
> > 
> > protocol Stream {  
> > &nbsp;&nbsp;&nbsp;&nbsp;type Payload  
> > &nbsp;&nbsp;&nbsp;&nbsp;var ready: Bool { get }  
> > &nbsp;&nbsp;&nbsp;&nbsp;func read() -\> Payload?  
> > }
> > 
> > protocol Collection {  
> > &nbsp;&nbsp;&nbsp;&nbsp;type Element  
> > &nbsp;&nbsp;&nbsp;&nbsp;var count: Int { get }  
> > &nbsp;&nbsp;&nbsp;&nbsp;func contains(element: Element) -\> Bool  
> > }
> > 
> > --  
> > Pierre
> > 
> > Le 19 déc. 2015 à 18:46, Loïc Lecrenier via swift-evolution \< \> swift-evolution@swift.org\> a écrit :
> > 
> > Hi,
> > 
> > I’m starting a new thread for this proposal  
> > [https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md](https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md)
> > 
> > So far, everybody agreed that using distinct keywords for type alias and  
> > associated type declarations is a good idea.  
> > However, some people think that “associated” is not an ideal replacement  
> > because it is too vague.  
> > I would like to choose a better keyword before the review, but I’m  
> > struggling to find a good replacement.
> > 
> > So, here are some keywords that were proposed by the community.
> > 
> > 1. associated\_type  
> > This is the original proposed keyword. It is extremely clear, but  
> > snake\_cases are un-Swifty.
> > 
> > 2. associatedtype (or typeassociation)  
> > This was the first alternative to associated\_type. Its purpose is still  
> > extremely clear.  
> > I like it a lot, but it is a bit long and difficult to read.
> > 
> > 3. associated  
> > This is the keyword I chose for the proposal because it was the most  
> > well-received initially.  
> > It is quite short, very different from “typealias", and sounds good.  
> > However, it is also vaguer.  
> > Because the word “type” is not in it, it’s unclear what should follow it,  
> > and it’s unclear what it declares.  
> > For example, one could think that it is an associated \*value\* and write  
> > protocol FixedSizeCollectionProtocol {  
> > associated size : Int  
> > }  
> > Although honestly I doubt many people would write that.
> > 
> > 4. withtype (or needstype)  
> > It is short, somewhat easy to read, has the word “type” in it, and some  
> > concept of association thanks to “with”. I like it.  
> > But it doesn’t sound very good, and is still vaguer than “associatedtype”.
> > 
> > 5. type  
> > This keyword was proposed by several people, but I strongly dislike it.  
> > It conflicts with an other proposal about unifying the “static” and  
> > “class” keywords for type-level members.  
> > I think the fact that it was proposed for two completely different  
> > purposes shows that it is too abstract.  
> > It would make searching for help more difficult because of its bad  
> > googleability.
> > 
> > Personally, I would like to either keep “associated”, or use  
> > “associatedtype” because they are the most obvious choices.
> > 
> > 1) Do you agree about using “associatedtype”?  
> > 2) If not, which keyword would you prefer to use? why? (you can introduce  
> > a new one)  
> > Bonus) Maybe some twitter-famous person could make a quick poll and see  
> > which one developers prefer? 😁 (after they read this email)  
> > I would gladly do it myself, but I don’t think my twenty (mostly fake)  
> > followers will give me a lot of information.
> > 
> > Loïc
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> 
> --  
>  Wizard  
> james@supmenow.com  
> +44 7523 279 698

---

<div class="post-metadata">

**Author:** ![pierremb](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/pierremb/32/2020_2.png) [@pierremb](https://forums.swift.org/u/pierremb)\
**Post date:** [December 23, 2015, 1:05pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/13 "2015-12-23T13:05:46Z")

</div>

I would agree to stop talking about associated types and start talking about placeholder types instead.  
But as a keyword, IMO the problem is that `placeholder` is not appropriate to define the implementation.

eg  
class Foo: Stream {  
&nbsp;&nbsp;&nbsp;&nbsp;placeholder Payload = String // IMO doesn't feel right  
&nbsp;&nbsp;&nbsp;&nbsp;type Payload = String // IMO feels good  
}

> **···**
>
> --  
> Pierre
> 
> > Le 23 déc. 2015 à 13:59, James Campbell \<james@supmenow.com\> a écrit :
> > 
> > I think we should use "placeholder" it more accurately describes what it does. For a bigger change then I would propose my protocol generics idea.
> > 
> > On Wed, Dec 23, 2015 at 12:50 PM, Pierre Monod-Broca via swift-evolution \<swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>\> wrote:  
> > +1 for `type`, it is consistent with `func`, `var` and `init`. It looks good to me.
> > 
> > eg:
> > 
> > protocol Stream {  
> > &nbsp;&nbsp;&nbsp;&nbsp;type Payload  
> > &nbsp;&nbsp;&nbsp;&nbsp;var ready: Bool { get }  
> > &nbsp;&nbsp;&nbsp;&nbsp;func read() -\> Payload?  
> > }
> > 
> > protocol Collection {  
> > &nbsp;&nbsp;&nbsp;&nbsp;type Element  
> > &nbsp;&nbsp;&nbsp;&nbsp;var count: Int { get }  
> > &nbsp;&nbsp;&nbsp;&nbsp;func contains(element: Element) -\> Bool  
> > }
> > 
> > --  
> > Pierre
> > 
> > > Le 19 déc. 2015 à 18:46, Loïc Lecrenier via swift-evolution \<swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>\> a écrit :
> > > 
> > > Hi,
> > > 
> > > I’m starting a new thread for this proposal [https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md](https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md)
> > > 
> > > So far, everybody agreed that using distinct keywords for type alias and associated type declarations is a good idea.  
> > > However, some people think that “associated” is not an ideal replacement because it is too vague.  
> > > I would like to choose a better keyword before the review, but I’m struggling to find a good replacement.
> > > 
> > > So, here are some keywords that were proposed by the community.
> > > 
> > > 1. associated\_type  
> > > This is the original proposed keyword. It is extremely clear, but snake\_cases are un-Swifty.
> > > 
> > > 2. associatedtype (or typeassociation)  
> > > This was the first alternative to associated\_type. Its purpose is still extremely clear.  
> > > I like it a lot, but it is a bit long and difficult to read.
> > > 
> > > 3. associated  
> > > This is the keyword I chose for the proposal because it was the most well-received initially.  
> > > It is quite short, very different from “typealias", and sounds good. However, it is also vaguer.  
> > > Because the word “type” is not in it, it’s unclear what should follow it, and it’s unclear what it declares.  
> > > For example, one could think that it is an associated \*value\* and write  
> > > protocol FixedSizeCollectionProtocol {  
> > > &nbsp;&nbsp;associated size : Int  
> > > }  
> > > Although honestly I doubt many people would write that.
> > > 
> > > 4. withtype (or needstype)  
> > > It is short, somewhat easy to read, has the word “type” in it, and some concept of association thanks to “with”. I like it.  
> > > But it doesn’t sound very good, and is still vaguer than “associatedtype”.
> > > 
> > > 5. type  
> > > This keyword was proposed by several people, but I strongly dislike it.  
> > > It conflicts with an other proposal about unifying the “static” and “class” keywords for type-level members.  
> > > I think the fact that it was proposed for two completely different purposes shows that it is too abstract.  
> > > It would make searching for help more difficult because of its bad googleability.
> > > 
> > > Personally, I would like to either keep “associated”, or use “associatedtype” because they are the most obvious choices.
> > > 
> > > 1) Do you agree about using “associatedtype”?  
> > > 2) If not, which keyword would you prefer to use? why? (you can introduce a new one)  
> > > Bonus) Maybe some twitter-famous person could make a quick poll and see which one developers prefer? 😁 (after they read this email)  
> > > I would gladly do it myself, but I don’t think my twenty (mostly fake) followers will give me a lot of information.
> > > 
> > > Loïc
> > > 
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > swift-evolution mailing list  
> > > swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>  
> > > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > 
> > --  
> >  Wizard  
> > james@supmenow.com \<mailto:james@supmenow.com\>  
> > +44 7523 279 698

---

<div class="post-metadata">

**Author:** ![Douglas\_Gregor](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/douglas_gregor/32/1362_2.png) [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Post date:** [December 23, 2015, 10:30pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/14 "2015-12-23T22:30:07Z")

</div>

It’s not always inferred, though.

&nbsp;&nbsp;- Doug

> **···**
>
> > On Dec 23, 2015, at 1:53 PM, Michel Fortin via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > inferredtype

---

<div class="post-metadata">

**Author:** ![mwhiteside.dev](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mwhiteside.dev](https://forums.swift.org/u/mwhiteside.dev)\
**Post date:** [December 23, 2015, 10:51pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/15 "2015-12-23T22:51:24Z")

</div>

Just want to put 2 other ideas out there for completeness:

`relatedtype`

`componenttype`

> **···**
>
> > On Dec 23, 2015, at 14:30, Douglas Gregor via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > > On Dec 23, 2015, at 1:53 PM, Michel Fortin via swift-evolution \<swift-evolution@swift.org\> wrote:
> > > 
> > > inferredtype
> > 
> > It’s not always inferred, though.
> > 
> > &nbsp;&nbsp;- Doug
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![dabrahams](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dabrahams/32/9815_2.png) [@dabrahams](https://forums.swift.org/u/dabrahams)\
**Post date:** [December 23, 2015, 11:08pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/16 "2015-12-23T23:08:42Z")

</div>

> Just want to put 2 other ideas out there for completeness:
> 
> `relatedtype`
> 
> `componenttype`

My 2c: if we’re tack something onto “type”, the only appropriate modifier is “associated.” “Associated type” isn’t a term we invented; it’s the correct accepted technical term for the role these declarations play in generic programming.

> > > inferredtype
> > 
> > It’s not always inferred, though.
> > 
> > &nbsp;&nbsp;- Doug
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> swift-evolution mailing list  
> swift-evolution@swift.org  
> [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

-Dave

> **···**
>
> > On Dec 23, 2015, at 2:51 PM, Matt Whiteside via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > > On Dec 23, 2015, at 14:30, Douglas Gregor via swift-evolution \<swift-evolution@swift.org\> wrote:
> > > 
> > > > On Dec 23, 2015, at 1:53 PM, Michel Fortin via swift-evolution \<swift-evolution@swift.org\> wrote:

---

<div class="post-metadata">

**Author:** ![Douglas\_Gregor](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/douglas_gregor/32/1362_2.png) [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Post date:** [December 23, 2015, 11:09pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/17 "2015-12-23T23:09:30Z")

</div>

Agreed.

&nbsp;&nbsp;- Doug

> **···**
>
> > On Dec 23, 2015, at 3:08 PM, Dave Abrahams \<dabrahams@apple.com\> wrote:
> > 
> > > On Dec 23, 2015, at 2:51 PM, Matt Whiteside via swift-evolution \<swift-evolution@swift.org\> wrote:
> > > 
> > > Just want to put 2 other ideas out there for completeness:
> > > 
> > > `relatedtype`
> > > 
> > > `componenttype`
> > 
> > My 2c: if we’re tack something onto “type”, the only appropriate modifier is “associated.” “Associated type” isn’t a term we invented; it’s the correct accepted technical term for the role these declarations play in generic programming.

---

<div class="post-metadata">

**Author:** ![Brent\_Royal-Gordon](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@Brent\_Royal-Gordon](https://forums.swift.org/u/Brent_Royal-Gordon)\
**Post date:** [December 20, 2015, 9:18am UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/18 "2015-12-20T09:18:21Z")

</div>

> Is there a some reason I am missing why \*type\* or associated\* are better keyword fits?

The main reason to use `associated` is because the feature is called an "associated type". If we're willing to rename the feature to "placeholder type", then `placeholder` would be a good keyword.

> **···**
>
> --  
> Brent Royal-Gordon  
> Architechies

---

<div class="post-metadata">

**Author:** ![Loic\_Lecrenier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/loic_lecrenier/32/5650_2.png) [@Loic\_Lecrenier](https://forums.swift.org/u/Loic_Lecrenier)\
**Post date:** [December 20, 2015, 11:08am UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/19 "2015-12-20T11:08:26Z")

</div>

I like placeholder too.  
However, it also suffers from the lack of “type” in it.

So, the real comparison is between:  
placeholder — associated  
placholdertype — associatedtype

> **···**
>
> > On Dec 20, 2015, at 10:06 AM, Andrew Hoos \<andrewjhoos@gmail.com\> wrote:
> > 
> > I second placeholder as the most rational keyword. Every description of the distinct usage of type alias refers to is a placeholder type. placeholder is one word(circumventingCase\_issues) and is more descriptive of what it is than associated\*. Seems like an easy win. Is there a some reason I am missing why \*type\* or associated\* are better keyword fits?
> > 
> > Andrew Hoos
> > 
> > > On Dec 19, 2015, at 10:07, Tino Heth via swift-evolution \<swift-evolution@swift.org\> wrote:
> > > 
> > > > snake\_cases are un-Swifty
> > > 
> > > amen.
> > > 
> > > My first thought for a name was "placeholder", and I just saw that this was used in the description of the concept as well… so maybe this would be an option?
> > > 
> > > Tino  
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > swift-evolution mailing list  
> > > swift-evolution@swift.org  
> > > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

<div class="post-metadata">

**Author:** ![Craig\_Cruden](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@Craig\_Cruden](https://forums.swift.org/u/Craig_Cruden)\
**Post date:** [December 23, 2015, 1:15pm UTC](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669/20 "2015-12-23T13:15:12Z")

</div>

I prefer “type”.

> **···**
>
> > On 2015-12-23, at 20:05:46, Pierre Monod-Broca via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > I would agree to stop talking about associated types and start talking about placeholder types instead.  
> > But as a keyword, IMO the problem is that `placeholder` is not appropriate to define the implementation.
> > 
> > eg  
> > class Foo: Stream {  
> > &nbsp;&nbsp;&nbsp;&nbsp;placeholder Payload = String // IMO doesn't feel right  
> > &nbsp;&nbsp;&nbsp;&nbsp;type Payload = String // IMO feels good  
> > }
> > 
> > --  
> > Pierre
> > 
> > > Le 23 déc. 2015 à 13:59, James Campbell \<james@supmenow.com \<mailto:james@supmenow.com\>\> a écrit :
> > > 
> > > I think we should use "placeholder" it more accurately describes what it does. For a bigger change then I would propose my protocol generics idea.
> > > 
> > > On Wed, Dec 23, 2015 at 12:50 PM, Pierre Monod-Broca via swift-evolution \<swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>\> wrote:  
> > > +1 for `type`, it is consistent with `func`, `var` and `init`. It looks good to me.
> > > 
> > > eg:
> > > 
> > > protocol Stream {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;type Payload  
> > > &nbsp;&nbsp;&nbsp;&nbsp;var ready: Bool { get }  
> > > &nbsp;&nbsp;&nbsp;&nbsp;func read() -\> Payload?  
> > > }
> > > 
> > > protocol Collection {  
> > > &nbsp;&nbsp;&nbsp;&nbsp;type Element  
> > > &nbsp;&nbsp;&nbsp;&nbsp;var count: Int { get }  
> > > &nbsp;&nbsp;&nbsp;&nbsp;func contains(element: Element) -\> Bool  
> > > }
> > > 
> > > --  
> > > Pierre
> > > 
> > > > Le 19 déc. 2015 à 18:46, Loïc Lecrenier via swift-evolution \<swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>\> a écrit :
> > > > 
> > > > Hi,
> > > > 
> > > > I’m starting a new thread for this proposal [https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md](https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md)
> > > > 
> > > > So far, everybody agreed that using distinct keywords for type alias and associated type declarations is a good idea.  
> > > > However, some people think that “associated” is not an ideal replacement because it is too vague.  
> > > > I would like to choose a better keyword before the review, but I’m struggling to find a good replacement.
> > > > 
> > > > So, here are some keywords that were proposed by the community.
> > > > 
> > > > 1. associated\_type  
> > > > This is the original proposed keyword. It is extremely clear, but snake\_cases are un-Swifty.
> > > > 
> > > > 2. associatedtype (or typeassociation)  
> > > > This was the first alternative to associated\_type. Its purpose is still extremely clear.  
> > > > I like it a lot, but it is a bit long and difficult to read.
> > > > 
> > > > 3. associated  
> > > > This is the keyword I chose for the proposal because it was the most well-received initially.  
> > > > It is quite short, very different from “typealias", and sounds good. However, it is also vaguer.  
> > > > Because the word “type” is not in it, it’s unclear what should follow it, and it’s unclear what it declares.  
> > > > For example, one could think that it is an associated \*value\* and write  
> > > > protocol FixedSizeCollectionProtocol {  
> > > > &nbsp;&nbsp;associated size : Int  
> > > > }  
> > > > Although honestly I doubt many people would write that.
> > > > 
> > > > 4. withtype (or needstype)  
> > > > It is short, somewhat easy to read, has the word “type” in it, and some concept of association thanks to “with”. I like it.  
> > > > But it doesn’t sound very good, and is still vaguer than “associatedtype”.
> > > > 
> > > > 5. type  
> > > > This keyword was proposed by several people, but I strongly dislike it.  
> > > > It conflicts with an other proposal about unifying the “static” and “class” keywords for type-level members.  
> > > > I think the fact that it was proposed for two completely different purposes shows that it is too abstract.  
> > > > It would make searching for help more difficult because of its bad googleability.
> > > > 
> > > > Personally, I would like to either keep “associated”, or use “associatedtype” because they are the most obvious choices.
> > > > 
> > > > 1) Do you agree about using “associatedtype”?  
> > > > 2) If not, which keyword would you prefer to use? why? (you can introduce a new one)  
> > > > Bonus) Maybe some twitter-famous person could make a quick poll and see which one developers prefer? 😁 (after they read this email)  
> > > > I would gladly do it myself, but I don’t think my twenty (mostly fake) followers will give me a lot of information.
> > > > 
> > > > Loïc
> > > > 
> > > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > > swift-evolution mailing list  
> > > > swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>  
> > > > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > > 
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > swift-evolution mailing list  
> > > swift-evolution@swift.org \<mailto:swift-evolution@swift.org\>  
> > > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)
> > > 
> > > --  
> > >  Wizard  
> > > james@supmenow.com \<mailto:james@supmenow.com\>  
> > > +44 7523 279 698
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

[Next page](https://forums.swift.org/t/se-0011-re-considering-the-replacement-keyword-for-typealias/669.md?page=2)
