package batteries

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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

  • author Edgar Friendly
  • author Ashish Agarwal
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 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 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 with type 'a enumerable = 'a * 'a
type 'a enumerable = 'a * 'a

The data structure, e.g. 'a List.t

val enum : 'a enumerable -> 'a BatEnum.t

Return an enumeration of the elements of the data structure

val of_enum : 'a BatEnum.t -> 'a enumerable

Build a data structure from an enumeration

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 (T1 : BatOrd.Eq) (T2 : BatOrd.Eq) : BatOrd.Eq with type t = T1.t * T2.t
module Ord (T1 : BatOrd.Ord) (T2 : BatOrd.Ord) : BatOrd.Ord with type t = T1.t * T2.t
module Comp (T1 : BatOrd.Comp) (T2 : BatOrd.Comp) : BatOrd.Comp with type t = T1.t * T2.t