& - chain
一个实验性的项目,使用类似 Monad 的方法创建方法链 API。
用法
let result: String = ""&.map { Int($0) }.do { print($0 as Any) }.value
let value: String = ""&.filter { !$0.isEmpty }.ifEmpty("b").value
let view: UIView = UIView()&.do {
$0.backgroundColor = .white
}.value