aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/ur/list.ur
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ur/list.ur')
-rw-r--r--lib/ur/list.ur6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur
index 2ee60538..7079f6bc 100644
--- a/lib/ur/list.ur
+++ b/lib/ur/list.ur
@@ -44,8 +44,8 @@ fun mapM (m ::: (Type -> Type)) (_ : monad m) (a ::: Type) (b ::: Type) f =
let
fun mapM' acc ls =
case ls of
- [] => acc
- | x :: ls => mapM' (x' <- f x; ls' <- acc; return (x' :: ls')) ls
+ [] => return (rev acc)
+ | x :: ls => x' <- f x; mapM' (x' :: acc) ls
in
- mapM' (return [])
+ mapM' []
end