DecodeListTest
`Json.Decode.list` decodes a JSON array of numbers to a `List Int`.
Results
elm-0.19.1
passran in 81 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. decode_list: Ok [1,2,3]
elm-0.19.2
passran in 40 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. decode_list: Ok [1,2,3]
elm-0.19.3
passran in 50 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. decode_list: Ok [1,2,3]
lamdera-1.5.0
passran in 50 msOutput
decode_list: Ok [1,2,3]
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-json/DecodeListTest] in its title.
Source
The -- CHECK: lines give the expected output.
module DecodeListTest exposing (main)
{-| `Json.Decode.list` decodes a JSON array of numbers to a `List Int`.
-}
-- CHECK: decode_list: Ok [1,2,3]
import Html exposing (text)
import Json.Decode as Decode
main =
let
_ = Debug.log "decode_list" (Decode.decodeString (Decode.list Decode.int) "[1,2,3]")
in
text "done"