Idea: Optics types, combining pattern types and view types
Rust Internals
Idea: Optics types, combining pattern types and view types
Here is a naive idea inspired by the optics (lens and prisms) in bidirectional transformation. Given the view types like lens that provides partial view and update for product types, and pattern types like prisms that provides partial view and update for sum types, the idea is to combine them together: the optics type that provides partial view and update for both product types and sum types. Here is the syntax sketch. struct Foo { x: i32, y: Bar, } enum Bar { A, B(i32), C...
0 comments
No comments yet.