aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gleam/list.gleam8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam
index 38a6607..6977338 100644
--- a/src/gleam/list.gleam
+++ b/src/gleam/list.gleam
@@ -796,9 +796,9 @@ pub fn all(in list: List(a), satisfying predicate: fn(a) -> Bool) -> Bool {
fn do_all(list: List(a), predicate: fn(a) -> Bool, accumulator: Bool) -> Bool {
case list {
- // _ if accumulator == False -> False
+ _ if accumulator == False -> False
[] -> accumulator
- [x, ..rest] -> do_all(rest, predicate, accumulator && predicate(x))
+ [x, ..rest] -> do_all(rest, predicate, predicate(x) && accumulator)
}
}
@@ -831,9 +831,9 @@ pub fn any(in list: List(a), satisfying predicate: fn(a) -> Bool) -> Bool {
fn do_any(list: List(a), predicate: fn(a) -> Bool, accumulator: Bool) -> Bool {
case list {
- // _ if accumulator == True -> True
+ _ if accumulator == True -> True
[] -> accumulator
- [x, ..rest] -> do_any(rest, predicate, accumulator || predicate(x))
+ [x, ..rest] -> do_any(rest, predicate, predicate(x) || accumulator)
}
}