Diff-0.1.2: O(ND) diff algorithm in haskell.

Portabilityportable
Stabilityexperimental
Maintainers.clover@gmail.com

Data.Algorithm.Diff

Description

This is an implementation of the O(ND) diff algorithm as described in "An O(ND) Difference Algorithm and Its Variations (1986)" http://citeseer.ist.psu.edu/myers86ond.html. It is O(mn) in space. The algorithm is the same one used by standared Unix diff. The assumption is that users of this library will want to diff over interesting things or peform interesting tasks with the results (given that, otherwise, they would simply use the standard Unix diff utility). Thus no attempt is made to present a fancier API to aid in doing standard and uninteresting things with the results.

Synopsis

Documentation

data DI Source

Difference Indicator. A value is either from the First list, the Second or from Both.

Constructors

F 
S 
B 

Instances

getDiff :: Eq t => [t] -> [t] -> [(DI, t)]Source

Takes two lists and returns a list indicating the differences between them.

getGroupedDiff :: Eq t => [t] -> [t] -> [(DI, [t])]Source

Takes two lists and returns a list indicating the differences between them, grouped into chunks.