 
   """
   @spec max(t, (() -> empty_result)) :: element | empty_result when empty_result: any
-  def max(enumerable, empty_fallback \\ fn -> raise Enum.EmptyError end) do
+  def max(enumerable, empty_fallback \\ fn -> raise Enum.EmptyError end)
+      when is_function(empty_fallback, 0) do
     aggregate(enumerable, &Kernel.max/2, empty_fallback)
   end
 

  @spec min_max_by(t, (element -> any), (() -> empty_result)) :: {element, element} | empty_result
        when empty_result: any
  def min_max_by(enumerable, fun, empty_fallback \\ fn -> raise Enum.EmptyError end)

  def min_max_by(enumerable, fun, empty_fallback) do
    first_fun = fn entry ->
      fun_entry = fun.(entry)
      {{entry, entry}, {fun_entry, fun_entry}}


  """
  @spec min(t, (() -> empty_result)) :: element | empty_result when empty_result: any
  def min(enumerable, empty_fallback \\ fn -> raise Enum.EmptyError end)
      when is_function(empty_fallback, 0) do
    aggregate(enumerable, &Kernel.min/2, empty_fallback)
  end

