   end
 
   @doc """
+  Returns `true` if at least one element in `enumerable` is truthy.
+
+  When an element has a truthy value (neither `false` nor `nil`) iteration stops
+  immediately and `true` is returned. In all other cases `false` is returned.
+
+  ## Examples
+
+      iex> Enum.any?([false, false, false])
+      false
+
+      iex> Enum.any?([false, true, false])
+      true
+
+      iex> Enum.any?([])
+      false
+
+  """
+  @spec any?(t) :: boolean
+  def any?(enumerable) when is_list(enumerable) do
+    any_list(enumerable)
+  end
+
+  def any?(enumerable) do
+    Enumerable.reduce(enumerable, {:cont, false}, fn entry, _ ->
+      if entry, do: {:halt, true}, else: {:cont, false}
+    end)
+    |> elem(1)
+  end
+
+  @doc """
   Returns `true` if `fun.(element)` is truthy for at least one element in `enumerable`.
 
   Iterates over the `enumerable` and invokes `fun` on each element. When an invocation

      iex> Enum.any?([], fn x -> x > 0 end)
      false

  If no function is given, the truthiness of each element is checked during iteration.
  When an element has a truthy value (neither `false` nor `nil`) iteration stops
  immediately and `true` is returned. In all other cases `false` is returned.

      iex> Enum.any?([false, false, false])
      false

      iex> Enum.any?([false, true, false])
      true

      iex> Enum.any?([])
      false

  """
  @spec any?(t, (element -> as_boolean(term))) :: boolean

  def any?(enumerable, fun \\ fn x -> x end)

  def any?(enumerable, fun) when is_list(enumerable) do
    any_list(enumerable, fun)
  end


  ## any?

  defp any_list([h | t]) do
    if h do
      true
    else
      any_list(t)
    end
  end

  defp any_list([]) do
    false
  end

  defp any_list([h | t], fun) do
    if fun.(h) do
      true
