comparison lib/ur/listPair.ur @ 846:0d30e6338c65

Some standard library reorgs and additions; handle mutual datatypes better in Specialize
author Adam Chlipala <adamc@hcoop.net>
date Tue, 09 Jun 2009 18:11:59 -0400
parents 74a1e3bdf430
children 1c2f335297b7
comparison
equal deleted inserted replaced
845:6725d73c3c31 846:0d30e6338c65
1 fun foldlPartial [a] [b] [c] f =
2 let
3 fun foldlPartial' acc ls1 ls2 =
4 case (ls1, ls2) of
5 ([], []) => Some acc
6 | (x1 :: ls1, x2 :: ls2) =>
7 (case f x1 x2 acc of
8 None => None
9 | Some acc' => foldlPartial' acc' ls1 ls2)
10 | _ => None
11 in
12 foldlPartial'
13 end
14
1 fun mapX [a] [b] [ctx ::: {Unit}] f = 15 fun mapX [a] [b] [ctx ::: {Unit}] f =
2 let 16 let
3 fun mapX' ls1 ls2 = 17 fun mapX' ls1 ls2 =
4 case (ls1, ls2) of 18 case (ls1, ls2) of
5 ([], []) => <xml/> 19 ([], []) => <xml/>