   end
 
   defp filter(_op, data, _func, _next) do
-    raise "Access.filter/1 expected a list, got: #{inspect data}"
+    raise "Access.filter/1 expected a list, got: #{inspect(data)}"
   end
 
   defp get_and_update_filter([head | rest], func, next, updates, gets) do

      iex> get_in(%{}, [Access.filter(fn a -> a == 10 end)])
      ** (RuntimeError) Access.filter/1 expected a list, got: %{}
  """
  @spec filter(((term) -> boolean)) :: access_fun(data :: list, get_value :: list)
  def filter(func) when is_function(func) do
    fn(op, data, next) -> filter(op, data, func, next) end
  end

  defp filter(:get, data, func, next) when is_list(data) do

  See the implementations of `Map.get_and_update/3` or `Keyword.get_and_update/3`
  for more examples.
  """
  @callback get_and_update(data, key, (value -> {get_value, value} | :pop)) :: {get_value, data}
            when get_value: var,
                 data: container | any_container

  @doc """
  Invoked to "pop" the value under `key` out of the given data structure.
