A.OrdMap.first

You're seeing just the function first, go back to A.OrdMap module for more information.
Link to this function

first(ord_map, default \\ nil)

View Source

Specs

first(t(k, v), default) :: {k, v} | default
when k: key(), v: value(), default: term()

Finds the fist {key, value} pair in ord_map.

Returns a {key, value} entry if ord_map is non-empty, or nil else.

Examples

iex> A.OrdMap.new([b: "B", d: "D", a: "A", c: "C"]) |> A.OrdMap.first()
{:b, "B"}
iex> A.OrdMap.new([]) |> A.OrdMap.first()
nil
iex> A.OrdMap.new([]) |> A.OrdMap.first(:error)
:error