<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 16, 2017, at 2:52 AM, Gwendal Roué via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div class=""><br class=""><blockquote type="cite" class="">The optional itself will stand for the boolean needed by the filtering operation.<br class=""></blockquote><br class="">What I meant here is that "filterMap" can only click in a developer's mind if the the developer uses Optional as a Bool. When the closure returns nil, that nil stands for false in the filtering operation. When the closure returns a `some`, that some stands for true in the filtering operation.<br class=""><br class="">Put in another way: to properly explain "filterMap" to someone who already knows "filter", then you have to explain that optionals are used as booleans.<br class=""></div></div></blockquote></div><br class=""><div class="">I disagree that you have to view Optionals as Booleans to understand <font face="Menlo" class="">filterMap</font> as proposed. Optionals naturally represent the idea of either a value, or nothing. The <font face="Menlo" class="">filterMap</font> operation runs a map that can filter stuff out. If you filter something out, you end up with “nothing”, which is exactly what returning <font face="Menlo" class="">nil</font> means. So when I use <font face="Menlo" class="">filterMap</font>, I map all the things I want to let through, and I filter the rest out by letting <i class="">nothing</i> through.</div><div class=""><br class=""></div><div class="">-BJ</div></body></html>