Lens is a function that perform immutable record modification: it copies the record modifying part of its content. Lenses is a library that allows you to combine lenses to attain more complicated modifications.
I'm searching for correct term that defines reverse abstraction. Some function that compares two objects and return difference between them. Such functions also produce a system. Each modification could be represented simultaneously with fine-grained description "field A inside field B inside field C inside the record" or with coarse "field C inside the record". So you can pattern match modification with desired grade of accuracy.
I need to write code for comparing records and reacting to modifications inside them. I would like to avoid reinventing the wheel. I tried to google reverse lenses but drowned in non-relevant output.
You can refer to Differential Synchronisation Algorithm for this. Its an algorithm based on DIFF and PATCH operations. The DIFF part may be useful for you.
For further reference : https://neil.fraser.name/writing/sync/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With