IdentityMap (Anoma v0.29.0)

A map with an identity value; all keys not explicitly assigned a value map to the identity.

Summary

Types

@type t(k, v) :: %IdentityMap{
  identity: k,
  identityp: function(),
  map: %{required(k) => v}
}

Functions

@spec get(t(key(), value()), key()) :: value()
Link to this function

new(from \\ %{}, identity, identityp)

@spec new(%{required(key()) => value()}, value(), (value() -> boolean())) ::
  t(key(), value())
Link to this function

put(map, key, value)

@spec put(t(key(), value()), key(), value()) :: t(key(), value())
Link to this function

update(map, key, fun)

@spec update(t(key(), value()), key(), (value() -> value())) :: term()