Elm Exactly
Results / elm-core /

FromArrayCharListMapTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`List.map Char.toUpper` works on a `List Char` taken out of an `Array` with `Array.toList`.

`['a', 'b']` goes through `Array.fromList` and `Array.toList` and is upper-cased to `['A', 'B']`.

Results

elm-0.19.1

passran in 60 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.
result: ['A','B']
match: True

elm-0.19.2

passran in 72 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets.
result: ['A','B']
match: True

elm-0.19.3

passran in 44 ms
Output
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets.
result: ['A','B']
match: True

lamdera-1.5.0

passran in 50 ms
Output
result: ['A','B']
match: True

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module FromArrayCharListMapTest exposing (main)
{-| `List.map Char.toUpper` works on a `List Char` taken out of an `Array` with `Array.toList`.
`['a', 'b']` goes through `Array.fromList` and `Array.toList` and is upper-cased to `['A', 'B']`.
-}
-- CHECK: result: ['A','B']
-- CHECK: match: True
import Array
import Char
import Html exposing (text)
main =
let
arr = Array.fromList [ 'a', 'b' ]
result = List.map Char.toUpper (Array.toList arr)
_ = Debug.log "result" result
_ = Debug.log "match" (result == [ 'A', 'B' ])
in
text "done"