package merlin-lib
Merlin's libraries
Install
Dune Dependency
Authors
Maintainers
Sources
merlin-5.3-502.tbz
sha256=2cea46f12397fa6e31ef0c0d4f5e11c1cfd916ee49420694005c95ebb3aa24bc
sha512=e94abb9ae38149245337db033e2c3891c7ec772168e99abf1bda0216a894c0854e7170b56fe88eba83ec98f2ebc0f5c7c723e8db14f59eeb6dd348bec12c6d62
doc/merlin-lib.ocaml_utils/Ocaml_utils/Diffing_with_keys/index.html
Module Ocaml_utils.Diffing_with_keys
Source
When diffing lists where each element has a distinct key, we can refine the diffing patch by introducing two composite edit moves: swaps and moves.
Swap
s exchange the position of two elements. Swap
cost is set to 2 * change - epsilon
. Move
s change the position of one element. Move
cost is set to delete + addition - epsilon
.
When the cost delete + addition
is greater than change
and with those specific weights, the optimal patch with Swap
s and Move
s can be computed directly and cheaply from the original optimal patch.
Source
type ('l, 'r, 'diff) change =
| Change of ('l, 'r, 'diff) mismatch
| Swap of {
}
| Move of {
}
| Insert of {
}
| Delete of {
}
This specialized version of changes introduces two composite changes: Move
and Swap
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>