<div dir="ltr">I have a question regarding the general term "compact" vs something more specific like "remove nil" : <div>Could we imagine other usages on different types for "compact" ?</div><div><br></div><div>map / flatmap has the whole category theory behind it, making it meaningful for many different types. "Filter" is also generic, because the operation of filtering has a wide range of application. </div><div><br></div><div>"Compact", like Tino suggested, would have the general meaning of "reducing the size by removing similar elements". Removing nils doesn't seem to be a special case of this general definition. </div><div><br></div><div>If we give "compact" the strict definition of "removing nil", then i don't understand the need for a general term, instead of something like "dropNils" (not much longer to write).</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 21, 2017 at 10:47 AM, Tino Heth via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My favorite would be a variation of Scalas choice (collect / collectResults).<br>
The word compact (or similar choices like condense, squeeze, pack, compress…) always remind me on compression — my first association of „compact“ would be a transform that turns [1, 2, 2, 3] into [1, 2, 3] (like the shell tool uniq).<br>
But there’s a long list of verbs with similar meaning, so if there’s a consensus for compact (or compacted…), I join that camp.<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
</div></div></blockquote></div><br></div>