package merlin-lib
Merlin's libraries
Install
Dune Dependency
Authors
Maintainers
Sources
merlin-4.14-500.tbz
sha256=ec23f324f875520cd8897f303cc6d4e595f3d7000914d410729f16b86ad1d70e
sha512=8db22100cc0af65b08f456a2a7af84e75396f5869ee7552f1f5888a1c0279d1d85e6eecb3a677ae6f0973a99823cddba0563843ce216197255667342ef161885
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)"
>