| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Aeson.Diff
Description
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.
Constructors
| Patch | |
Fields
| |
Pointer to a location in a JSON document.
Defined in RFC 6901 http://tools.ietf.org/html/rfc6901
Instances
| Eq Pointer Source # | |
| Ord Pointer Source # | |
Defined in Data.Aeson.Pointer | |
| Show Pointer Source # | |
| Generic Pointer Source # | |
| Semigroup Pointer Source # | |
| Monoid Pointer Source # | |
| ToJSON Pointer Source # | |
| FromJSON Pointer Source # | |
| type Rep Pointer Source # | |
Defined in Data.Aeson.Pointer | |
Path components to traverse a single layer of a JSON document.
Instances
| Eq Key Source # | |
| Ord Key Source # | |
| Show Key Source # | |
| Generic Key Source # | |
| ToJSON Key Source # | |
| FromJSON Key Source # | |
| type Rep Key Source # | |
Defined in Data.Aeson.Pointer type Rep Key = D1 ('MetaData "Key" "Data.Aeson.Pointer" "aeson-diff-1.1.0.9-EaT0MSW09P6DGiAb9I1NFZ" 'False) (C1 ('MetaCons "OKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "AKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) | |
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.
Constructors
| Add | |
Fields
| |
| Cpy | |
Fields | |
| Mov | |
Fields | |
| Rem | |
Fields | |
| Rep | |
Fields
| |
| Tst | |
Fields
| |
Instances
Configuration for the diff algorithm.
Constructors
| Config | |
Fields | |
Functions
diff :: Value -> Value -> Patch Source #
Compare two JSON documents and generate a patch describing the differences.
Uses the defaultConfig.