6

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.

1 Answer 1

2
+25

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.