@@ -1593,7 +1593,11 @@ defmodule Enum do
15931593 defp max_sort_fun ( module ) when is_atom ( module ) , do: & ( module . compare ( & 1 , & 2 ) != :lt )
15941594
15951595 @ doc false
1596- @ spec max_by ( t , ( element -> any ) , ( ( ) -> empty_result ) ) :: element | empty_result
1596+ @ spec max_by (
1597+ t ,
1598+ ( element -> any ) ,
1599+ ( ( ) -> empty_result ) | ( element , element -> boolean ) | module ( )
1600+ ) :: element | empty_result
15971601 when empty_result: any
15981602 def max_by ( enumerable , fun , empty_fallback )
15991603 when is_function ( fun , 1 ) and is_function ( empty_fallback , 0 ) do
@@ -1644,12 +1648,6 @@ defmodule Enum do
16441648 nil
16451649
16461650 """
1647- @ spec max_by (
1648- t ,
1649- ( element -> any ) ,
1650- ( element , element -> boolean ) | module ( )
1651- ) :: element | empty_result
1652- when empty_result: any
16531651 @ spec max_by (
16541652 t ,
16551653 ( element -> any ) ,
@@ -1767,7 +1765,11 @@ defmodule Enum do
17671765 defp min_sort_fun ( module ) when is_atom ( module ) , do: & ( module . compare ( & 1 , & 2 ) != :gt )
17681766
17691767 @ doc false
1770- @ spec min_by ( t , ( element -> any ) , ( ( ) -> empty_result ) ) :: element | empty_result
1768+ @ spec min_by (
1769+ t ,
1770+ ( element -> any ) ,
1771+ ( ( ) -> empty_result ) | ( element , element -> boolean ) | module ( )
1772+ ) :: element | empty_result
17711773 when empty_result: any
17721774 def min_by ( enumerable , fun , empty_fallback )
17731775 when is_function ( fun , 1 ) and is_function ( empty_fallback , 0 ) do
@@ -1818,12 +1820,6 @@ defmodule Enum do
18181820 nil
18191821
18201822 """
1821- @ spec min_by (
1822- t ,
1823- ( element -> any ) ,
1824- ( element , element -> boolean ) | module ( )
1825- ) :: element | empty_result
1826- when empty_result: any
18271823 @ spec min_by (
18281824 t ,
18291825 ( element -> any ) ,
0 commit comments