-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Extract and apply patches to JSON documents.
--
-- This is a small library for working with changes to JSON documents. It
-- includes a library and two command-line executables in the style of
-- the diff(1) and patch(1) commands available on many systems.
@package aeson-diff
@version 1.1.0.0
module Data.Aeson.Pointer
-- | Pointer to a location in a JSON document.
--
-- Defined in RFC 6901 http://tools.ietf.org/html/rfc6901
newtype Pointer
Pointer :: Path -> Pointer
[pointerPath] :: Pointer -> Path
-- | Traverse a single layer of a JSON document.
data Key
-- | Traverse a Value with an Object constructor.
OKey :: Text -> Key
-- | Traverse a Value with an Array constructor.
AKey :: Int -> Key
-- | Report an error following a pointer.
pointerFailure :: Path -> Value -> Result a
-- | A sequence of Keys forms a path through a JSON document.
type Path = [Key]
-- | Format a Pointer as described in RFC 6901.
formatPointer :: Pointer -> Text
-- | Get the value at a Path.
get :: Pointer -> Value -> Result Value
instance GHC.Base.Monoid Data.Aeson.Pointer.Pointer
instance GHC.Show.Show Data.Aeson.Pointer.Pointer
instance GHC.Classes.Eq Data.Aeson.Pointer.Pointer
instance GHC.Show.Show Data.Aeson.Pointer.Key
instance GHC.Classes.Ord Data.Aeson.Pointer.Key
instance GHC.Classes.Eq Data.Aeson.Pointer.Key
instance Data.Aeson.Types.Class.ToJSON Data.Aeson.Pointer.Key
instance Data.Aeson.Types.Class.FromJSON Data.Aeson.Pointer.Key
instance Data.Aeson.Types.Class.ToJSON Data.Aeson.Pointer.Pointer
instance Data.Aeson.Types.Class.FromJSON Data.Aeson.Pointer.Pointer
module Data.Aeson.Patch
-- | Describes the changes between two JSON documents.
newtype Patch
Patch :: [Operation] -> Patch
[patchOperations] :: Patch -> [Operation]
-- | 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.
data Operation
-- | http://tools.ietf.org/html/rfc6902#section-4.1
Add :: Pointer -> Value -> Operation
[changePointer] :: Operation -> Pointer
[changeValue] :: Operation -> Value
-- | http://tools.ietf.org/html/rfc6902#section-4.2
Rem :: Pointer -> Operation
[changePointer] :: Operation -> Pointer
-- | http://tools.ietf.org/html/rfc6902#section-4.3
Rep :: Pointer -> Value -> Operation
[changePointer] :: Operation -> Pointer
[changeValue] :: Operation -> Value
-- | http://tools.ietf.org/html/rfc6902#section-4.4
Mov :: Pointer -> Pointer -> Operation
[changePointer] :: Operation -> Pointer
[fromPointer] :: Operation -> Pointer
-- | http://tools.ietf.org/html/rfc6902#section-4.5
Cpy :: Pointer -> Pointer -> Operation
[changePointer] :: Operation -> Pointer
[fromPointer] :: Operation -> Pointer
-- | http://tools.ietf.org/html/rfc6902#section-4.6
Tst :: Pointer -> Value -> Operation
[changePointer] :: Operation -> Pointer
[changeValue] :: Operation -> Value
isRem :: Operation -> Bool
isTst :: Operation -> Bool
instance GHC.Base.Monoid Data.Aeson.Patch.Patch
instance GHC.Show.Show Data.Aeson.Patch.Patch
instance GHC.Classes.Eq Data.Aeson.Patch.Patch
instance GHC.Show.Show Data.Aeson.Patch.Operation
instance GHC.Classes.Eq Data.Aeson.Patch.Operation
instance Data.Aeson.Types.Class.ToJSON Data.Aeson.Patch.Patch
instance Data.Aeson.Types.Class.FromJSON Data.Aeson.Patch.Patch
instance Data.Aeson.Types.Class.ToJSON Data.Aeson.Patch.Operation
instance Data.Aeson.Types.Class.FromJSON Data.Aeson.Patch.Operation
-- | 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.
module Data.Aeson.Diff
-- | Describes the changes between two JSON documents.
newtype Patch
Patch :: [Operation] -> Patch
[patchOperations] :: Patch -> [Operation]
-- | Pointer to a location in a JSON document.
--
-- Defined in RFC 6901 http://tools.ietf.org/html/rfc6901
data Pointer
-- | Traverse a single layer of a JSON document.
data Key
-- | Traverse a Value with an Object constructor.
OKey :: Text -> Key
-- | Traverse a Value with an Array constructor.
AKey :: Int -> Key
-- | 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.
data Operation
-- | http://tools.ietf.org/html/rfc6902#section-4.1
Add :: Pointer -> Value -> Operation
[changePointer] :: Operation -> Pointer
[changeValue] :: Operation -> Value
-- | http://tools.ietf.org/html/rfc6902#section-4.2
Rem :: Pointer -> Operation
[changePointer] :: Operation -> Pointer
-- | http://tools.ietf.org/html/rfc6902#section-4.3
Rep :: Pointer -> Value -> Operation
[changePointer] :: Operation -> Pointer
[changeValue] :: Operation -> Value
-- | http://tools.ietf.org/html/rfc6902#section-4.4
Mov :: Pointer -> Pointer -> Operation
[changePointer] :: Operation -> Pointer
[fromPointer] :: Operation -> Pointer
-- | http://tools.ietf.org/html/rfc6902#section-4.5
Cpy :: Pointer -> Pointer -> Operation
[changePointer] :: Operation -> Pointer
[fromPointer] :: Operation -> Pointer
-- | http://tools.ietf.org/html/rfc6902#section-4.6
Tst :: Pointer -> Value -> Operation
[changePointer] :: Operation -> Pointer
[changeValue] :: Operation -> Value
data Config
Config :: Bool -> Config
[configTstBeforeRem] :: Config -> Bool
-- | Compare two JSON documents and generate a patch describing the
-- differences.
--
-- Uses the defaultConfig.
diff :: Value -> Value -> Patch
-- | Compare two JSON documents and generate a patch describing the
-- differences.
diff' :: Config -> Value -> Value -> Patch
-- | Apply a patch to a JSON document.
patch :: Patch -> Value -> Result Value
-- | Apply an Operation to a Value.
applyOperation :: Operation -> Value -> Result Value