Diff-0.3.0: O(ND) diff algorithm in haskell.

Copyright | (c) Sterling Clover 2008-2011, Kevin Charter 2011
License | BSD 3 Clause
Maintainer | s.clover@gmail.com
Stability | experimental
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell98

Data.Algorithm.DiffOutput

Description

Author : Stephan Wehr (wehr`factisresearch.com) and JP Moresmau (jp`moresmau.fr)

Generates a string output that is similar to diff normal mode

Synopsis

- ppDiff :: [Diff [String]] -> String
- prettyDiffs :: [DiffOperation LineRange] -> Doc
- type LineNo = Int
- data LineRange = LineRange {
  - lrNumbers :: (LineNo, LineNo)
  - lrContents :: [String]
  }
- data DiffOperation a
  - = Deletion a LineNo
  - | Addition a LineNo
  - | Change a a

# Documentation

ppDiff :: [Diff [String]] -> String

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

prettyDiffs :: [DiffOperation LineRange] -> Doc

pretty print of diff operations

type LineNo = Int

data LineRange

Constructors

LineRange |
Fields lrNumbers :: (LineNo, LineNo) lrContents :: [String]

Instances

Show LineRange |

data DiffOperation a

Constructors

Deletion a LineNo |
Addition a LineNo |
Change a a |

Instances

Show a => Show (DiffOperation a) |