[swift-evolution] Synthesizing Equatable, Hashable, and Comparable for tuple types

Chris Lattner clattner at nondot.org
Wed Nov 22 00:37:27 CST 2017


On Nov 21, 2017, at 9:25 PM, Douglas Gregor <dgregor at apple.com> wrote:
>> Or alternatively, one could decide to make the generics system *only and forever* work on nominal types, and make the syntactic sugar just be sugar for named types like Swift.Tuple, Function, and Optional.  Either design could work.
> 
> We don’t have a way to make it work for function types, though, because of parameter-passing conventions. Well, assuming we don’t invent something that allows:
> 
> 	Function<Double, inout String>
> 
> to exist in the type system. Tuple labels have a similar problem.

I’m totally aware of that and mentioned it upthread.  There are various encoding tricks that could make this work depending on how you want to stretch the current generics system…

-Chris


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171121/b00beae9/attachment.html>


More information about the swift-evolution mailing list