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

Copyright | (c) David Fox (2015)
License | BSD 3 Clause
Maintainer | s.clover@gmail.com
Stability | experimental
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell98

Data.Algorithm.DiffContext

Description

Generates a grouped diff with merged runs, and outputs them in the manner of diff -u

Synopsis

- getContextDiff :: Eq a => Int -> [a] -> [a] -> ContextDiff a
- prettyContextDiff :: Doc -> Doc -> (c -> Doc) -> ContextDiff c -> Doc

# Documentation

getContextDiff :: Eq a => Int -> [a] -> [a] -> ContextDiff a #

Do a grouped diff and then split up the chunks into runs that contain differences surrounded by N lines of unchanged text. If there is less then 2N+1 lines of unchanged text between two changes, the runs are left merged.

prettyContextDiff #

Arguments

:: Doc | Document 1 name
-> Doc | Document 2 name
-> (c -> Doc) | Element pretty printer
-> ContextDiff c |
-> Doc |

Pretty print a ContextDiff in the manner of diff -u.