Elm Exactly
Results / elm-core /

ArrayUnsafeSetCharOverwriteTest

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
`Array.set 0 'b'` on a one-element `Array Char` holding `'a'` replaces it, so `Array.get 0`
then returns `Just 'b'`.

Results

elm-0.19.1

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

elm-0.19.2

passran in 45 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 'b'
match: True

elm-0.19.3

passran in 67 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 'b'
match: True

lamdera-1.5.0

passran in 57 ms
Output
result: Just 'b'
match: True

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module ArrayUnsafeSetCharOverwriteTest exposing (main)
{-| `Array.set 0 'b'` on a one-element `Array Char` holding `'a'` replaces it, so `Array.get 0`
then returns `Just 'b'`.
-}
-- CHECK: result: Just 'b'
-- CHECK: match: True
import Array
import Html exposing (text)
main =
let
arr1 =
Array.fromList [ 'a' ]
arr2 =
Array.set 0 'b' arr1
result =
Array.get 0 arr2
_ =
Debug.log "result" result
_ =
Debug.log "match" (result == Just 'b')
in
text "done"