summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 18:13:09 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 18:13:09 -0400
commit79655b086c036d07806d0c345ffc9e6683891fe4 (patch)
tree87cfafea0f563a41839fe248cd4de81e8a8efed1 /lib
parentc69e0c432107906261ab4c56cd88a8cfab3191fb (diff)
Fix nasty bugs with longjmp() looping for uw_set_input(); and bad variable indexes for nested JavaScript in jscomp
Diffstat (limited to 'lib')
-rw-r--r--lib/ur/listPair.ur10
-rw-r--r--lib/ur/listPair.urs2
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/ur/listPair.ur b/lib/ur/listPair.ur
new file mode 100644
index 00000000..9a56f75a
--- /dev/null
+++ b/lib/ur/listPair.ur
@@ -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
diff --git a/lib/ur/listPair.urs b/lib/ur/listPair.urs
new file mode 100644
index 00000000..55a34b3a
--- /dev/null
+++ b/lib/ur/listPair.urs
@@ -0,0 +1,2 @@
+val mapX : a ::: Type -> b ::: Type -> ctx ::: {Unit}
+ -> (a -> b -> xml ctx [] []) -> list a -> list b -> xml ctx [] []