EmbeddedNilFoldTest
`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 msOutput
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 msOutput
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 msOutput
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 msOutput
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"