HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulefast-myers-diff-0.0.1Haskell2010

Myers.Diff

Myers Diff

This is an implementation of the O(ND) diff algorithm as described in "An O(ND) Difference Algorithm and Its Variations (1986)" http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927.

  • 3 types
  • 15 values

Diffing

9 declarations
datadata PolyDiff a b
#

A value is either from the First list, the Second or from Both. Both contains both the left and right values, in case you are using a form of equality that doesn't check all data (for example, if you are using a custom equality relation to only perform equality on side of a tuple).

Constructors

Instances5Eq, Show, Generic, NFData, Rep
valuegetTextDiff :: Text -> Text -> Vector (Diff Text)
#

Text diff

Uses pack and unpack, so does not roundtrip. It uses pack and unpack because Text is not the same as Vector Char; You can't index a text in O(1) time, it takes O(n) time.

Internals

datadata Edit
#

Constructors

Instances3Eq, Ord, Show
  • Eq EditDefined in fast-myers-diff-0.0.1 · Myers.Diff
  • Ord EditDefined in fast-myers-diff-0.0.1 · Myers.Diff
  • Show EditDefined in fast-myers-diff-0.0.1 · Myers.Diff

Backwards compatibility with Diff

valuegetDiff :: Eq a => [a] -> [a] -> [Diff a]
#

For backward compatibility with Diff, use more specific functions if you can.

valuegetDiffBy :: (a -> b -> Bool) -> [a] -> [b] -> [PolyDiff a b]
#

For backward compatibility with Diff, use more specific functions if you can.

valuegetGroupedDiff :: Eq a => [a] -> [a] -> [Diff [a]]
#

For backward compatibility with Diff, use more specific functions if you can.