<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I don’t believe the implementers who would need to face the complexities in the implementation believe those are compelling examples. It needs to be clear why a <b class="">structural</b> union is necessary rather than an enum. To be clear: structural unions are to enums as tuples are to structs.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 16, 2015, at 9:16 AM, Marc Knaup <<a href="mailto:marc@knaup.koeln" class="">marc@knaup.koeln</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Enumerations are a good example. <br class="">
Or JSON nodes. </p><p dir="ltr" class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151214/002474.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151214/002474.html</a></p>
<div class="gmail_quote">On Dec 16, 2015 16:05, "Matthew Johnson" <<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">// require value to be of type Bool OR Double OR String OR SomeProtocol</div><div class=""><font face="monospace, monospace" class="">let value: (Bool | Double | String | SomeProtocol)</font></div><div class=""><font face="monospace, monospace" class="">switch value {</font></div><font face="monospace, monospace" class=""> case let _ as Bool: …</font><div class=""><font face="monospace, monospace" class=""> case let _ as Double: …<br class=""> case let _ as String: …<br class=""> case let _ as SomeProtocol: …</font></div><div class=""><font face="monospace, monospace" class=""> // no default necessary<br class=""></font><div class=""><font face="monospace, monospace" class="">}</font></div></div></div></div></blockquote><br class=""><div class="">This is a structural union type which has received considerable discussion with commentary from core team members already in the with a subject something like "STL and Either". You may be interested in reading that discussion. The summary is that we are unlikely to see it without extremely compelling use cases.</div></div></blockquote></div>
</div></blockquote></div><br class=""></div></body></html>