DictRemoveMinimalTest
`Dict.remove` deletes the smaller of two keys from a two-entry `Dict Int Int`, leaving a dictionary of size 1. The dictionary is built with `Dict.singleton 1 10` followed by `Dict.insert 2 20`, and key 1 is removed.
Results
elm-0.19.1
passran in 69 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. size: 1
elm-0.19.2
passran in 64 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. size: 1
elm-0.19.3
passran in 71 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. size: 1
lamdera-1.5.0
passran in 66 msOutput
size: 1
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-core/DictRemoveMinimalTest] in its title.
Source
The -- CHECK: lines give the expected output.
module DictRemoveMinimalTest exposing (main)
{-| `Dict.remove` deletes the smaller of two keys from a two-entry `Dict Int Int`, leaving a dictionary of size 1.
The dictionary is built with `Dict.singleton 1 10` followed by `Dict.insert 2 20`, and key 1 is removed.
-}
-- CHECK: size: 1
import Dict
import Html exposing (text)
main =
let
d =
Dict.insert 2 20 (Dict.singleton 1 10)
removed =
Dict.remove 1 d
_ =
Debug.log "size" (Dict.size removed)
in
text "done"