|
|
|
|
|
by ruricolist
1529 days ago
|
|
There is a fair amount of academic work on bidirectional tree transformation with lenses, e.g. <https://www.cs.cornell.edu/~jnfoster/papers/lenses.pdf>. It breaks down to proving three operations (Get, Put, Create) that observe three laws (called GetPut, PutGet, and CreateGet); these give you bidirectional transformations you can compose arbitrarily. Later work introduces concepts like "quotienting" (for when you actually want the transformation to be lossy in certain ways) or "discerning" (non-total) lenses. |
|