Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module implements data types and operations to represent the differences between JSON documents (i.e. a patch), to compare JSON documents and extract such a patch, and to apply such a patch to a JSON document.
- data Patch
- patchOperations :: Patch -> [Operation]
- type Path = [Key]
- data Key
- data Operation
- = Ins {
- changePath :: Path
- changeValue :: Value
- | Del {
- changePath :: Path
- changeValue :: Value
- = Ins {
- diff :: Value -> Value -> Patch
- patch :: Patch -> Value -> Value
- applyOperation :: Operation -> Value -> Value
- formatPatch :: Patch -> Text
Patches
Describes the changes between two JSON documents.
patchOperations :: Patch -> [Operation] Source
Traverse a single layer of a JSON document.
Descripts an atomic change to a JSON document.
Ins | Insert a value at a location. |
| |
Del | Delete the value at a location. |
|
Functions
diff :: Value -> Value -> Patch Source
Compare two JSON documents and generate a patch describing the differences.
formatPatch :: Patch -> Text Source
Format a Patch
.