Extensions to the core Dict library.
Group a list of items by a key.
Supply an indexing function (eg. .id) and a list of
items. groupBy returns a dictionary of group-key/list-of-items.
If the indexing function returns a unique key for every item, consider indexBy instead.
Create a frequency-map from the given list.
Attempt to find a key, if it's not there, return a default value.
Run a function over the dictionary entries, resulting in a list of the final results.
Apply an Elm update function - Model -> (Model, Cmd Msg) - to a Dict entry, if present.
It's quite common in Elm to want to run a model-update function, over some dictionary of models, but only if that model is available.
This function makes it more convenient to reach inside a Dict and
apply an update. If the data is not there, the Dict is returned
unchanged with a Cmd.none.
Turn a list of items into an indexed dictionary.
Supply an indexing function (eg.
.id) and a list of items.indexByreturns a dictionary with each item stored under its index.This code assumes each index is unique. If that is not the case, you should use
groupByinstead.