Data.Argonaut.Decode.Struct.Tolerant
- Package
- purescript-tolerant-argonaut
- Repository
- matthew-hilty/purescript-tolerant-argonaut
Re-exports from Data.Argonaut.Decode.Struct.Tolerant.Combinators
#getFieldOptional' Source
getFieldOptional' :: forall a. DecodeJson a => Object Json -> String -> Either String (Maybe a)
Attempt to get the value for a given key on an Object Json
.
The result will be Right Nothing
if the key and value are not present,
or if the key is present and the value is null
.
Use this accessor if the key and value are optional in your object.
If the key and value are mandatory, use getField
(.::
) instead.
#getFieldOptional Source
getFieldOptional :: forall a. DecodeJson a => Object Json -> String -> Either String (Maybe a)
Attempt to get the value for a given key on an Object Json
.
The result will be Right Nothing
if the key and value are not present,
but will fail if the key is present but the value cannot be converted
to the right type.
This function will treat null
as a value and attempt to decode it into
your desired type. If you would like to treat null
values the same as
absent values, use getFieldOptional'
(.::?
) instead.
#(.::?) Source
Operator alias for Data.Argonaut.Decode.Struct.Tolerant.Combinators.getFieldOptional' (non-associative / precedence 7)
#(.::!) Source
Operator alias for Data.Argonaut.Decode.Struct.Tolerant.Combinators.getFieldOptional (non-associative / precedence 7)
#(.::) Source
Operator alias for Data.Argonaut.Decode.Struct.Tolerant.Combinators.getField (non-associative / precedence 7)
Re-exports from Data.Argonaut.Decode.Struct.Tolerant.Cross.Utils
Re-exports from Data.Argonaut.Decode.Struct.Tolerant.DecodeJson
#DecodeJson Source
class DecodeJson a where
Members
decodeJson :: Json -> Either String a
Instances
(GDecodeJson Builder (Either String) Record Nil () l r, RowToList r l) => DecodeJson (Record r)
(DecodeJson a) => DecodeJson a
- Modules
- Data.
Argonaut. Decode. Struct - Data.
Argonaut. Decode. Struct. Cross - Data.
Argonaut. Decode. Struct. Cross. DecodeJsonWith - Data.
Argonaut. Decode. Struct. Cross. Utils - Data.
Argonaut. Decode. Struct. GDecodeJson - Data.
Argonaut. Decode. Struct. Override - Data.
Argonaut. Decode. Struct. Override. DecodeJsonPer - Data.
Argonaut. Decode. Struct. Override. Utils - Data.
Argonaut. Decode. Struct. Tolerant - Data.
Argonaut. Decode. Struct. Tolerant. Combinators - Data.
Argonaut. Decode. Struct. Tolerant. Cross. Utils - Data.
Argonaut. Decode. Struct. Tolerant. DecodeJson - Data.
Argonaut. Decode. Struct. Tolerant. GDecodeJson - Data.
Argonaut. Decode. Struct. Utils