Module BatTuple.Tuple2

module Tuple2: sig .. end

Pairs. Some of the functions here are also exposed in Pervasives, as documented below.


type ('a, 'b) t = 'a * 'b 
val make : 'a -> 'b -> 'a * 'b
val first : 'a * 'b -> 'a

Equivalent to Pervasives.fst.

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

Equivalent to Pervasives.snd.

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

Equivalent to BatPervasives.
(***)
.

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

Like BatTuple.Tuple2.map but specialized for tuples with elements of the same type.

mapn f is equivalent to map f f.

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

map1 f (x,y) returns (f x,y)

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

map2 f (x,y) returns (x,f y)

val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c
val enum : 'a enumerable -> 'a BatEnum.t
val of_enum : 'a BatEnum.t -> 'a enumerable
val print : ?first:string ->
?sep:string ->
?last:string ->
('o BatIO.output -> 'a -> unit) ->
('o BatIO.output -> 'b -> unit) -> 'o BatIO.output -> 'a * 'b -> unit
val printn : ?first:string ->
?sep:string ->
?last:string ->
('o BatIO.output -> 'a -> unit) -> 'o BatIO.output -> 'a * 'a -> unit
val compare : ?cmp1:('a -> 'a -> int) ->
?cmp2:('b -> 'b -> int) -> 'a * 'b -> 'a * 'b -> int
include BatEnum.Enumerable
val eq : 'a BatOrd.eq -> 'b BatOrd.eq -> ('a * 'b) BatOrd.eq
val ord : 'a BatOrd.ord -> 'b BatOrd.ord -> ('a * 'b) BatOrd.ord
val comp : 'a BatOrd.comp -> 'b BatOrd.comp -> ('a * 'b) BatOrd.comp
module Eq: 
functor (T1 : BatOrd.Eq-> 
functor (T2 : BatOrd.Eq-> Eq with type t = T1.t * T2.t
module Ord: 
functor (T1 : BatOrd.Ord-> 
functor (T2 : BatOrd.Ord-> Ord with type t = T1.t * T2.t
module Comp: 
functor (T1 : BatOrd.Comp-> 
functor (T2 : BatOrd.Comp-> Comp with type t = T1.t * T2.t