[swift-evolution] Fwd: [Review] SE-0006 Apply API Guidelines to the Standard Library

Maximilian Hünenberger m.huenenberger at me.com
Sat Jan 30 08:37:00 CST 2016


I'd like to distinguish between concrete types and more abstract ones like protocols. A suffix like "Type" is best what I can think of (now).
> 
There is at least one thread which discusses the use of protocols with associated types as (abstract) generic types.

Pseudo syntax:
let collection: CollectionType<Element == Int> = [1, 3]

So a differentiation between concrete and abstract types is preferable in my opinion.
This could also be a language feature rather than a convention.

- Maximilian

> 
> Am 30.01.2016 um 10:53 schrieb Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org>:
> 
>>> I still don’t see why we need a suffix at all, what is unclear about the CollectionType protocol simply being called Collection instead?
>> 
>> They're attractive nuisances. Someone wants an integer type, sees Integer, tries to use it, and suddenly they're getting weird errors about Self and associated object requirements. Or they want a boolean variable, see Boolean, and suddenly their one-bit value is wrapped in a 40-byte protocol witness. Nobody is going to mistake Integerlike or Booleanlike for a concrete type and use it accidentally.
>> 
>> -- 
>> Brent Royal-Gordon
>> Architechies
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list