| 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 | Haskell2010 |
Data.Algorithm.DiffOutput
Description
Generates a string output that is similar to diff normal mode
Synopsis
- diffToLineRanges :: [Diff [String]] -> [DiffOperation LineRange]
- ppDiff :: [Diff [String]] -> String
- prettyDiffs :: [DiffOperation LineRange] -> Doc
- parsePrettyDiffs :: String -> [DiffOperation LineRange]
- type LineNo = Int
- data LineRange = LineRange {
- lrNumbers :: (LineNo, LineNo)
- lrContents :: [String]
- data DiffOperation a
Documentation
diffToLineRanges :: [Diff [String]] -> [DiffOperation LineRange] Source #
Converts Diffs to DiffOperations
ppDiff :: [Diff [String]] -> String Source #
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
prettyDiffs :: [DiffOperation LineRange] -> Doc Source #
pretty print of diff operations
parsePrettyDiffs :: String -> [DiffOperation LineRange] Source #
Parse pretty printed Diffs as DiffOperations
Line Range: start, end and contents
Instances
| Read LineRange Source # | |
| Show LineRange Source # | |
| Eq LineRange Source # | |
| Ord LineRange Source # | |
data DiffOperation a Source #
Diff Operation representing changes to apply