We have already implemented tree edit distance; We already seen how a HDiff.Patch translated
to a GDiff.ES is worse, in terms of higher edit-script-cost, than a computed GDiff.ES.
Another thing we should do is count how many constructors we actually delete and insert
with a HDiff, and compare that with a gdiff. For that to be accurate, though, we must
not count the spine:
hdiffCost :: Patch -> Int
hdiffCost p = sum . holesGetHolesWith (uncurry' go) . holesLCP (cCtxDel (distr p)) (cCtxIns (distr p))
where
go p q = size p + size q
We have already implemented tree edit distance; We already seen how a
HDiff.Patch
translated to aGDiff.ES
is worse, in terms of higher edit-script-cost, than a computedGDiff.ES
.Another thing we should do is count how many constructors we actually delete and insert with a
HDiff
, and compare that with a gdiff. For that to be accurate, though, we must not count the spine: