Safe Haskell | None |
---|---|
Language | Haskell2010 |
Convenience interface to enable defining edits at offsets with some optional safety checks.
Synopsis
- data MultiPatches a = MultiPatches {
- mpsBaseOffset :: Maybe Int
- mpsPatches :: [MultiPatch a]
- data MultiPatch a = MultiPatch {
- mpContents :: a
- mpOffsets :: [Offset a]
- data Offset a = Offset {
- oOffset :: Int
- oAbsoluteOffset :: Maybe Int
- oMaxLength :: Maybe Int
- oPatchMeta :: Maybe (OverwriteMeta a)
- normalizeSimple :: PatchRep a => [MultiPatches a] -> Maybe [Patch Bytes]
- applyBaseOffset :: MultiPatches a -> (Int, [(MultiPatch a, [Offset a])])
- listAlgebraConcatEtc :: [(a, [(b, [c])])] -> ([b], [(c, a)])
- normalize :: PatchRep a => [MultiPatch a] -> Maybe [Patch Bytes]
Core types
data MultiPatches a Source #
A list of patches sharing a configuration, each applied at a list of offsets, abstracted over patch type.
MultiPatches | |
|
Instances
data MultiPatch a Source #
A single patch applied at a list of offsets, parameterized by patch type.
MultiPatch | |
|
Instances
An offset in a stream, with metadata about it to use when preparing the patch and at patch time.
Offset | |
|
Instances
Eq a => Eq (Offset a) Source # | |
Show a => Show (Offset a) Source # | |
Generic (Offset a) Source # | |
ToJSON a => ToJSON (Offset a) Source # | |
Defined in BytePatch.JSON | |
FromJSON a => FromJSON (Offset a) Source # | |
type Rep (Offset a) Source # | |
Defined in BytePatch.Pretty type Rep (Offset a) = D1 ('MetaData "Offset" "BytePatch.Pretty" "bytepatch-0.2.0-2TXM0rJut3lJpkgCCGgU2G" 'False) (C1 ('MetaCons "Offset" 'PrefixI 'True) ((S1 ('MetaSel ('Just "oOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "oAbsoluteOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int))) :*: (S1 ('MetaSel ('Just "oMaxLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "oPatchMeta") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (OverwriteMeta a)))))) |
Convenience functions
normalizeSimple :: PatchRep a => [MultiPatches a] -> Maybe [Patch Bytes] Source #
Normalize a set of MultiPatches
, discarding everything on error.
Low-level interface
applyBaseOffset :: MultiPatches a -> (Int, [(MultiPatch a, [Offset a])]) Source #
listAlgebraConcatEtc :: [(a, [(b, [c])])] -> ([b], [(c, a)]) Source #