Mercurial > urweb
annotate lib/ur/listPair.ur @ 835:b0a85cbefed2
Less whining about match failures; fix singleton record Jscomp bug
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 02 Jun 2009 12:40:09 -0400 |
parents | 78504d97410b |
children | 74a1e3bdf430 |
rev | line source |
---|---|
adamc@826 | 1 fun mapX [a] [b] [ctx ::: {Unit}] f = |
adamc@801 | 2 let |
adamc@801 | 3 fun mapX' ls1 ls2 = |
adamc@801 | 4 case (ls1, ls2) of |
adamc@801 | 5 ([], []) => <xml/> |
adamc@801 | 6 | (x1 :: ls1, x2 :: ls2) => <xml>{f x1 x2}{mapX' ls1 ls2}</xml> |
adamc@801 | 7 | _ => error <xml>ListPair.mapX: Unequal list lengths</xml> |
adamc@801 | 8 in |
adamc@801 | 9 mapX' |
adamc@801 | 10 end |