Often we find ourselves working with pairs of lists or lists of pairs. The ListPair structure in the standard library provides a useful collection of operations on values of such data types. Once again, the functions provided are self-explanatory.
ListPair.all : ('a * 'b -> bool) -> 'a list * 'b list -> bool ListPair.exists : ('a * 'b -> bool) -> 'a list * 'b list -> bool ListPair.foldl : ('a * 'b * 'c -> 'c) -> 'c -> 'a list * 'b list -> 'c ListPair.foldr : ('a * 'b * 'c -> 'c) -> 'c -> 'a list * 'b list -> 'c ListPair.map : ('a * 'b -> 'c) -> 'a list * 'b list -> 'c list ListPair.unzip : ('a * 'b) list -> 'a list * 'b list ListPair.zip : 'a list * 'b list -> ('a * 'b) list