Elm Exactly
Results / elm-core /

ListMapTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
Checks `List.map` with top-level functions that double and square, on a
three-element list and on an empty list.

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.
map1: [2,4,6]
map2: []
map3: [1,4,9]

elm-0.19.2

passran in 69 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: [2,4,6]
map2: []
map3: [1,4,9]

elm-0.19.3

passran in 43 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: [2,4,6]
map2: []
map3: [1,4,9]

lamdera-1.5.0

passran in 83 ms
Output
map1: [2,4,6]
map2: []
map3: [1,4,9]

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module ListMapTest exposing (main)
{-| Checks `List.map` with top-level functions that double and square, on a
three-element list and on an empty list.
-}
-- CHECK: map1: [2,4,6]
-- CHECK: map2: []
-- CHECK: map3: [1,4,9]
import Html exposing (text)
double x = x * 2
square x = x * x
main =
let
_ = Debug.log "map1" (List.map double [1, 2, 3])
_ = Debug.log "map2" (List.map double [])
_ = Debug.log "map3" (List.map square [1, 2, 3])
in
text "done"