aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/list.gleam11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/list.gleam b/src/list.gleam
index ccc674b..9293f50 100644
--- a/src/list.gleam
+++ b/src/list.gleam
@@ -168,3 +168,14 @@ pub fn all(list, f) {
}
}
}
+
+pub fn any(list, f) {
+ case list {
+ | [] -> False
+ | [ x | rest] ->
+ case f(x) {
+ | False -> any(rest, f)
+ | _ -> True
+ }
+ }
+}