Elm Exactly
Results / elm-json /

DecodeFloatTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Json.Decode.float` decodes the JSON number `3.14` to the `Float` `3.14`.

Results

elm-0.19.1

passran in 44 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
decode_float: Ok 3.14

elm-0.19.2

passran in 56 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
decode_float: Ok 3.14

elm-0.19.3

passran in 54 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
decode_float: Ok 3.14

lamdera-1.5.0

passran in 53 ms
Output
decode_float: Ok 3.14

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm-json/DecodeFloatTest] in its title.

Source

The -- CHECK: lines give the expected output.

module DecodeFloatTest exposing (main)
{-| `Json.Decode.float` decodes the JSON number `3.14` to the `Float` `3.14`.
-}
-- CHECK: decode_float: Ok 3.14
import Html exposing (text)
import Json.Decode as Decode
main =
let
_ = Debug.log "decode_float" (Decode.decodeString Decode.float "3.14")
in
text "done"