Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the name for reverse lens?

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.

like image 723
ayvango Avatar asked Jan 16 '16 01:01

ayvango


1 Answers

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/

like image 73
Hari Avatar answered Sep 27 '22 21:09

Hari