Class Example_ocamldoc.pair


class ['a] pair : 'a -> 'a -> object .. end
Polymorphic class of pairs.

This is a class that may be used to represent any pair of two elements.

e1_p : The value to give to the first element of the pair.
e2_p : The value to give to the second element of the pair.

method first : 'a
Get the first element in the pair.
Returns The first element in the pair.
method second : 'a
Get the second element in the pair.
Returns The second element in the pair.
method eq : < eq : 'b; first : 'a; second : 'a; .. > -> bool as 'b
Test equality with another pair.

Checks if the first element of the pair is equal to the first element of the pair given as argument, and if the second element of the pair is equal to the second element of the pair given as argument.
Returns true if the two pairs are equal, false if not.

p : The other pair to compare the current one to.