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.
Synopsis
- newtype Patch = Patch {
- patchOperations :: [Operation]
- data Pointer
- data Key
- data Operation
- newtype Config = Config {}
- diff :: Value -> Value -> Patch
- diff' :: Config -> Value -> Value -> Patch
- patch :: Patch -> Value -> Result Value
- applyOperation :: Operation -> Value -> Result Value
Patches
Describes the changes between two JSON documents.
Pointer to a location in a JSON document.
Defined in RFC 6901 http://tools.ietf.org/html/rfc6901
Path components to traverse a single layer of a JSON document.
An Operation
describes the operations which can appear as part of a JSON
Patch.
See RFC 6902 Section 4 http://tools.ietf.org/html/rfc6902#section-4.
Add | |
| |
Cpy | |
Mov | |
Rem | |
Rep | |
| |
Tst | |
|
Functions
diff :: Value -> Value -> Patch Source #
Compare two JSON documents and generate a patch describing the differences.
Uses the defaultConfig
.