Package Info

ghc-tree-diff


Diffing of (expression) trees


Unspecified

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 <http://hackage.haskell.org/package/gdiff 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"} '.


License: GPL-2.0-or-later
URL: https://hackage.haskell.org/package/tree-diff

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.3.0.1-bp156.1.1 info GA Release 2024-03-05 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • ghc-tree-diff
  • ghc-tree-diff-devel
0.2.1.1-bp155.2.14 info GA Release 2023-05-22 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • ghc-tree-diff
  • ghc-tree-diff-devel
0.2.1.1-bp154.1.16 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • x86-64
  • ghc-tree-diff
  • ghc-tree-diff-devel