Elm Exactly
Results / elm-core /

TestIndexedMap2

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Array.map` applies a function to every element: doubling `[10, 20, 30]`
gives `[20, 40, 60]`.

Results

elm-0.19.1

passran in 86 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
map1: [20,40,60]

elm-0.19.2

passran in 64 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
map1: [20,40,60]

elm-0.19.3

passran in 57 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
map1: [20,40,60]

lamdera-1.5.0

passran in 76 ms
Output
map1: [20,40,60]

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module TestIndexedMap2 exposing (main)
{-| `Array.map` applies a function to every element: doubling `[10, 20, 30]`
gives `[20, 40, 60]`.
-}
-- CHECK: map1: [20,40,60]
import Array
import Html exposing (text)
main =
let
arr = Array.fromList [10, 20, 30]
_ = Debug.log "map1" (Array.toList (Array.map (\x -> x * 2) arr))
in
text "done"