> On Aug 3, 2016, at 4:16 AM, Brent Royal-Gordon via swift-evolution > <[email protected]> wrote: > >> On Aug 3, 2016, at 1:57 AM, Tino Heth <[email protected]> wrote: >> >>> Since RangeExpression is a protocol compatible with any index type, it has >>> to have an associated type >> I haven't read all linked information, but would the situation change with >> generic protocols? >> Thinks like "AnyGenerator" afaics would be superfluous if we had "protocol >> Generator<Type>", and the same might be true for RangeExpression. > > No, this is not an appropriate use case for generic protocols. (Nor is > Generator/IteratorProtocol, for that matter.) > > Generic protocols would be for cases where a single concrete instance can > conform to a protocol using several different types. Genuine use cases for > that do exist, but they're few and far between.
Yes, this feature is called “multi-parameter type classes” in Haskell. Those interested in proposing it in Swift might be interested in looking at how the feature is used in Haskell. > > -- > Brent Royal-Gordon > Architechies > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
