Elm Exactly
Results / elm-core /

ArrayMapFloatIncrementTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Array.map ((+) 0.5)` over an `Array Float` of 1.5 and 2.5 gives exactly 2.0 and 3.0.

Results

elm-0.19.1

passran in 53 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
result: [2,3]
match: True

elm-0.19.2

passran in 50 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
result: [2,3]
match: True

elm-0.19.3

passran in 67 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
result: [2,3]
match: True

lamdera-1.5.0

passran in 38 ms
Output
result: [2,3]
match: True

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module ArrayMapFloatIncrementTest exposing (main)
{-| `Array.map ((+) 0.5)` over an `Array Float` of 1.5 and 2.5 gives exactly 2.0 and 3.0.
-}
-- CHECK: result: [2,3]
-- CHECK: match: True
import Array
import Html exposing (text)
main =
let
arr =
Array.fromList [ 1.5, 2.5 ]
result =
Array.toList (Array.map ((+) 0.5) arr)
_ =
Debug.log "result" result
_ =
Debug.log "match" (result == [ 2.0, 3.0 ])
in
text "done"