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.ur11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur
index 0aae9010..89dc8bbd 100644
--- a/lib/ur/list.ur
+++ b/lib/ur/list.ur
@@ -150,3 +150,14 @@ fun search [a] [b] f =
search'
end
+fun foldlM [m] (_ : monad m) [a] [b] f =
+ let
+ fun foldlM' acc ls =
+ case ls of
+ [] => return acc
+ | x :: ls =>
+ acc <- f x acc;
+ foldlM' acc ls
+ in
+ foldlM'
+ end