aeson-diff-1.1.0.13: Extract and apply patches to JSON documents.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Aeson.Patch

Description

 
Synopsis

Documentation

newtype Patch Source #

Describes the changes between two JSON documents.

Constructors

Patch 

Instances

Instances details
FromJSON Patch Source # 
Instance details

Defined in Data.Aeson.Patch

ToJSON Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Monoid Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Methods

mempty :: Patch #

mappend :: Patch -> Patch -> Patch #

mconcat :: [Patch] -> Patch #

Semigroup Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Methods

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

sconcat :: NonEmpty Patch -> Patch #

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

Generic Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Associated Types

type Rep Patch :: Type -> Type #

Methods

from :: Patch -> Rep Patch x #

to :: Rep Patch x -> Patch #

Show Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Methods

showsPrec :: Int -> Patch -> ShowS #

show :: Patch -> String #

showList :: [Patch] -> ShowS #

Eq Patch Source # 
Instance details

Defined in Data.Aeson.Patch

Methods

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

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

type Rep Patch Source # 
Instance details

Defined in Data.Aeson.Patch

type Rep Patch = D1 ('MetaData "Patch" "Data.Aeson.Patch" "aeson-diff-1.1.0.13-4xcUBXffJWD3K6i4xKImYa" 'True) (C1 ('MetaCons "Patch" 'PrefixI 'True) (S1 ('MetaSel ('Just "patchOperations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Operation])))

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.

Instances

Instances details
FromJSON Operation Source # 
Instance details

Defined in Data.Aeson.Patch

ToJSON Operation Source # 
Instance details

Defined in Data.Aeson.Patch

Generic Operation Source # 
Instance details

Defined in Data.Aeson.Patch

Associated Types

type Rep Operation :: Type -> Type #

Show Operation Source # 
Instance details

Defined in Data.Aeson.Patch

Eq Operation Source # 
Instance details

Defined in Data.Aeson.Patch

type Rep Operation Source # 
Instance details

Defined in Data.Aeson.Patch

type Rep Operation = D1 ('MetaData "Operation" "Data.Aeson.Patch" "aeson-diff-1.1.0.13-4xcUBXffJWD3K6i4xKImYa" 'False) ((C1 ('MetaCons "Add" 'PrefixI 'True) (S1 ('MetaSel ('Just "changePointer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pointer) :*: S1 ('MetaSel ('Just "changeValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :+: (C1 ('MetaCons "Cpy" 'PrefixI 'True) (S1 ('MetaSel ('Just "changePointer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pointer) :*: S1 ('MetaSel ('Just "fromPointer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pointer)) :+: C1 ('MetaCons "Mov" 'PrefixI 'True) (S1 ('MetaSel ('Just "changePointer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pointer) :*: S1 ('MetaSel ('Just "fromPointer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pointer)))) :+: (C1 ('MetaCons "Rem" 'PrefixI 'True) (S1 ('MetaSel ('Just "changePointer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pointer)) :+: (C1 ('MetaCons "Rep" 'PrefixI 'True) (S1 ('MetaSel ('Just "changePointer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pointer) :*: S1 ('MetaSel ('Just "changeValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :+: C1 ('MetaCons "Tst" 'PrefixI 'True) (S1 ('MetaSel ('Just "changePointer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pointer) :*: S1 ('MetaSel ('Just "changeValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)))))

Modification

modifyPointer :: (Pointer -> Pointer) -> Operation -> Operation Source #

Modify the Pointers in an Operation.

If the operation contains multiple pointers (i.e. a Mov or Cpy) then both will be modified.

modifyPointers :: (Pointer -> Pointer) -> Patch -> Patch Source #

Modify the pointers in the Operations of a Patch.

See modifyPointer for details.

Predicates