<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=""><blockquote type="cite" class=""><div dir="auto" class=""><div class=""><div class=""><div class=""><span class="" style="font-family: 'Helvetica Neue';">- Higher Kinded Types (Monads, Functors, etc.)</span></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I don’t think HKT would really work completely as a separate library since some of the functions which are implemented already in the standard library should be identified with a common protocol (i.e. Optional monad and collections monads). Which would act as a foundation for “for-comprehension” implementations (for yield) which in the end translate into map/flatMap/filter [on demand].</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 2016-01-27, at 6:32:45, Tino Heth via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""><span class=""></span></div><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div class=""><span class=""></span></div><div class="">There have been several threads to add specific functions or types to the stdlib:<div class="">- <span style="font-family: 'Helvetica Neue';" class="">Either in the Swift Standard Library</span></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">- </span><span style="font-family: 'Helvetica Neue';" class="">Proposal: Add scan, takeWhile, dropWhile, and iterate to the stdlib</span></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">- Higher Kinded Types (Monads, Functors, etc.)</span></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">- </span><span style="color: rgb(76, 76, 76); font-family: 'Helvetica Neue';" class="">Adding a new filter method which returns 2 arrays</span></div><div class=""><span style="color: rgb(76, 76, 76); font-family: 'Helvetica Neue';" class="">- </span><span style="font-family: 'Helvetica Neue';" class="">Add replace(_:with:) function to the stdlib</span></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">- map-like operation that returns a dictionary</span></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">- </span><span style="font-family: 'Helvetica Neue';" class="">Rectangles and other common structures.</span></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">- </span><span style="font-family: 'Helvetica Neue';" class="">Add zip2WithNilPadding function</span></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">- </span><span style="font-family: 'Helvetica Neue';" class="">Add types BufferedSequence, BufferedGenerator</span></div><div class=""><font face="Helvetica Neue" class="">- … (guess there are some that I missed — I didn't look at last years threads at all).</font></div><div class=""><font face="Helvetica Neue" class=""><br class=""></font></div><div class=""><font face="Helvetica Neue" class="">Afair, none of those ideas turned into real proposals, and I think that keeping stdlib small is a good goal.</font></div><div class=""><font face="Helvetica Neue" class=""><br class=""></font></div><div class=""><font face="Helvetica Neue" class="">Nonetheless, there are plenty of data structures and algorithms that will be used in many places by many different teams, and each of them might write its own implementation. That's imho no big problem for algorithms, but for types, it will most likely lead to real annoyance.</font></div><div class=""><font face="Helvetica Neue" class=""><br class=""></font></div><div class=""><font face="Helvetica Neue" class="">I hope that we will soon have a great package manager for Swift, but I don't think that will solve this issue completely:</font></div></div><div class=""><font face="Helvetica Neue" class="">I wouldn't import a big third-party framework just because a tiny function like "dropWhile" could make my code more elegant...</font></div><div class=""><font face="Helvetica Neue" class=""><br class=""></font></div><div class=""><font face="Helvetica Neue" class="">Of course, some widely accepted libs might rise and improve interoperability, but it is hard to predict how our ecosystem will evolve, and you don't have to wait for the future to see the what could happen when there is no common base</font><font face="Helvetica Neue" class="">:</font></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">Just take a look at SCNQuaternion, GLQuaternion and CMQuaternion.</span></div><div class=""><br class=""></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">Instead of asking to pollute stdlib with stuff like 3d transformations, I'd prefer a set of general purpose libraries under supervision by the Swift team:</span></div><div class=""><span style="font-family: 'Helvetica Neue';" class="">It could be a great way for "outsiders" to get into Swift development, and most likely wouldn't put to much stress and responsibility on the shoulders of each "manager".</span></div><div class=""><font face="Helvetica Neue" class="">It also could take pressure from the stdlib (and this mailinglist :)</font></div><div class=""><font face="Helvetica Neue" class=""><br class=""></font></div><div class=""><font face="Helvetica Neue" class="">Beside fields of application (graphics, images, music, algebra, statistics, pattern matching, machine learning, graph theorie... whatever raises enough interest), there could also be libraries to support concepts like functional programming.</font></div><div class=""><font face="Helvetica Neue" class=""><br class=""></font></div><div class=""><font face="Helvetica Neue" class="">Best regards,</font></div><div class=""><font face="Helvetica Neue" class="">Tino</font></div></div><div class=""><br class=""></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>