diff -package:ad

This lets you use a difference list of a Semigroup as a Monoid.

Examples

>>> let hello = diff "Hello, "
>>> appEndo hello "World!"
"Hello, World!"
>>> appEndo (hello <> mempty) "World!"
"Hello, World!"
>>> appEndo (mempty <> hello) "World!"
"Hello, World!"
>>> let world = diff "World"

>>> let excl = diff "!"
>>> appEndo (hello <> (world <> excl)) mempty
"Hello, World!"
>>> appEndo ((hello <> world) <> excl) mempty
"Hello, World!"
Fails the test and shows a git-like diff if the comparison operation evaluates to False when applied to its arguments. The comparison function is the second argument, which may be counter-intuitive to Haskell programmers. However, it allows operators to be written infix for easy reading:
diff y (<) 87
diff x (<=) r
This function behaves like the unix diff tool, which gives a 0 exit code if the compared files are identical, or a 1 exit code code otherwise. Like unix diff, if the arguments fail the comparison, a /diff is shown.
This lets you use a difference list of a Semigroup as a Monoid.

Example:

>>> let hello = diff "Hello, "

>>> appEndo hello "World!"
"Hello, World!"

>>> appEndo (hello <> mempty) "World!"
"Hello, World!"

>>> appEndo (mempty <> hello) "World!"
"Hello, World!"

>>> let world = diff "World"

>>> let excl = diff "!"

>>> appEndo (hello <> (world <> excl)) mempty
"Hello, World!"

>>> appEndo ((hello <> world) <> excl) mempty
"Hello, World!"
This lets you use a difference list of a Semigroup as a Monoid.

Examples

let hello = diff "Hello, "
>>> appEndo hello "World!"
"Hello, World!"
>>> appEndo (hello <> mempty) "World!"
"Hello, World!"
>>> appEndo (mempty <> hello) "World!"
"Hello, World!"
let world = diff "World"
let excl = diff "!"
>>> appEndo (hello <> (world <> excl)) mempty
"Hello, World!"
>>> appEndo ((hello <> world) <> excl) mempty
"Hello, World!"
Display a time span as one time relative to another. Input is assumed to be seconds. Typical inputs are NominalDiffTime and DiffTime.
Render the difference between two expressions
Compare two JSON documents and generate a patch describing the differences. Uses the defaultConfig.
Merge two JSON values and annotate the result with the differences.
The diff command.
Get the list of elements to be deleted and the list of elements to be added to the first list in order to get the second list.
Entry point for diffing / patching algorithm
The difference between two lists, according to the "patience diff" algorithm.
Takes two Maps and returns a Map from the same key type to Delta a, where Delta a encodes differences between entries.
returns Nothing when there is no update
binomial operator applied to last and this value
O(n*m). Returns the difference between two slists. The operation is non-associative. In the result of diff xs ys, the first occurrence of each element of ys in turn (if any) has been removed from xs. Thus
diff (xs <> ys) ys == xs
>>> diff (slist [1..10]) (slist [1,3..10])
Slist {sList = [2,4,6,8,10], sSize = Size 5}

>>> diff (slist [1,3..10]) (slist [2,4..10])
Slist {sList = [1,3,5,7,9], sSize = Size 5}
Not on Stackage, so not searched. Diff and patch
Affine subtraction. Get the vector from the first to the second ENU point.
The difference between some expected and actual value.
Diff algorithm in pure Haskell Implementation of the standard diff algorithm in Haskell. Time complexity is O(ND) (input length * number of differences). Space complexity is O(D^2). Includes utilities for pretty printing.