Add piping operator in Optional type
The concept of functional Lenses in Swift.
Functional Lens - convenient, powerful, and safe concept for data mutation. A good Talk about Lenses in Swift from Brandon Williams highly recommended.
* - lenses composition;*~ - set value;|> - piping.
*
*~
|>
Example of usage:
user = user |> User.idLens *~ newId user = user |> (User.nameLens * Name.firstNameLens) *~ "Joel"
swift-lens is available under the MIT license. See the LICENSE file for more info.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
swift-lens
The concept of functional Lenses in Swift.
Functional Lens - convenient, powerful, and safe concept for data mutation. A good Talk about Lenses in Swift from Brandon Williams highly recommended.
Operators:
*- lenses composition;*~- set value;|>- piping.Example of usage:
SPM Install
Contributing
License
swift-lens is available under the MIT license. See the LICENSE file for more info.