Elm Exactly
Results / elm-core /

ListPartitionTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`List.partition` splits a list into the elements that satisfy a predicate and those that do not, each in its original order.

Partitioning 1 to 5 by `isEven` gives `([2,4],[1,3,5])`.

Results

elm-0.19.1

passran in 92 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
partition1: ([2,4],[1,3,5])

elm-0.19.2

passran in 96 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
partition1: ([2,4],[1,3,5])

elm-0.19.3

passran in 56 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
partition1: ([2,4],[1,3,5])

lamdera-1.5.0

passran in 76 ms
Output
partition1: ([2,4],[1,3,5])

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module ListPartitionTest exposing (main)
{-| `List.partition` splits a list into the elements that satisfy a predicate and those that do not, each in its original order.
Partitioning 1 to 5 by `isEven` gives `([2,4],[1,3,5])`.
-}
-- CHECK: partition1: ([2,4],[1,3,5])
import Html exposing (text)
isEven n = modBy 2 n == 0
main =
let
_ = Debug.log "partition1" (List.partition isEven [1, 2, 3, 4, 5])
in
text "done"