HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulefast-myers-diff-0.0.2Haskell2010

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
  • 19 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.

Distance

4 declarations

Internals

datadata Edit
#

Constructors

Instances3Eq, Ord, Show
  • Eq EditDefined in fast-myers-diff-0.0.2 · Myers.Diff
  • Ord EditDefined in fast-myers-diff-0.0.2 · Myers.Diff
  • Show EditDefined in fast-myers-diff-0.0.2 · 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.