Copyright | (c) Sterling Clover 2008-2011, Kevin Charter 2011 |
---|---|
License | BSD 3 Clause |
Maintainer | s.clover@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
This is an implementation of the O(ND) diff algorithm as described in "An O(ND) Difference Algorithm and Its Variations (1986)" http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927. It is O(mn) in space. The algorithm is the same one used by standared Unix diff.
Documentation
Comparing lists for differences
Finding chunks of differences
getGroupedDiff :: Eq t => [t] -> [t] -> [Diff [t]] Source #
Takes two lists and returns a list of differences between them, grouped
into chunks. This is getGroupedDiffBy
with ==
used as predicate.
getGroupedDiffBy :: (t -> t -> Bool) -> [t] -> [t] -> [Diff [t]] Source #