Dictionary.singleton
Dictionary.singletonkeyvalue
Documentation
Returns a single-element dictionary with the given key and value. A Call to Dictionary.singleton key value
is the same as a call to Dictionary.empty.insert key value
.
Arguments
key
: The key to to use forvalue
in the dictionary.value
: The value to store under 'key' in the dictionary.
Examples
Create a single element dictionary storing the key "my_key" and the
value 2.
example_singleton = Dictionary.singleton "my_key" 2