[swift-evolution] Tuples as RawRepresentable

Haravikk swift-evolution at haravikk.me
Fri Oct 14 05:55:22 CDT 2016


> On 14 Oct 2016, at 09:49, David Sweeris <davesweeris at mac.com> wrote:
> 
> I'm very much in favor of the functionality, but I don't think the implementation should rely on compiler magic.
> 
> - Dave Sweeris 

Well it's not too much in the way of magic really, more just that we need Swift to see tuples as conforming to RawRepresentable and ExpressableAsTuple, although they currently aren't types in the normal sense. So the protocols being used will be the same as you might use yourself, they'll just be applied automatically for tuples.

It'd be neat if it could be done properly, but that could involve even more work, but doing this automatically for now should be fairly simple (though I say that as a person who wouldn't be the one doing it ;)


More information about the swift-evolution mailing list