Preface_stdlib.Pair
Implementation for Pair.t
.
Pair.t
is the simplest product type. In addition to allowing the generic description of product types, it allows the description of a conjunction.
module Bifunctor : Preface_specs.BIFUNCTOR with type ('a, 'b) t = ('a, 'b) t
Additional functions to facilitate practical work with Pair.t
.
val fst : ('a, 'b) t -> 'a
Extract the first component of a pair.
val snd : ('a, 'b) t -> 'b
Extract the second component of a pair.
val curry : (('a, 'b) t -> 'c) -> 'a -> 'b -> 'c
Convert a function which take a pair to a curried version.
val uncurry : ('a -> 'b -> 'c) -> ('a, 'b) t -> 'c
Convert a curried function to a function which take a pair.
Equality between Pair.t
.
val pp :
(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> 'b -> unit) ->
Stdlib.Format.formatter ->
('a, 'b) t ->
unit
Formatter for pretty-printing for Pair.t
.
module Infix : sig ... end
val (&) : 'a -> 'b -> ('a, 'b) t