Data.Git.Delta

hit-0.6.3: Git operations in haskell

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unix
Safe Haskell | Safe
Language | Haskell98

Data.Git.Delta

Description

Synopsis

- data Delta = Delta Word64 Word64 [DeltaCmd]
- data DeltaCmd
  - = DeltaCopy ByteString
  - | DeltaSrc Word64 Word64
- deltaParse :: Parser ByteString Delta
- deltaRead :: ByteString -> Maybe Delta
- deltaApply :: ByteString -> Delta -> ByteString

# Documentation

data Delta #

a delta is a source size, a destination size and a list of delta cmd

Constructors

Delta Word64 Word64 [DeltaCmd] |

Instances

Eq Delta # |
Methods (==) :: Delta -> Delta -> Bool # (/=) :: Delta -> Delta -> Bool #
Show Delta # |
Methods showsPrec :: Int -> Delta -> ShowS # show :: Delta -> String # showList :: [Delta] -> ShowS #

data DeltaCmd #

possible commands in a delta

Constructors

DeltaCopy ByteString |
DeltaSrc Word64 Word64 |

Instances

Eq DeltaCmd # |
Methods (==) :: DeltaCmd -> DeltaCmd -> Bool # (/=) :: DeltaCmd -> DeltaCmd -> Bool #
Show DeltaCmd # |
Methods showsPrec :: Int -> DeltaCmd -> ShowS # show :: DeltaCmd -> String # showList :: [DeltaCmd] -> ShowS #

deltaParse :: Parser ByteString Delta #

parse a delta. format is 2 variable sizes, followed by delta cmds. for each cmd: * if first byte MSB is set, we copy from source. * otherwise, we copy from delta. * extensions are not handled.

deltaRead :: ByteString -> Maybe Delta #

read one delta from a lazy bytestring.

deltaApply :: ByteString -> Delta -> ByteString #

apply a delta on a lazy bytestring, returning a new bytestring.