HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

ModuleDiff-2.0.1Haskell2010

Data.Algorithm.DiffOutput

Generates a string output that is similar to diff normal mode.

  • 3 types
  • 5 values
  • PackageDiff-2.0.1
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceDiffOutput.hs
valueppDiff :: [Diff [String]] -> String
#

Pretty print the differences. The output is similar to the output of the diff utility.

> putStr (ppDiff (getGroupedDiff ["a","b","c","d","e"] ["a","c","d","f"]))
2d1
< b
5c4
< e
---
> f
typetype LineNo = Int
#

Line number alias. Always non-negative.

datadata LineRange
#

Line Range: start, end and contents.

The following invariants hold:

snd lrNumbers >= fst lrNumbers
snd lrNumbers - fst lrNumbers + 1 == length lrContents

which imply lrContents cannot be empty.

Instances4Eq, Ord, Read, Show
  • Eq LineRangeDefined in Diff-2.0.1 · Data.Algorithm.DiffOutput
  • Ord LineRangeDefined in Diff-2.0.1 · Data.Algorithm.DiffOutput
  • Read LineRangeDefined in Diff-2.0.1 · Data.Algorithm.DiffOutput
  • Show LineRangeDefined in Diff-2.0.1 · Data.Algorithm.DiffOutput
valuemkLineRange :: Int -> [String] -> LineRange
#

Smart constructor for LineRange that computes the end line from the start line and the content length, guaranteeing that its content length and range match.

datadata DiffOperation a
#

Diff operation representing changes to apply.

Constructors

  • Deletion a LineNo

    Element deleted on the left input, line number preceding the deleted lines in the right input.

  • Addition a LineNo

    Element added from the right input, line number preceding the added lines in the left input.

  • Change a a

    Element changed from the left input to the right input.

Instances4Eq, Ord, Read, Show