view lib/ur/listPair.ur @ 840:e4a02e4fa35c

Fix unbound name problem in Jscomp injectors; more List stuff
author Adam Chlipala <adamc@hcoop.net>
date Sat, 06 Jun 2009 15:29:34 -0400
parents 78504d97410b
children 74a1e3bdf430
line wrap: on
line source
fun mapX [a] [b] [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