<INTERFACE> The <CD/ListXProd/ structure <SEEALSO> <PP> The <STRREF NOLINK/ListXProd/ structure provides functions for computing with the cross product of two lists. For purposes of documentation, we define the cross product of two lists as the the list produced by the following function: `fun xProd (l1, l2) = let fun mkPair a b = (a,b) in List.foldr (fn (a,l) => (map (mkPair a) l2)@l) [] l1 end` <SPEC> <VAL>appX<TY>(('a * 'b) -> 'c) -> ('a list * 'b list) -> unit <COMMENT> <PROTOTY> appX <ARG/f/ (<ARG/l1/, <ARG/l2/) </PROTOTY> applies <ARG/f/ to the cross product of the two lists. This is equivalent to: `List.app f (xProd(l1,l2))` <SPEC> <VAL>mapX<TY>(('a * 'b) -> 'c) -> ('a list * 'b list) -> 'c list <COMMENT> <PROTOTY> mapX <ARG/f/ (<ARG/l/, <ARG/l2/) </PROTOTY> creates a new list by mapping <ARG/f/ across the cross product of the two lists. This is equivalent to: `List.map f (xProd(l1,l2))` <SPEC> <VAL>foldX<TY>(('a * 'b * 'c) -> 'c) -> ('a list * 'b list) -> 'c -> 'c <COMMENT> <PROTOTY> foldX <ARG/f/ (<ARG/l/, <ARG/l2/) <ARG/a/ </PROTOTY> fold <ARG/f/ across the cross product of the two lists. This is equivalent to: `List.foldl (fn((a,b),c) => f(a,b,c)) a (xProd(l1,l2))` </INTERFACE>