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

Mike Kluev mike.kluev at gmail.com
Wed Nov 22 16:59:54 CST 2017

on Date: Tue, 21 Nov 2017 22:54:21 -0800 Douglas Gregor <dgregor at apple.com>

> On Nov 21, 2017, at 10:48 PM, David Hart <david at hartbit.com> wrote:
> >
> > On 22 Nov 2017, at 07:41, Douglas Gregor via swift-evolution <
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> >
> >>
> >> I think it’s straightforward and less ugly to make structural types
> allow extensions and protocol conformances.
> >
> > Can somebody explain to me what is less ugly about that? I would have
> naturally thought that the language would be simpler as a whole if there
> only existed nominal types and all structural types were just sugar over
> them.
> See Thorsten’s response with, e.g.,
>               Function<Double, InoutParam<String>, Param<Int>>
> which handles “inout” by adding wrappers around the parameter types (which
> one would have to cope with in any user of Function), but still doesn’t
> handle argument labels. To handle argument labels, we would need something
> like strings as generic arguments. We’d also need to handle calling
> conventions and anything else we invent for function types.
can you outline how extensions and protocol conformances might look
for structural types? to compare the ugliness of both approaches.

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

More information about the swift-evolution mailing list