diff lib/ur/listPair.ur @ 801:5f49a6b759cb

Fix nasty bugs with longjmp() looping for uw_set_input(); and bad variable indexes for nested JavaScript in jscomp
author Adam Chlipala <adamc@hcoop.net>
date Thu, 14 May 2009 18:13:09 -0400
parents
children 78504d97410b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/ur/listPair.ur	Thu May 14 18:13:09 2009 -0400
@@ -0,0 +1,10 @@
+fun mapX (a ::: Type) (b ::: Type) (ctx ::: {Unit}) f =
+    let
+        fun mapX' ls1 ls2 =
+            case (ls1, ls2) of
+                ([], []) => <xml/>
+              | (x1 :: ls1, x2 :: ls2) => <xml>{f x1 x2}{mapX' ls1 ls2}</xml>
+              | _ => error <xml>ListPair.mapX: Unequal list lengths</xml>
+    in
+        mapX'
+    end