       raise_undefined_behaviour e, struct, {^struct, :fetch, [^container, ^key], _}
   end
 
-  def fetch(%{} = map, key) do
-    :maps.find(key, map)
+  def fetch(map, key) when is_map(map) do
+    Map.fetch(map, key)
   end
 
   def fetch(list, key) when is_list(list) and is_atom(key) do
-    case :lists.keyfind(key, 1, list) do
-      {^key, value} -> {:ok, value}
-      false -> :error
-    end
+    Keyword.fetch(list, key)
   end
 
   def fetch(list, key) when is_list(list) do

  end

  @doc ~S"""
  Accesses the element at the given index in a tuple.

  Raises if the index is out of bounds.


  @callback get(term :: t, key, default :: value) :: value

  @doc """
  Invoked in order to access the value under `key` and update it at the same time.

  The implementation of this callback should invoke the passed function with the
  value under key `key` in the passed structure, or `nil` if the key is not
  present. This function should return either `{value_to_return, new_value}` or
  `:pop`.

  If it returns `{value_to_return, new_value}`, the return value of this
  callback should be `{value_to_return, new_term}` where `new_term` is `term`
  after updating the value of `key` with `new_value`.

  If it returns `:pop`, the return value of this callback should be `{value,
  new_term}` where `value` is the value under `key` or `nil` if not present, and
  `new_term` is `term` without the key `key`.

  See the implementations of `Map.get_and_update/3` or `Keyword.get_and_update/3`
  for more examples.
