HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

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.

Contents
  1. Diffing
  2. Distance
  3. Internals
  4. Backwards compatibility with Diff
Synopsis

Diffing

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

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

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.