     find_invalid(expr) || :ok
   end
 
-  defp find_invalid({left, right}), do:
-    find_invalid(left) || find_invalid(right)
-
-  defp find_invalid({left, meta, right}) when is_list(meta) and (is_atom(right) or is_list(right)), do:
-    find_invalid(left) || find_invalid(right)
-
-  defp find_invalid(list) when is_list(list), do:
-    Enum.find_value(list, &find_invalid/1)
-
-  defp find_invalid(pid)  when is_pid(pid),    do: nil
-  defp find_invalid(atom) when is_atom(atom),  do: nil
-  defp find_invalid(num)  when is_number(num), do: nil
-  defp find_invalid(bin)  when is_binary(bin), do: nil
+  defp find_invalid({left, right}), do: find_invalid(left) || find_invalid(right)
+
+  defp find_invalid({left, meta, right}) when is_list(meta) and (is_atom(right) or is_list(right)),
+       do: find_invalid(left) || find_invalid(right)
+
+  defp find_invalid(list) when is_list(list), do: Enum.find_value(list, &find_invalid/1)
+
+  defp find_invalid(pid) when is_pid(pid), do: nil
+  defp find_invalid(atom) when is_atom(atom), do: nil
+  defp find_invalid(num) when is_number(num), do: nil
+  defp find_invalid(bin) when is_binary(bin), do: nil
 
   defp find_invalid(fun) when is_function(fun) do
     unless :erlang.fun_info(fun, :env) == {:env, []} and
-           :erlang.fun_info(fun, :type) == {:type, :external} do
+             :erlang.fun_info(fun, :type) == {:type, :external} do
       {:error, fun}
     end
   end

      to_string(expr, fun)
    end
  end
  defp module_to_string(expr, fun) do
    to_string(expr, fun)
  end


  # Lists
  def to_string(list, fun) when is_list(list) do
    result =
      cond do
        list == [] ->
          "[]"

        :io_lib.printable_list(list) ->
          {escaped, _} = Identifier.escape(IO.chardata_to_string(list), ?')
          IO.iodata_to_binary([?', escaped, ?'])

        Inspect.List.keyword?(list) ->
          "[" <> kw_list_to_string(list, fun) <> "]"

        true ->
          "[" <> Enum.map_join(list, ", ", &to_string(&1, fun)) <> "]"
      end

    fun.(list, result)
  end

  # All other structures
