Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Aeson.Patch
Contents
Description
Synopsis
- newtype Patch = Patch {
- patchOperations :: [Operation]
- data Operation
- = Add {
- changePointer :: Pointer
- changeValue :: Value
- | Cpy { }
- | Mov { }
- | Rem { }
- | Rep {
- changePointer :: Pointer
- changeValue :: Value
- | Tst {
- changePointer :: Pointer
- changeValue :: Value
- = Add {
- modifyPointer :: (Pointer -> Pointer) -> Operation -> Operation
- modifyPointers :: (Pointer -> Pointer) -> Patch -> Patch
- isAdd :: Operation -> Bool
- isRem :: Operation -> Bool
- isRep :: Operation -> Bool
- isMov :: Operation -> Bool
- isCpy :: Operation -> Bool
- isTst :: Operation -> Bool
Documentation
Describes the changes between two JSON documents.
Constructors
Patch | |
Fields
|
Instances
Eq Patch Source # | |
Show Patch Source # | |
Generic Patch Source # | |
Semigroup Patch Source # | |
Monoid Patch Source # | |
FromJSON Patch Source # | |
Defined in Data.Aeson.Patch | |
ToJSON Patch Source # | |
Defined in Data.Aeson.Patch Methods toEncoding :: Patch -> Encoding toJSONList :: [Patch] -> Value toEncodingList :: [Patch] -> Encoding | |
type Rep Patch Source # | |
Defined in Data.Aeson.Patch |
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
Eq Operation Source # | |
Show Operation Source # | |
Generic Operation Source # | |
FromJSON Operation Source # | |
Defined in Data.Aeson.Patch | |
ToJSON Operation Source # | |
Defined in Data.Aeson.Patch Methods toEncoding :: Operation -> Encoding toJSONList :: [Operation] -> Value toEncodingList :: [Operation] -> Encoding | |
type Rep Operation Source # | |
Defined in Data.Aeson.Patch type Rep Operation = D1 ('MetaData "Operation" "Data.Aeson.Patch" "aeson-diff-1.1.0.9-FU0rwNsqoVMEEGMmr1rem9" '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
modifyPointers :: (Pointer -> Pointer) -> Patch -> Patch Source #
Modify the pointers in the Operation
s of a Patch
.
See modifyPointer
for details.