Sky.Core.Json.Decode
Sky.Core.Json.Decode — JSON decoders (Layer 3 Sky source).
Values
andThen : (a -> Decoder b) -> Decoder a -> Decoder bat : List String -> Decoder a -> Decoder a
`at path decoder` — drill into nested fields.
bool : Decoder BooldecodeString : Decoder a -> String -> Result Error a
Run a decoder against a JSON string. The string must hold ONE JSON
decodeValue : Decoder a -> Value -> Result Error a
Run a decoder against a `Value` that is already in memory: a sub-document
fail : String -> Decoder a
A decoder that always fails with the given error message.
field : String -> Decoder a -> Decoder a
`field name decoder` — decode the named object field.
float : Decoder Floatindex : Int -> Decoder a -> Decoder a
`index n decoder` — decode the n-th element of an array.
int : Decoder Intlist : Decoder a -> Decoder (List a)map : (a -> b) -> Decoder a -> Decoder bmap2 : (a -> b -> c) -> Decoder a -> Decoder b -> Decoder cmap3 : (a -> b -> c -> d) -> Decoder a -> Decoder b -> Decoder c -> Decoder dmap4 : (a -> b -> c -> d -> e) -> Decoder a -> Decoder b -> Decoder c -> Decoder d -> Decoder emap5 : (a -> b -> c -> d -> e -> f) -> Decoder a -> Decoder b -> Decoder c -> Decoder d -> Decoder e -> Decoder fmaybe : Decoder a -> Decoder (Maybe a)
Run the decoder and never fail: `Just` its value when it succeeds,
null : a -> Decoder a
Succeed with the given value when the JSON value is `null`; fail on
nullable : Decoder a -> Decoder (Maybe a)
Decode a value that may be `null`: `null` gives `Nothing`, any other
oneOf : List (Decoder a) -> Decoder a
Try each decoder in turn; succeed with the first to match.
string : Decoder Stringsucceed : a -> Decoder a
A decoder that always succeeds with the given value.
value : Decoder Value
The JSON at this point, unchanged, as a `Value` — the same type