ListMap2FloatSumTest
`List.map2 (+)` on two `List Float`s adds the elements pairwise; `[ 1.5, 2.5 ]` and `[ 10.5, 20.5 ]` give `[12,23]` and the result equals `[ 12.0, 23.0 ]`. `Debug.log` prints a whole-number Float without a decimal point.
Results
elm-0.19.1
passran in 86 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. result: [12,23] match: True
elm-0.19.2
passran in 70 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. result: [12,23] match: True
elm-0.19.3
passran in 65 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. result: [12,23] match: True
lamdera-1.5.0
passran in 66 msOutput
result: [12,23] match: True
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/ListMap2FloatSumTest] in its title.
Source
The -- CHECK: lines give the expected output.
module ListMap2FloatSumTest exposing (main)
{-| `List.map2 (+)` on two `List Float`s adds the elements pairwise; `[ 1.5, 2.5 ]`
and `[ 10.5, 20.5 ]` give `[12,23]` and the result equals `[ 12.0, 23.0 ]`.
`Debug.log` prints a whole-number Float without a decimal point.
-}
-- CHECK: result: [12,23]
-- CHECK: match: True
import Html exposing (text)
main =
let
result =
List.map2 (+) [ 1.5, 2.5 ] [ 10.5, 20.5 ]
_ =
Debug.log "result" result
_ =
Debug.log "match" (result == [ 12.0, 23.0 ])
in
text "done"