   Gets the value under key from the dict,
   raises KeyError if such key does not exist.
   """
+  @spec get!(t, key :: term) :: term | no_return
   def get!(dict, key) when is_tuple(dict) do
     case dict_get(dict, key) do
       { ^key, value } -> value

      #=> HashDict[a: 1, b: 2]

  """
  def new(pairs) do
    Enum.reduce pairs, ordered(), fn { k, v }, dict ->
      put(dict, k, v)

  @doc """
  Checks if the dict has the given key.
  """
  @spec has_key?(t, key :: term) :: boolean
  def has_key?(dict, key) do
    match? { ^key, _ }, dict_get(dict, key)
  end
