Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Data/Algorithm/Diff.hs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ data DL = DL
-- same /k-diagonal/, meaning that
--
-- > poi x - poj x == poi y - poj y`
--
--
-- and both argument nodes are within the same wave front,
--
--
-- > length (path x) == length (path y)
furthestReaching :: DL -> DL -> DL
furthestReaching x y
Expand Down Expand Up @@ -287,6 +287,8 @@ getGroupedDiff = getGroupedDiffBy (==)
-- | A form of 'getDiff' with no 'Eq' constraint. Instead, an equality predicate
-- is taken as the first argument.
getDiffBy :: (a -> b -> Bool) -> [a] -> [b] -> [PolyDiff a b]
getDiffBy _ a [] = map First a
getDiffBy _ [] b = map Second b
getDiffBy eq a b = markup a b . reverse $ ses eq a b
where markup (x:xs) (y:ys) ds
| eq x y = Both x y : markup xs ys ds
Expand Down
Loading