ArrayMapFloatIncrementTest
`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 msOutput
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 msOutput
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 msOutput
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 msOutput
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"