diff options
Diffstat (limited to 'lib/ur/listPair.ur')
-rw-r--r-- | lib/ur/listPair.ur | 10 |
1 files changed, 10 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 |