aeson-diff-1.1.0.5: 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 #

Describes the changes between two JSON documents.

Constructors

Patch 
Instances
Eq Patch # 
Instance details

Defined in Data.Aeson.Patch

Methods

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

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

Show Patch # 
Instance details

Defined in Data.Aeson.Patch

Methods

showsPrec :: Int -> Patch -> ShowS #

show :: Patch -> String #

showList :: [Patch] -> ShowS #

Semigroup Patch # 
Instance details

Defined in Data.Aeson.Patch

Methods

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

sconcat :: NonEmpty Patch -> Patch #

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

Monoid Patch # 
Instance details

Defined in Data.Aeson.Patch

Methods

mempty :: Patch #

mappend :: Patch -> Patch -> Patch #

mconcat :: [Patch] -> Patch #

ToJSON Patch # 
Instance details

Defined in Data.Aeson.Patch

FromJSON Patch # 
Instance details

Defined in Data.Aeson.Patch

data Pointer #

Pointer to a location in a JSON document.

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

Instances
Eq Pointer # 
Instance details

Defined in Data.Aeson.Pointer

Methods

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

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

Ord Pointer # 
Instance details

Defined in Data.Aeson.Pointer

Show Pointer # 
Instance details

Defined in Data.Aeson.Pointer

Semigroup Pointer # 
Instance details

Defined in Data.Aeson.Pointer

Monoid Pointer # 
Instance details

Defined in Data.Aeson.Pointer

ToJSON Pointer # 
Instance details

Defined in Data.Aeson.Pointer

FromJSON Pointer # 
Instance details

Defined in Data.Aeson.Pointer

data Key #

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 # 
Instance details

Defined in Data.Aeson.Pointer

Methods

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

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

Ord Key # 
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 # 
Instance details

Defined in Data.Aeson.Pointer

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

ToJSON Key # 
Instance details

Defined in Data.Aeson.Pointer

FromJSON Key # 
Instance details

Defined in Data.Aeson.Pointer

newtype Config #

Configuration for the diff algorithm.

Constructors

Config 

Functions

diff :: Value -> Value -> Patch #

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

Uses the defaultConfig.

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

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

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

Apply a patch to a JSON document.