aeson-diff-0.1.1.1: 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

data Patch Source

Describes the changes between two JSON documents.

type Path = [Key] Source

A path through a JSON document is a possibly empty sequence of Keys.

data Key Source

Traverse a single layer of a JSON document.

Constructors

OKey Text 
AKey Int 

data Operation Source

Descripts an atomic change to a JSON document.

Constructors

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.

patch :: Patch -> Value -> Value Source

Apply a patch to a JSON document.