TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Dollar and Cent – A functional tool belt for Swift

55 点作者 agp2572将近 11 年前

6 条评论

GuiA将近 11 年前
<i>first Returns the first element in the array and terminated the chain</i><p><i>second Returns the second element in the array and terminated the chain</i><p><i>third Returns the third element in the array and terminated the chain</i><p><i>fourth Returns the fourth element in the array and terminated the chain</i><p><i>fifth Returns the fifth element in the array and terminated the chain</i><p><i>sixth Returns the sixth element in the array and terminated the chain</i><p><i>seventh Returns the seventh element in the array and terminated the chain</i><p><i>eighth Returns the eighth element in the array and terminated the chain</i><p><i>ninth Returns the ninth element in the array and terminated the chain</i><p><i>tenth Returns the tenth element in the array and terminated the chain</i><p>... is this a joke?
评论 #7969076 未加载
评论 #7967852 未加载
评论 #7968500 未加载
评论 #7968279 未加载
评论 #7968542 未加载
agp2572将近 11 年前
Dollar is a Swift library that provides useful functional programming helper methods without extending any built in objects. It is similar to Lo-Dash or Underscore in Javascript.<p>Cent is a library that extends certain Swift object types using the extension feature like ActiceSupport in ruby and gives its two cents to Swift language.
randomguy7788将近 11 年前
its unfortunate that it repeats the same mistakes that underscore and lodash does (imo) and makes it very hard to do composition (data comes in first instead of the predicate&#x2F;function)
评论 #7967700 未加载
lsdafjklsd将近 11 年前
Not so much functional as just useful methods for working with arrays &#x2F; maps. It would be functional to include a compose method... also currying is going to be painful because of how the arguments are structured (data first).
vilya将近 11 年前
I don&#x27;t understand why every result is stored into the same class-level variable. What&#x27;s the aim behind that? It just seems like it would introduce unexpected behaviour without any gain, but I don&#x27;t really know swift yet so maybe there&#x27;s something I&#x27;m missing?
评论 #7968040 未加载
MrGando将近 11 年前
Hate this stuff, Swift != Javascript.
评论 #7967689 未加载
评论 #7968885 未加载
评论 #7969620 未加载