Swiftz 是一个 Swift 库,实现了函数式编程。
示例代码:
let xs = [1, 2, 0, 3, 4]
// we can use the Min semigroup to find the minimal element in xs
sconcat(Min(), 2, xs) // 0
// we can use the Sum monoid to find the sum of xs
mconcat(Sum(i: { return nint8 }), xs) // 10
什么是函数式编程,相信有会有兴趣了解。纯函数有什么好处?什么是柯里化?这里有答案3
Introduction
This is the Simplified Chinese translation of mostly-adequate-guide, thank
Professor Franklin Risby for his great work
关于本书
这本书的主题是函数范式( functional paradigm),我们将使用 Javascr ipt这个世
界上最流行的函数式编程语言来讲