Elm Exactly
Results / elm-core /

EmbeddedNilFoldTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`List.map List.length` over a list of lists, two of them empty, gives 0 for
each empty list.

Results

elm-0.19.1

passran in 56 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
lengths: [0,3,0,1]

elm-0.19.2

passran in 56 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
lengths: [0,3,0,1]

elm-0.19.3

passran in 74 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
lengths: [0,3,0,1]

lamdera-1.5.0

passran in 92 ms
Output
lengths: [0,3,0,1]

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module EmbeddedNilFoldTest exposing (main)
{-| `List.map List.length` over a list of lists, two of them empty, gives 0 for
each empty list.
-}
-- CHECK: lengths: [0,3,0,1]
import Html exposing (text)
main =
let
lists =
[ [], [ 1, 2, 3 ], [], [ 42 ] ]
lengths =
List.map List.length lists
_ = Debug.log "lengths" lengths
in
text "done"