@@ -93,7 +93,7 @@ defmodule Enum do
9393
9494 """
9595 @ spec all? ( t ) :: boolean
96- @ spec all? ( t , ( element -> boolean ) ) :: boolean
96+ @ spec all? ( t , ( element -> as_boolean ( term ) ) ) :: boolean
9797
9898 def all? ( collection , fun // fn ( x ) -> x end )
9999
@@ -130,7 +130,7 @@ defmodule Enum do
130130
131131 """
132132 @ spec any? ( t ) :: boolean
133- @ spec any? ( t , ( element -> boolean ) ) :: boolean
133+ @ spec any? ( t , ( element -> as_boolean ( term ) ) ) :: boolean
134134
135135 def any? ( collection , fun // fn ( x ) -> x end )
136136
@@ -191,7 +191,7 @@ defmodule Enum do
191191 @ doc """
192192 Counts for how many items the function returns true.
193193 """
194- @ spec count ( t , ( element -> boolean ) ) :: non_neg_integer
194+ @ spec count ( t , ( element -> as_boolean ( term ) ) ) :: non_neg_integer
195195 def count ( collection , fun ) when is_list ( collection ) do
196196 do_count ( collection , fun )
197197 end
@@ -244,7 +244,7 @@ defmodule Enum do
244244 Enum.drop_while [1,2,3,4,5], fn(x) -> x < 3 end
245245 #=> [3,4,5]
246246 """
247- @ spec drop_while ( t , ( element -> boolean ) ) :: list
247+ @ spec drop_while ( t , ( element -> as_boolean ( term ) ) ) :: list
248248 def drop_while ( collection , fun ) when is_list ( collection ) do
249249 do_drop_while ( collection , fun )
250250 end
@@ -323,7 +323,7 @@ defmodule Enum do
323323 #=> [2]
324324
325325 """
326- @ spec filter ( t , ( element -> boolean ) ) :: list
326+ @ spec filter ( t , ( element -> as_boolean ( term ) ) ) :: list
327327 def filter ( collection , fun ) when is_list ( collection ) do
328328 lc item inlist collection , fun . ( item ) , do: item
329329 end
@@ -346,7 +346,7 @@ defmodule Enum do
346346 #=> [4]
347347
348348 """
349- @ spec filter_map ( t , ( element -> boolean ) , ( element -> element ) ) :: list
349+ @ spec filter_map ( t , ( element -> as_boolean ( term ) ) , ( element -> element ) ) :: list
350350 def filter_map ( collection , filter , mapper ) when is_list ( collection ) do
351351 lc item inlist collection , filter . ( item ) , do: mapper . ( item )
352352 end
@@ -779,7 +779,7 @@ defmodule Enum do
779779 Enum.split_while [1,2,3,4], fn x -> x == 2 end
780780 #=> { [1], [2, 3, 4] }
781781 """
782- @ spec split_while ( t , ( element -> boolean ) ) :: { list , list }
782+ @ spec split_while ( t , ( element -> as_boolean ( term ) ) ) :: { list , list }
783783 def split_while ( collection , fun ) when is_list ( collection ) do
784784 do_split_while ( collection , fun , [ ] )
785785 end
@@ -838,7 +838,7 @@ defmodule Enum do
838838 #=> [1, 2]
839839
840840 """
841- @ spec take_while ( t , ( element -> boolean ) ) :: list
841+ @ spec take_while ( t , ( element -> as_boolean ( term ) ) ) :: list
842842 def take_while ( collection , fun ) when is_list ( collection ) do
843843 do_take_while ( collection , fun )
844844 end
0 commit comments