[swift-evolution] Variadic generics discussion

Austin Zheng austinzheng at gmail.com
Tue May 31 15:39:07 CDT 2016


(inline)

On Tue, May 31, 2016 at 1:34 PM, Matthew Johnson <matthew at anandabits.com>
wrote:

>
> On May 31, 2016, at 3:25 PM, Austin Zheng <austinzheng at gmail.com> wrote:
>
> I have a proposal for #6 in the pipe, but there are actually some
> subtleties I have to work out (it's not as simple as just slapping a
> generic type signature on a let constant).
>
>
> Cool.  Looking forward to reviewing a draft when it’s ready.
>
>
> I think #5 is just considered a 'bug' and doesn't need a proposal (it
> might actually be finished already; I saw some commits recently); same with
> #4. #7 is not very useful without variadic generics (it pretty much exists
> to allow tuples to conform to protocols, and tuples are inherently
> variadic).
>
>
> Good to know 4 and 5 are considered bugs.  I know #4 is important for the
> standard library so I suppose that will ensure it is a priority soon enough.
>
> I included #7 because it would still be nice to have for a number of
> reasons.  Maybe there is a way to pull it off for a handful of types that
> are known to the compiler.
>
> I wanted to take a stab at #2.
>
>
> Are you still thinking about this one or did you decide not to pursue it?
>

I think I'd like to try writing something up.


>
> The core team has talked so much about #1 that I'd be surprised if they
> don't already have an idea as to how they want to do it, plus it's
> complicated for a number of reasons to get right. In such a case having the
> community push forward an alternate proposal would just be giving everyone
> more unneeded work.
>
>
> Agree here as well.  I’ve avoided generics proposals mostly because I
> thought the core team was leading the charge on all them.  It now appears
> like that may not have been the right assumption across the board.  I wish
> we had a bit more visibility on this...
>

Yes, same. I'm going off this bullet point at the beginning of the generics
manifesto:

"I hope to achieve several things: ... Engage more of the community in
discussions of specific generics features, so we can coalesce around
designs for public review. And maybe even get some of them implemented."


>
>
> #3 seems semantically straightforward. AFAIK there's nothing a subscript
> can do that a getter and setter method can't do together, and methods can
> already be generic. A proposal shouldn't be hard to put together.
>
>
> Agree.  Someone just needs to jump in and write it up.  :-)  If it had a
> chance of making it into Swift 3 I would do it right away, but it’s hard to
> tell...
>

I'd be happy to write up a proposal, especially if it's as straightforward
as it seems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160531/d9a9dcc9/attachment-0001.html>


More information about the swift-evolution mailing list