diff lib/ur/list.ur @ 818:066493f7f008

Change List.mapM' to avoid leaving functions around
author Adam Chlipala <adamc@hcoop.net>
date Thu, 21 May 2009 11:45:04 -0400
parents e92cfac1608f
children 395a5d450cc0
line wrap: on
line diff
--- a/lib/ur/list.ur	Thu May 21 10:34:56 2009 -0400
+++ b/lib/ur/list.ur	Thu May 21 11:45:04 2009 -0400
@@ -44,8 +44,8 @@
     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