<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Now that currying syntax is about to be removed, I changed one of my libraries. It uses currying a lot (I don’t use it all the time, but for this library, it really helps). However, I seem to have hit a limitation, and I’m not sure if it’s intended or not. Without built-in currying syntax, it looks like we cannot use noescape and/or rethrows anymore. Would people be interested in adding this back in?<div class=""><br class=""></div><div class="">For a very simple example, consider creating a curried variant of flatMap:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> curriedFlatMap<A, B>(x: [<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">A</span>]) -> (<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">@noescape</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">A</span> -> [<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">B</span>]) -> [<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">B</span>] {</div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span> { f <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">in</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""> x.<span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">flatMap</span>(f)</div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div><div class="">or one that works with throws/rethrows:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> curriedFlatMap<A, B>(x: [<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">A</span>]) -> (<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">A</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">throws</span> -> [<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">B</span>]) <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">rethrows</span> -> [<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">B</span>] {</div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span> { f <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">in</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">try</span> x.<span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">flatMap</span>(f)</div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div><div class="">I’m not sure how to make this concept work again when using currying. I’m also not sure if it is a big deal. I would personally love to have this functionality back. Seems like it’s mostly a type-system limitation?</div><div class=""><br class=""></div><div class="">Chris</div></body></html>