Elm Exactly
Results / elm-core /

EmbeddedConstantsInListTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`List.filterMap identity` on a list mixing `Nothing` and `Just` values keeps
the `Just` payloads in order.

Results

elm-0.19.1

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

elm-0.19.2

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

elm-0.19.3

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

lamdera-1.5.0

passran in 96 ms
Output
filtered: [1,2]

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module EmbeddedConstantsInListTest exposing (main)
{-| `List.filterMap identity` on a list mixing `Nothing` and `Just` values keeps
the `Just` payloads in order.
-}
-- CHECK: filtered: [1,2]
import Html exposing (text)
main =
let
items =
[ Nothing, Just 1, Nothing, Just 2, Nothing ]
filtered =
List.filterMap identity items
_ = Debug.log "filtered" filtered
in
text "done"