Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
Pointer to a location in a JSON document.
Defined in RFC 6901 http://tools.ietf.org/html/rfc6901
Path components to traverse a single layer of a JSON document.
Instances
FromJSON Key Source # | |
ToJSON Key Source # | |
Generic Key Source # | |
Show Key Source # | |
Eq Key Source # | |
Ord Key Source # | |
type Rep Key Source # | |
Defined in Data.Aeson.Pointer type Rep Key = D1 ('MetaData "Key" "Data.Aeson.Pointer" "aeson-diff-1.1.0.13-DRg7BlM6gRx53RQtSWPzyR" 'False) (C1 ('MetaCons "OKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Key)) :+: C1 ('MetaCons "AKey" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
Representing pointers
formatPointer :: Pointer -> Text Source #
Format a Pointer
as described in RFC 6901.
>>>
formatPointer (Pointer [])
"">>>
formatPointer (Pointer [OKey ""])
"/">>>
formatPointer (Pointer [OKey " "])
"/ ">>>
formatPointer (Pointer [OKey "foo"])
"/foo">>>
formatPointer (Pointer [OKey "foo", AKey 0])
"/foo/0">>>
formatPointer (Pointer [OKey "a/b"])
"/a~1b">>>
formatPointer (Pointer [OKey "c%d"])
"/c%d">>>
formatPointer (Pointer [OKey "e^f"])
"/e^f">>>
formatPointer (Pointer [OKey "g|h"])
"/g|h">>>
formatPointer (Pointer [OKey "i\\j"])
"/i\\j">>>
formatPointer (Pointer [OKey "k\"l"])
"/k\"l">>>
formatPointer (Pointer [OKey "m~n"])
"/m~0n"