An experiment with adding stronger error-types to JSON decoders.
Decode a JSON string into an Elm String.
Decode a JSON boolean into an Elm Bool.
Decode a JSON number into an Elm Int.
Decode a JSON number into an Elm Float.
Decode a value that must exist but could be null.
Decodes a JSON array into an Elm List.
Decode a JSON array into an Elm Array.
Decode a JSON object into an Elm Dict.
Decodes a JSON object into a list of key-value pairs.
Decodes the contents of the field named in the first argument with the passed decoder.
Decodes the contents of the field named by following the path constructed by the fieldnames passed as the first arg with the given decoder.
Decode the value at a given index in a JSON array.
Decode a value that may or may not exist, or might be malformed.
Tries these decoders one by one. The first one to succeed will have its value returned. If no decoders were passed or all decoders fail, you'll get an error.
Parse the given string into a JSON value and then run the Decoder on it.
This will fail if the string is not well-formed JSON or if the Decoder fails
for some reason.
Run a Decoder on some JSON Value. You can send these JSON values through
ports, so that is probably the main time you would use this function.
A JSON value.
A path through your JSON that leads to the problematic value.
A piece of the path, either a field or an index in an array.
A decode error.
A specific type of error.
A type mistmatch.
A structural issue with your JSON.
Allow using a classical Json.Decode.Decoder decoder.
Allow using an exploration decoder in a regular Json.Decode context.
Transform a decoder by mapping the result.
Execute a function on the result of 2 decoders.
Execute a function on the result of 3 decoders.
Execute a function on the result of 4 decoders.
Execute a function on the result of 5 decoders.
Creates a lazy decoder, useful for recursive structures.
Doesn't modify the JS value, just returns it.
Decode a JSON null into an Elm value.
A decoder that always succeeds.
A decoder that always fails.
Executes a second decoder with the result of another decoder as its first argument.
A Decoder is simply a function that turns a
Valueinto aResult Error a