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