package merlin-lib
Merlin's libraries
Install
Dune Dependency
Authors
Maintainers
Sources
merlin-4.17.1-501.tbz
sha256=376707aa871f09e9639456d3fbe4b89a21c9ad75c774e94cbbbe67f842b0a500
sha512=a11ea4b8e3520b3ee41ae8198cda34b2816b8dfcdcb99350ef29689a7d62bb66d17ffa075c551aa56d521120b55e6db14a106a31f7b3970ed2aa07e1db3c9b88
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)"
>