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

ModuleDiff-2.0.1Haskell2010

Data.Algorithm.DiffOutput

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

Synopsis
  • 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
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
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