summaryrefslogtreecommitdiff
path: root/lib/ur/list.ur
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ur/list.ur')
-rw-r--r--lib/ur/list.ur14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur
index 32a9679c..2679d877 100644
--- a/lib/ur/list.ur
+++ b/lib/ur/list.ur
@@ -206,6 +206,20 @@ fun foldlMap [a] [b] [c] f =
fold []
end
+fun find [a] f =
+ let
+ fun find' ls =
+ case ls of
+ [] => None
+ | x :: ls =>
+ if f x then
+ Some x
+ else
+ find' ls
+ in
+ find'
+ end
+
fun search [a] [b] f =
let
fun search' ls =