| CARVIEW |
tree-diff: Diffing of (expression) trees.
Common diff algorithm works on list structures:
diff :: Eq a => [a] -> [a] -> [Edit a]
This package works on trees.
treeDiff :: Eq a => Tree a -> Tree a -> Edit (EditTree a)
This package also provides a way to diff arbitrary ADTs,
using Generics-derivable helpers.
This package differs from gdiff,
in a two ways: tree-diff doesn't have patch function,
and the "edit-script" is a tree itself, which is useful for pretty-printing.
>>> prettyEditExpr $ ediff (Foo 42 [True, False] "old") (Foo 42 [False, False, True] "new")
Foo
{fooBool = [-True, +False, False, +True],
fooInt = 42,
fooString = -"old" +"new"}
[Skip to Readme]
Modules
[Index] [Quick Jump]
Downloads
- tree-diff-0.3.4.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0, 0.0.0.1, 0.0.1, 0.0.2, 0.0.2.1, 0.1, 0.2, 0.2.1, 0.2.1.1, 0.2.2, 0.3, 0.3.0.1, 0.3.1, 0.3.2, 0.3.3, 0.3.4 |
|---|---|
| Change log | ChangeLog.md |
| Dependencies | aeson (>=2.2.0.0 && <2.3), ansi-terminal (>=1.1 && <1.2), ansi-wl-pprint (>=1.0.2 && <1.1), base (>=4.12.0.0 && <4.22), bytestring (>=0.10.8.2 && <0.11 || >=0.11.0.0 && <0.12 || >=0.12.0.2 && <0.13), containers (>=0.6.0.1 && <0.8), data-array-byte (>=0.1.0.1 && <0.2), deepseq (>=1.4.4.0 && <1.5 || >=1.5.0.0 && <1.6), hashable (>=1.4.4.0 && <1.5 || >=1.5.0.0 && <1.6), parsec (>=3.1.13.0 && <3.2), parsers (>=0.12.11 && <0.13), pretty (>=1.1.1.0 && <1.2), primitive (>=0.9.0.0 && <0.10), QuickCheck (>=2.14.2 && <2.16 || >=2.16.0.0 && <2.17), scientific (>=0.3.8.0 && <0.4), semialign (>=1.3.1 && <1.4), strict (>=0.5 && <0.6), tagged (>=0.8.8 && <0.9), text (>=1.2.3.0 && <1.3 || >=2.0 && <2.2), these (>=1.2.1 && <1.3), time (>=1.8.0.2 && <1.9 || >=1.9.3 && <1.13 || >=1.14 && <1.15), unordered-containers (>=0.2.20 && <0.3), uuid-types (>=1.0.6 && <1.1), vector (>=0.13.1.0 && <0.14) [details] |
| Tested with | ghc ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.7 || ==9.8.4 || ==9.10.2 || ==9.12.2 |
| License | GPL-2.0-or-later |
| Copyright | (c) 2017-2021 Oleg Grenrus |
| Author | Oleg Grenrus <oleg.grenrus@iki.fi> |
| Maintainer | Oleg.Grenrus <oleg.grenrus@iki.fi> |
| Uploaded | by phadej at 2025-01-08T15:57:58Z |
| Revised | Revision 2 made by phadej at 2025-07-08T15:23:02Z |
| Category | Data, Testing |
| Home page | https://github.com/phadej/tree-diff |
| Bug tracker | https://github.com/phadej/tree-diff/issues |
| Source repo | head: git clone https://github.com/phadej/tree-diff.git |
| Distributions | Arch:0.3.0.1, LTSHaskell:0.3.4, NixOS:0.3.4, Stackage:0.3.4 |
| Reverse Dependencies | 7 direct, 14 indirect [details] |
| Downloads | 28853 total (72 in the last 30 days) |
| Rating | 2.25 (votes: 2) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2025-01-08 [all 1 reports] |
Readme for tree-diff-0.3.4
[back to package description]tree-diff
Diffing of (expression) trees.
Examples
tree-diff displays pretty diffs of tree data:

Because of its untyped internal type, it copes with type changes:

As a bonus, multiline Strings and Text are diffed linewise:
