This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Dictionary that can store any type, without configuration.
version 1.0.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2018-08-11 23:42:51 UTC
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1



Elm Dict

A dictionary mapping keys to values. This dictionary can use any (non-function) type as a key. The Dict in the core libraries can only use comparable keys. AllDict uses regular equality, (==) for comparing keys, and thus, works for anything but functions.

Unlike other dictionaries, this implementation allows one to set predicates on the retrieval of values, which allows one to do things like these:

   import AllDict exposing (Dict, withPredicate)

   withDefaultValue10 =
           |> Dict.withPredicate (always True) 10
           |> Dict.insert "Another value" 42

   Dict.get "Hey" withDefaultValue10 == Just 10

   Dict.get "Nice!" withDefaultValue10 == Just 10

   Dict.get "Another value" withDefaultValue10 == Just 42