Renamed to j-maas/ordered-containers. That is where the repository lives now. It has not been published as a package under the new name.
Versions published as y0hy0h/ordered-containers still install under that name. 5 versions of 5 come from the new location (see their notes).
Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/j-maas/ordered-containers.
What we checked: The repo moved to github.com/j-maas/ordered-containers and tag 2.0.1 is there; its commit 48e71a74fff3 is from 2020-05-16 17:00 UTC, before the version was published (2020-05-16 17:02 UTC); every file Elm uses matches a copy in a Lamdera package cache, from before the change; elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/y0hy0h/ordered-containers/zipball/2.0.1/
A dictionary mapping unique keys to values while remembering their
insertion order. The keys can be any comparable type. This includes
Int, Float, Time, Char, String, and tuples or lists
of comparable types.
The insertion order is reflected in the functions under "Conversions" and "Transform". The order in the lists and the iteration order will be the order of insertion.
The API mirrors the core
Dict's
API, with exception for the functions listed there under
"Combine",
because these functions do not have an obvious way to handle
the order between the combined dictionaries.
Create an empty dictionary.
Create a dictionary with one key-value pair.
Insert a key-value pair into a dictionary. If the key already exists, the old value will be forgotten and the new value will be inserted at the end.
import OrderedDict
OrderedDict.empty
|> OrderedDict.insert 1 "one"
|> OrderedDict.insert 2 "two"
|> OrderedDict.insert 1 "three"
|> OrderedDict.toList
--> [ (2, "two"), (1, "three") ]Update the value of a dictionary for a specific key with a given function.
If a value exists for the key and the passed function returns a Just v,
the value will be replaced, keeping its order. If it did not exist, the
new value will be added to the end.
When the function returns a Nothing, the key is removed.
import OrderedDict
OrderedDict.empty
|> OrderedDict.insert 1 "one"
|> OrderedDict.insert 2 "two"
|> OrderedDict.update 1 (\_ -> Just "three")
|> OrderedDict.toList
--> [ (1, "three"), (2, "two") ]
OrderedDict.singleton 1 "one"
|> OrderedDict.update 2 (\_ -> Just "two")
|> OrderedDict.toList
--> [ (1, "one"), (2, "two") ]
OrderedDict.singleton 1 "one"
|> OrderedDict.update 1 (\_ -> Nothing)
|> OrderedDict.toList
--> []Remove a key-value pair from a dictionary. If the key is not found, no changes are made.
Determine if a dictionary is empty.
Determine if a key is in a dictionary.
Get the value associated with a key. If the key is not found, return Nothing.
Determine the number of key-value pairs in the dictionary.
Get all of the keys in a dictionary, in insertion order.
Get all of the values in a dictionary, in insertion order.
Convert a dictionary into an association list of key-value pairs, in insertion order.
Convert an association list into a dictionary.
Convert an ordered dictionary into a regular
Dict.
Apply a function to all values in a dictionary.
Fold over the key-value pairs in a dictionary in insertion order.
Fold over the key-value pairs in a dictionary in reverse insertion order.
Keep only the key-value pairs that pass the given test.
Partition a dictionary according to some test. The first dictionary contains all key-value pairs which passed the test, and the second contains the pairs that did not.
The order will be preserved in these new dictionaries in the sense that elements that are inserted after each other will remain ordered after each other.
A dictionary of keys and values that remembers the order of insertion.