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.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
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.