扁平化 (Flatten)

CocoaPods SPM Compatible License Twitter

扁平化实例方法参考,解决于 SE-0042

let f: (String) -> (String) -> Bool = String.hasPrefix

// function is curried
f("Hello")("He") // => true

let __f: (String, String) -> Bool = flatten(f)

// function is flattend
__f("Hello", "He") // => true

限制

仅支持最多 20 个参数

作者

Yusuke Hosonuma / tobi462@gmail.com / @tobi462

许可

Flatten 使用 MIT 许可证。 更多信息请查看 LICENSE 文件。