diff

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!"
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
The diff function calculates the first derivative of a scalar-to-scalar function by forward-mode AD
>>> diff sin 0
1.0
The diff function calculates the first derivative of a scalar-to-scalar function by forward-mode AD
>>> diff sin 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
The diff function calculates the first derivative of a scalar-to-scalar function by forward-mode AD
>>> diff sin 0
1.0
The diff function calculates the first derivative of a scalar-to-scalar function by forward-mode AD
>>> diff sin 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the derivative of a function.
>>> diff sin 0
1.0
>>> cos 0
1.0
Compute the first derivative of a function (a -> a)
Compute the first derivative of a function (a -> a)
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