TestIndexedMap3
`Array.indexedMap` with a function that ignores the index returns the elements unchanged, `[10, 20, 30]`.
Results
elm-0.19.1
passran in 55 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. idx1: [10,20,30]
elm-0.19.2
passran in 45 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. idx1: [10,20,30]
elm-0.19.3
passran in 72 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. idx1: [10,20,30]
lamdera-1.5.0
passran in 74 msOutput
idx1: [10,20,30]
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/TestIndexedMap3] in its title.
Source
The -- CHECK: lines give the expected output.
module TestIndexedMap3 exposing (main)
{-| `Array.indexedMap` with a function that ignores the index returns the
elements unchanged, `[10, 20, 30]`.
-}
-- CHECK: idx1: [10,20,30]
import Array
import Html exposing (text)
main =
let
arr = Array.fromList [10, 20, 30]
_ = Debug.log "idx1" (Array.toList (Array.indexedMap (\i v -> v) arr))
in
text "done"