json
json copied to clipboard
Work with JSON in Elm
Similar to [Bytes.Bytes](https://package.elm-lang.org/packages/elm/bytes/latest/Bytes#Bytes) and [Bytes.Encode](https://package.elm-lang.org/packages/elm/bytes/latest/Bytes-Encode), [Bytes.Decode](https://package.elm-lang.org/packages/elm/bytes/latest/Bytes-Decode). I would be nice to have Json.Json type and remove Encode.Value and Decode.Value. I was confused what is difference between Encode.Value and Decode.Value. And...
This fixes the equality check on oneOf decoders, and this solution will work with 0.19.1 in --optimize mode, or without --optimize. The problem can be seen in this Ellie, the...
The `oneOf` decoder stores an Elm list of decoders, but when [comparing for equality](https://github.com/elm/json/blob/1.1.3/src/Elm/Kernel/Json.js#L389) these lists are compared with `_Json_listEquality`, which compares JS arrays. The result is that `oneOf` decoders...
SSCCE: https://ellie-app.com/8zCdXgf99qCa1 On the SSCCE above I would expect the decoders for both childNodes ([NodeList](https://developer.mozilla.org/en-US/docs/Web/API/NodeList)) and children ([HTMLCollection](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection)) to decode correctly to a list - this is similar to how...
# SSCCE ``` > import Json.Encode as JE > JE.object [ ("a", JE.list identity []) ] == JE.object [] True : Bool > JE.object [ ("a", JE.object []) ] ==...
# SSCCE ``` elm repl > import Json.Decode as JD > import Json.Encode as JE > JD.decodeString (JD.index -1 JD.value) "[]" |> Result.map (\v -> JE.object [("a", JE.null)] == v)...
I wasn't sure if this should be reported in elm/compiler or here, but it is a curious case, and I lost some hours trying to figure out why it won't...
I have the following Type called `Message` with the following code ```elm module Types.Message exposing (Message, decode, decodeList) import Json.Decode as Decode exposing (Decoder, Error, list) import Json.Decode.Pipeline exposing (required)...
Suggestion: Add a function (perhaps called `error`) that is like `fail`, except it receives an `Error` value instead of a `String` as its argument. This would be useful in functions...
With this commit, tests run again (I believe they last ran with elm 0.18.0). I have used the same approach as https://github.com/elm/core/pull/1017/ to get these tests running. I have also...