Elm Exactly
Results / elm-core /

ArrayUnsafeGetCharElementTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Array.get 1` on an `Array Char` of `'x'` and `'y'` returns `Just 'y'`.

Results

elm-0.19.1

passran in 50 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: Just 'y'
match: True

elm-0.19.2

passran in 86 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: Just 'y'
match: True

elm-0.19.3

passran in 68 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: Just 'y'
match: True

lamdera-1.5.0

passran in 62 ms
Output
result: Just 'y'
match: True

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module ArrayUnsafeGetCharElementTest exposing (main)
{-| `Array.get 1` on an `Array Char` of `'x'` and `'y'` returns `Just 'y'`.
-}
-- CHECK: result: Just 'y'
-- CHECK: match: True
import Array
import Html exposing (text)
main =
let
arr =
Array.fromList [ 'x', 'y' ]
result =
Array.get 1 arr
_ =
Debug.log "result" result
_ =
Debug.log "match" (result == Just 'y')
in
text "done"