diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ur/list.ur | 6 |
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 |