diff -package:hedgehog

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!"
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
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