comparison lib/ur/listPair.ur @ 1885:8297968cf7ef

Rename ListPair.map2 to ListPair.mp
author Adam Chlipala <adam@chlipala.net>
date Mon, 04 Nov 2013 08:38:20 -0500
parents 5c30eea7aa78
children
comparison
equal deleted inserted replaced
1884:5c30eea7aa78 1885:8297968cf7ef
32 | _ => False 32 | _ => False
33 in 33 in
34 all' 34 all'
35 end 35 end
36 36
37 fun map2 [a] [b] [c] (f : a -> b -> c) = 37 fun mp [a] [b] [c] (f : a -> b -> c) =
38 let 38 let
39 fun map2' ls1 ls2 = 39 fun map' ls1 ls2 =
40 case (ls1, ls2) of 40 case (ls1, ls2) of
41 ([], []) => [] 41 ([], []) => []
42 | (x1 :: ls1, x2 :: ls2) => f x1 x2 :: map2' ls1 ls2 42 | (x1 :: ls1, x2 :: ls2) => f x1 x2 :: map' ls1 ls2
43 | _ => error <xml>ListPair.map2: Unequal list lengths</xml> 43 | _ => error <xml>ListPair.map2: Unequal list lengths</xml>
44 in 44 in
45 map2' 45 map'
46 end 46 end