Module NesPair

val map_fst : ('a -> 'c) -> ('a * 'b) -> 'c * 'b

Map the given function to the first component of the pair.

val map_fst_lwt : ('a -> 'c Lwt.t) -> ('a * 'b) -> ('c * 'b) Lwt.t

Lwt version of map_fst.

val map_snd : ('b -> 'd) -> ('a * 'b) -> 'a * 'd

Map the given function to the second component of the pair.

val map : ('a -> 'c) -> ('b -> 'd) -> ('a * 'b) -> 'c * 'd

Map the given functions on the arguments of the pair.

val map_both : ('a -> 'b) -> ('a * 'a) -> 'b * 'b

Map the given function on both arguments of the pair.

val map2 : ('a -> 'c -> 'e) -> ('b -> 'd -> 'f) -> ('a * 'b) -> ('c * 'd) -> 'e * 'f

Map the given functions on the arguments of the two pairs. map2 f g (x1, y1) (x2, y2) is (f x1 x2, g y1 y2).

val cons : 'a -> 'b -> 'a * 'b

Construct a pair. This is meant to be partially applied, eg. cons x is the function that adds x in front of its argument.

val snoc : 'b -> 'a -> 'a * 'b

Construct a pair, from arguments in reverse order. This is meant to be partially applied, eg. snoc y is the function that adds y after its argument.