summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2016-09-28 14:53:45 +0200
committerGitHub <noreply@github.com>2016-09-28 14:53:45 +0200
commit3a343bb12233fe0b8ea13e23eb9081d94670aa99 (patch)
tree2c6df6cedcd36ac0f34486929d0e779b6910dfa2
parent8eae1166fdcfceab553abf8947b0e33b59c8087e (diff)
downloadelixir-3a343bb12233fe0b8ea13e23eb9081d94670aa99.tar.gz
Improve summaries for any/all
-rw-r--r--lib/elixir/lib/enum.ex12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/elixir/lib/enum.ex b/lib/elixir/lib/enum.ex
index db2f75825..edaaec260 100644
--- a/lib/elixir/lib/enum.ex
+++ b/lib/elixir/lib/enum.ex
@@ -205,10 +205,9 @@ defmodule Enum do
end
@doc """
- Invokes the given `fun` for each item in the enumerable.
+ Returns true if the given `fun` evaluates to true on all of the items in the enumerable.
+
It stops the iteration at the first invocation that returns `false` or `nil`.
- It returns `false` if at least one invocation returns `false` or `nil`.
- Otherwise returns `true`.
## Examples
@@ -244,10 +243,9 @@ defmodule Enum do
end
@doc """
- Invokes the given `fun` for each item in the enumerable.
- It stops the iteration at the first invocation that returns a truthy value.
- Returns `true` if at least one invocation returns a truthy value.
- Otherwise returns `false`.
+ Returns true if the given `fun` evaluates to true on any of the items in the enumerable.
+
+ It stops the iteration at the first invocation that returns a truthy value (not `false` or `nil`).
## Examples