Idris2Doc : JSON.Simple.FromJSON

JSON.Simple.FromJSON

(source)
Interface and utilities for marshalling Idris2 values from JSON
via an intermediate `Value` representation.

For regular algebraic data types, implementations can automatically
be derived using elaborator reflection (see module `Derive.FromJSON`)

Operators and functionality strongly influenced by Haskell's aeson
library

Definitions

dataJSONPathElement : Type
Totality: total
Visibility: public export
Constructors:
Key : String->JSONPathElement
Index : Bits32->JSONPathElement

Hints:
EqJSONPathElement
ShowJSONPathElement
JSONPath : Type
Totality: total
Visibility: public export
JSONErr : Type
Totality: total
Visibility: public export
Result : Type->Type
Totality: total
Visibility: public export
Parser : Type->Type->Type
Totality: total
Visibility: public export
orElse : Eitherab-> Lazy (Eitherab) ->Eitherab
Totality: total
Visibility: public export
(<|>) : Parserva->Parserva->Parserva
Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 2
dataDecodingErr : Type
Totality: total
Visibility: public export
Constructors:
JErr : JSONErr->DecodingErr
JParseErr : ParseErrorVoid->DecodingErr

Hints:
EqDecodingErr
InterpolationDecodingErr
ShowDecodingErr
DecodingResult : Type->Type
Totality: total
Visibility: public export
formatRelativePath : JSONPath->String
  Format a <http://goessner.net/articles/JsonPath/ JSONPath> as a 'String'
which represents the path relative to some root object.

Totality: total
Visibility: export
formatPath : JSONPath->String
  Format a <http://goessner.net/articles/JsonPath/ JSONPath> as a 'String',
representing the root object as @$@.

Totality: total
Visibility: export
formatError : JSONPath->String->String
  Annotate an error message with a
<http://goessner.net/articles/JsonPath/ JSONPath> error location.

Totality: total
Visibility: export
=DEPRECATED=
prettyErr : String->DecodingErr->String
  Pretty prints a decoding error. In case of a parsing error,
this might be printed on several lines.

DEPRECATED: Use `interpolate` instead

Totality: total
Visibility: export
interfaceFromJSON : Type->Type
Parameters: a
Constructor: 
MkFromJSON

Methods:
fromJSON : ParserJSONa

Implementations:
FromJSONJSON
FromJSONVoid
FromJSON ()
FromJSONBool
FromJSONDouble
FromJSONBits8
FromJSONBits16
FromJSONBits32
FromJSONBits64
FromJSONInt
FromJSONInt8
FromJSONInt16
FromJSONInt32
FromJSONInt64
FromJSONNat
FromJSONInteger
FromJSONString
FromJSONChar
FromJSONa=>FromJSON (Maybea)
FromJSONa=>FromJSON (Lista)
FromJSONa=>FromJSON (SnocLista)
FromJSONa=>FromJSON (List1a)
Ordk=>FromJSONKeyk=>FromJSONv=>FromJSON (SortedMapkv)
FromJSONa=>FromJSON (Vectna)
FromJSONa=>FromJSONb=>FromJSON (Eitherab)
FromJSONa=>FromJSONb=>FromJSON (a, b)
All (FromJSON.f) ts=>FromJSON (Allfts)
All (FromJSON.f) ts=>FromJSON (Allfts)
fromJSON : FromJSONa=>ParserJSONa
Totality: total
Visibility: public export
interfaceFromJSONKey : Type->Type
Parameters: a
Constructor: 
MkFromJSONKey

Methods:
fromKey : ParserStringa

Implementations:
FromJSONKeyBool
FromJSONKeyDouble
FromJSONKeyBits8
FromJSONKeyBits16
FromJSONKeyBits32
FromJSONKeyBits64
FromJSONKeyInt
FromJSONKeyInt8
FromJSONKeyInt16
FromJSONKeyInt32
FromJSONKeyInt64
FromJSONKeyNat
FromJSONKeyInteger
FromJSONKeyString
FromJSONKeyChar
fromKey : FromJSONKeya=>ParserStringa
Totality: total
Visibility: public export
decode : FromJSONa=>String->DecodingResulta
Totality: total
Visibility: export
decodeEither : FromJSONa=>String->EitherStringa
Totality: total
Visibility: export
decodeMaybe : FromJSONa=>String->Maybea
Totality: total
Visibility: export
typeOf : JSON->String
Totality: total
Visibility: export
fail : String->Resulta
Totality: total
Visibility: export
modifyFailure : (String->String) ->Resulta->Resulta
Totality: total
Visibility: export
prependFailure : String->Resulta->Resulta
  If the inner 'Parser' failed, prepend the given string to the failure
message.

Totality: total
Visibility: export
prependContext : String->Resulta->Resulta
Totality: total
Visibility: export
prependPath : Resulta->JSONPathElement->Resulta
Totality: total
Visibility: export
withKey : ParserStringa->ParserStringa
Totality: total
Visibility: export
withObject : Lazy String->Parser (List (String, JSON)) a->ParserJSONa
Totality: total
Visibility: export
withBoolean : Lazy String->ParserBoola->ParserJSONa
Totality: total
Visibility: export
withString : Lazy String->ParserStringa->ParserJSONa
Totality: total
Visibility: export
withNull : String->t->ParserJSONt
Totality: total
Visibility: export
eqString : Lazy String->String->ParserJSON ()
Totality: total
Visibility: export
withDouble : Lazy String->ParserDoublea->ParserJSONa
Totality: total
Visibility: export
withInteger : Lazy String->ParserIntegera->ParserJSONa
Totality: total
Visibility: export
withIntegerKey : ParserIntegera->ParserStringa
Totality: total
Visibility: export
boundedIntegral : Numa=> Lazy String->Integer->Integer->ParserJSONa
Totality: total
Visibility: export
boundedIntegralKey : Numa=>Integer->Integer->ParserStringa
Totality: total
Visibility: export
withArray : Lazy String->Parser (ListJSON) a->ParserJSONa
Totality: total
Visibility: export
withArrayN : (n : Nat) -> Lazy String->Parser (VectnJSON) a->ParserJSONa
Totality: total
Visibility: export
explicitParseField : ParserJSONa->List (String, JSON) ->ParserStringa
  See `field`

Totality: total
Visibility: export
explicitParseFieldMaybe : ParserJSONa->List (String, JSON) ->ParserString (Maybea)
  See `fieldMaybe`

Totality: total
Visibility: export
explicitParseFieldMaybe' : ParserJSONa->List (String, JSON) ->ParserStringa
  See `optField`

Totality: total
Visibility: export
field : FromJSONa=>List (String, JSON) ->ParserStringa
  Retrieve the value associated with the given key of an `IObject`.
The result is `empty` if the key is not present or the value cannot
be converted to the desired type.

This accessor is appropriate if the key and value /must/ be present
in an object for it to be valid. If the key and value are
optional, use `optField` instead.

Totality: total
Visibility: export
fieldMaybe : FromJSONa=>List (String, JSON) ->ParserString (Maybea)
  Retrieve the value associated with the given key of an `IObject`. The
result is `Nothing` if the key is not present or if its value is `Null`,
or `empty` if the value cannot be converted to the desired type.

This accessor is most useful if the key and value can be absent
from an object without affecting its validity. If the key and
value are mandatory, use `field` instead.

Totality: total
Visibility: export
optField : FromJSONa=>List (String, JSON) ->ParserStringa
  Retrieve the value associated with the given key of an `IObject`
passing on `Null` in case the given key is missing.

This differs from `fieldMaybe` in that it can be used with any converter
accepting `Null` as an input.

Totality: total
Visibility: export
fieldWithDeflt : FromJSONa=>List (String, JSON) -> Lazy a->ParserStringa
  Retrieve the value associated with the given key of an `IObject`
using the given default value in case the key is missing.

Totality: total
Visibility: export
fromSingleField : Lazy String->Parser (String, JSON) a->ParserJSONa
  Tries to decode a value encoded as a single field object of the given name.

This corresponds to the `ObjectWithSingleField` option
for encoding sum types.

Totality: total
Visibility: export
fromTwoElemArray : Lazy String->Parser (String, JSON) a->ParserJSONa
  Tries to decode a value encoded as a two-element array with the given
constructor name.

This corresponds to the `TwoElemArray` option
for encoding sum types.

Totality: total
Visibility: export
fromTaggedObject : Lazy String->String->String->Parser (String, JSON) a->ParserJSONa
  Tries to decode a value encoded as a tagged object with the given
tag and content field, plus tag value.

This corresponds to the `TaggedObject` option
for encoding sum types.

Totality: total
Visibility: export