hashed-storage-0.3: Hashed file storage support code.Source codeContentsIndex
Storage.Hashed.Diff
Synopsis
unidiff :: Tree -> Tree -> IO ByteString
type Line = ByteString
data WeaveLine
= Common Line
| Remove Line
| Add Line
| Replace Line Line
| Skip Int
type Weave = [WeaveLine]
type Hunk = [WeaveLine]
unifiedDiff :: ByteString -> ByteString -> ByteString
weave :: ByteString -> ByteString -> Weave
hunks :: Weave -> [Hunk]
unifyHunk :: Hunk -> Hunk
reduceContext :: Int -> [Hunk] -> [Hunk]
deweave :: Weave -> ByteString
printUnified :: Weave -> ByteString
Documentation
unidiff :: Tree -> Tree -> IO ByteStringSource
type Line = ByteStringSource
data WeaveLine Source
Constructors
Common Line
Remove Line
Add Line
Replace Line Line
Skip Int
show/hide Instances
type Weave = [WeaveLine]Source
A weave -- two files woven together, with common and differing regions marked up. Cf. WeaveLine.
type Hunk = [WeaveLine]Source
Sort of a sub-weave.
unifiedDiff :: ByteString -> ByteString -> ByteStringSource
Produce unified diff (in a string form, ie. formatted) from a pair of bytestrings.
weave :: ByteString -> ByteString -> WeaveSource
Weave two bytestrings. Intermediate data structure for the actual unidiff implementation. No skips are produced.
hunks :: Weave -> [Hunk]Source
Break up a Weave into hunks.
unifyHunk :: Hunk -> HunkSource
Reformat a Hunk into a format suitable for unified diff. Replaces are turned into add/remove pairs, all removals in a hunk go before all adds. Hunks of Common lines are left intact. Produces input suitable for reduceContext.
reduceContext :: Int -> [Hunk] -> [Hunk]Source
Break up a Weave into unified hunks, leaving n lines of context around every hunk. Consecutive Common lines not used as context are replaced with Skips.
deweave :: Weave -> ByteStringSource
Format a Weave for printing.
printUnified :: Weave -> ByteStringSource
Print a hunked weave in form of an unified diff. Hunk boundaries are marked up as Skip lines. Cf. reduceContext.
Produced by Haddock version 2.4.2