Diff-0.4.0: O(ND) diff algorithm in haskell.
Copyright(c) Sterling Clover 2008-2011 Kevin Charter 2011
LicenseBSD 3 Clause
Maintainers.clover@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Algorithm.DiffOutput

Description

Generates a string output that is similar to diff normal mode

Synopsis

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

prettyDiffs :: [DiffOperation LineRange] -> Doc Source #

pretty print of diff operations

parsePrettyDiffs :: String -> [DiffOperation LineRange] Source #

Parse pretty printed Diffs as DiffOperations

type LineNo = Int Source #

Line number alias

data LineRange Source #

Line Range: start, end and contents

Constructors

LineRange 

Fields

Instances

Instances details
Eq LineRange Source # 
Instance details

Defined in Data.Algorithm.DiffOutput

Methods

(==) :: LineRange -> LineRange -> Bool

(/=) :: LineRange -> LineRange -> Bool

Ord LineRange Source # 
Instance details

Defined in Data.Algorithm.DiffOutput

Methods

compare :: LineRange -> LineRange -> Ordering

(<) :: LineRange -> LineRange -> Bool

(<=) :: LineRange -> LineRange -> Bool

(>) :: LineRange -> LineRange -> Bool

(>=) :: LineRange -> LineRange -> Bool

max :: LineRange -> LineRange -> LineRange

min :: LineRange -> LineRange -> LineRange

Read LineRange Source # 
Instance details

Defined in Data.Algorithm.DiffOutput

Methods

readsPrec :: Int -> ReadS LineRange

readList :: ReadS [LineRange]

readPrec :: ReadPrec LineRange

readListPrec :: ReadPrec [LineRange]

Show LineRange Source # 
Instance details

Defined in Data.Algorithm.DiffOutput

Methods

showsPrec :: Int -> LineRange -> ShowS

show :: LineRange -> String

showList :: [LineRange] -> ShowS

data DiffOperation a Source #

Diff Operation representing changes to apply

Constructors

Deletion a LineNo 
Addition a LineNo 
Change a a 

Instances

Instances details
Eq a => Eq (DiffOperation a) Source # 
Instance details

Defined in Data.Algorithm.DiffOutput

Methods

(==) :: DiffOperation a -> DiffOperation a -> Bool

(/=) :: DiffOperation a -> DiffOperation a -> Bool

Ord a => Ord (DiffOperation a) Source # 
Instance details

Defined in Data.Algorithm.DiffOutput

Read a => Read (DiffOperation a) Source # 
Instance details

Defined in Data.Algorithm.DiffOutput

Methods

readsPrec :: Int -> ReadS (DiffOperation a)

readList :: ReadS [DiffOperation a]

readPrec :: ReadPrec (DiffOperation a)

readListPrec :: ReadPrec [DiffOperation a]

Show a => Show (DiffOperation a) Source # 
Instance details

Defined in Data.Algorithm.DiffOutput

Methods

showsPrec :: Int -> DiffOperation a -> ShowS

show :: DiffOperation a -> String

showList :: [DiffOperation a] -> ShowS