<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On 12 Jun 2017, at 19:25, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Unfortunately, I think this proposal appears to be mistaken as to this key premise: Void was never (IIUC) meant to model the absence of arguments; it is a type with one possible value.<br class=""><br class="">If I recall, a number of conversations have been raised about Void being a typealias of (), and the definitive response has been that this falls into the ship-has-sailed category of out-of-scope changes.<br class=""><br class="">More generally, the recent spate of complaints about regressions to a particular coding style have to do with loss of implicit tuple splatting, the cure for which is a proper implementation of tuple splatting, not poking holes into settled parts of the type system.</div></div></blockquote><div><br class=""></div><div>But you can’t deny that SE-0110 has also caused regressions in the use of Void as generic argument because Void is modelled as the empty tuple. And tuple splatting will not fix those regressions.</div><div><br class=""></div><div>And contrary to what some people might think, this is not an “edge-case”. Most useful monads modelled with generics have good reasons to use Void:</div><div><br class=""></div><div><b class="">The Result&lt;T&gt; monad:</b> Result&lt;Void&gt; represents the result of an operation with no return value</div><div><b class="">The Promise&lt;T&gt; monad:</b> Promise&lt;Void&gt; represents the result of an asynchronous operation with no return value</div><div><b class="">The Observable&lt;T&gt; monad (in functional reactive programming):</b> Observable&lt;Void&gt; represents a stream of events with no values</div><div><br class=""></div><div>I use all three monads in my code and I’ve had to modify a lot of code when migrating to Swift 4 beta1 because of Void.</div><div><br class=""></div><div>David.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><div class="gmail_quote"><div class="">On Mon, Jun 12, 2017 at 12:15 John McCall via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 12, 2017, at 4:48 AM, Jérémie Girault via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_7884169765734884326m_-2000047954192297274Apple-interchange-newline"><div class=""><div id="m_7884169765734884326m_-2000047954192297274bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px" class="">Hi here,</div><div id="m_7884169765734884326m_-2000047954192297274bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px" class=""><br class=""></div><div id="m_7884169765734884326m_-2000047954192297274bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px" class="">As I tested swift4 in xcode9b1 I noticed a lot of regressions about tuples usage.</div><div id="m_7884169765734884326m_-2000047954192297274bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px" class=""><br class=""></div><div id="m_7884169765734884326m_-2000047954192297274bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px" class="">After documenting myself about the changes which happened, I thought that they could be improved. Instead of fighting these propositions (which make sense), I wanted create a few proposal which would improve these recent changes with a few simple rules.</div><div id="m_7884169765734884326m_-2000047954192297274bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px" class=""><br class=""></div><div id="m_7884169765734884326m_-2000047954192297274bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px" class="">My propositions are based on the recent decisions and in the continuation of SE-0110. The first one is about Void.</div><div id="m_7884169765734884326m_-2000047954192297274bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px" class="">Void is historically defined as the type of the empty tuple. The reason of this is that arguments were initially considered as tuple.</div></div></blockquote><br class=""></div></div><div style="word-wrap:break-word" class=""><div class="">The dominant consideration here was always return types, not parameters.&nbsp; I'm not sure there was ever much point in writing Void in a parameter list, but whatever reasons there were surely vanished with SE-0066.</div><div class=""><br class=""></div><div class="">Note that 'void' in C was originally exclusively a return type.&nbsp; ANSI gave it a new purpose it with void*, but the meaning is totally unrelated.</div></div><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">John.</div></div>_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>