   @spec defines_spec?(module, atom, arity) :: boolean
   def defines_spec?(module, name, arity)
       when is_atom(module) and is_atom(name) and arity in 0..255 do
-    finder = fn {_kind, expr, _caller} ->
+    Enum.any?(Module.get_attribute(module, :spec), fn {_kind, expr, _caller} ->
       spec_to_signature(expr) == {name, arity}
-    end
-
-    :lists.any(finder, Module.get_attribute(module, :spec))
+    end)
   end
 
   @doc """

  end

  defp ensure_no_defaults!(args) do
    foreach_fun = fn
      {:::, _, [left, right]} ->
        ensure_not_default(left)
        ensure_not_default(right)

      compile_error(caller, "expected key-value pairs in struct #{Macro.to_string(name)}")
    end

    types =
      Enum.map(struct, fn {field, _} ->
        {field, Keyword.get(fields, field, quote(do: term()))}
      end)

    Enum.each(fields, fn {field, _} ->
      unless Keyword.has_key?(struct, field) do
        compile_error(caller, "undefined field #{field} on struct #{Macro.to_string(name)}")
      end
    end)

    typespec({:%{}, meta, [__struct__: module] ++ types}, vars, caller)
  end
