aeson-diff-1.1.0.7: Extract and apply patches to JSON documents.

Safe HaskellNone
LanguageHaskell2010

Data.Aeson.Diff

Contents

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

Patches

newtype Patch Source #

Describes the changes between two JSON documents.

Constructors

Patch 
Instances
Eq Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Methods

(==) :: Patch -> Patch -> Bool #

(/=) :: Patch -> Patch -> Bool #

Show Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Methods

showsPrec :: Int -> Patch -> ShowS #

show :: Patch -> String #

showList :: [Patch] -> ShowS #

Semigroup Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Methods

(<>) :: Patch -> Patch -> Patch #

sconcat :: NonEmpty Patch -> Patch #

stimes :: Integral b => b -> Patch -> Patch #

Monoid Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Methods

mempty :: Patch #

mappend :: Patch -> Patch -> Patch #

mconcat :: [Patch] -> Patch #

ToJSON Patch Source # 
Instance details

Defined in Data.Aeson.Patch

FromJSON Patch Source # 
Instance details

Defined in Data.Aeson.Patch

data Pointer Source #

Pointer to a location in a JSON document.

Defined in RFC 6901 http://tools.ietf.org/html/rfc6901

Instances
Eq Pointer Source # 
Instance details

Defined in Data.Aeson.Pointer

Methods

(==) :: Pointer -> Pointer -> Bool #

(/=) :: Pointer -> Pointer -> Bool #

Ord Pointer Source # 
Instance details

Defined in Data.Aeson.Pointer

Show Pointer Source # 
Instance details

Defined in Data.Aeson.Pointer

Semigroup Pointer Source # 
Instance details

Defined in Data.Aeson.Pointer

Monoid Pointer Source # 
Instance details

Defined in Data.Aeson.Pointer

ToJSON Pointer Source # 
Instance details

Defined in Data.Aeson.Pointer

FromJSON Pointer Source # 
Instance details

Defined in Data.Aeson.Pointer

data Key Source #

Path components to traverse a single layer of a JSON document.

Constructors

OKey Text

Traverse a Value with an Value constructor.

AKey Int

Traverse a Value with an Value constructor.

Instances
Eq Key Source # 
Instance details

Defined in Data.Aeson.Pointer

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Ord Key Source # 
Instance details

Defined in Data.Aeson.Pointer

Methods

compare :: Key -> Key -> Ordering #

(<) :: Key -> Key -> Bool #

(<=) :: Key -> Key -> Bool #

(>) :: Key -> Key -> Bool #

(>=) :: Key -> Key -> Bool #

max :: Key -> Key -> Key #

min :: Key -> Key -> Key #

Show Key Source # 
Instance details

Defined in Data.Aeson.Pointer

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

ToJSON Key Source # 
Instance details

Defined in Data.Aeson.Pointer

FromJSON Key Source # 
Instance details

Defined in Data.Aeson.Pointer

data Operation Source #

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.

newtype Config Source #

Configuration for the diff algorithm.

Constructors

Config 

Functions

diff :: Value -> Value -> Patch Source #

Compare two JSON documents and generate a patch describing the differences.

Uses the defaultConfig.

diff' :: Config -> Value -> Value -> Patch Source #

Compare two JSON documents and generate a patch describing the differences.

patch :: Patch -> Value -> Result Value Source #

Apply a patch to a JSON document.