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