TupleMapFirstTest
`Tuple.mapFirst` applies a function to the first component of a pair and leaves the second unchanged.
Results
elm-0.19.1
passran in 80 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. mapFirst1: (2,10) mapFirst2: (10,20)
elm-0.19.2
passran in 62 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. mapFirst1: (2,10) mapFirst2: (10,20)
elm-0.19.3
passran in 53 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. mapFirst1: (2,10) mapFirst2: (10,20)
lamdera-1.5.0
passran in 40 msOutput
mapFirst1: (2,10) mapFirst2: (10,20)
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/TupleMapFirstTest] in its title.
Source
The -- CHECK: lines give the expected output.
module TupleMapFirstTest exposing (main)
{-| `Tuple.mapFirst` applies a function to the first component of a pair and leaves the second unchanged.
-}
-- CHECK: mapFirst1: (2,10)
-- CHECK: mapFirst2: (10,20)
import Html exposing (text)
main =
let
_ = Debug.log "mapFirst1" (Tuple.mapFirst (\x -> x * 2) (1, 10))
_ = Debug.log "mapFirst2" (Tuple.mapFirst (\x -> x + 5) (5, 20))
in
text "done"