Elm Exactly
Results / elm-core /

TupleIndexedCharTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`List.indexedMap Tuple.pair` over the characters of `"Hello"` builds `( Int, Char )` pairs, and the first one is `(0,'H')`.

Results

elm-0.19.1

passran in 47 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
first: (0,'H')

elm-0.19.2

passran in 76 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
first: (0,'H')

elm-0.19.3

passran in 63 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
first: (0,'H')

lamdera-1.5.0

passran in 75 ms
Output
first: (0,'H')

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module TupleIndexedCharTest exposing (main)
{-| `List.indexedMap Tuple.pair` over the characters of `"Hello"` builds `( Int, Char )` pairs, and the first one is `(0,'H')`.
-}
-- CHECK: first: (0,'H')
import Html exposing (text)
main =
let
indexed =
List.indexedMap Tuple.pair (String.toList "Hello")
first =
Maybe.withDefault ( -1, 'x' ) (List.head indexed)
_ =
Debug.log "first" first
in
text "done"