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 // we can delay computations with fu