package n_ary

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

Defines a tuple type containing 3 values. We refer to each value as a "part". Parts are numbered consecutively beginning at zero.

type ('a0, 'a1, 'a2) t = 'a0 * 'a1 * 'a2
include Ppx_compare_lib.Comparable.S3 with type ('a0, 'a1, 'a2) t := ('a0, 'a1, 'a2) t
val compare : 'a Base__Ppx_compare_lib.compare -> 'b Base__Ppx_compare_lib.compare -> 'c Base__Ppx_compare_lib.compare -> ('a, 'b, 'c) t Base__Ppx_compare_lib.compare
include Ppx_compare_lib.Equal.S3 with type ('a0, 'a1, 'a2) t := ('a0, 'a1, 'a2) t
val equal : 'a Base__Ppx_compare_lib.equal -> 'b Base__Ppx_compare_lib.equal -> 'c Base__Ppx_compare_lib.equal -> ('a, 'b, 'c) t Base__Ppx_compare_lib.equal
include Ppx_hash_lib.Hashable.S3 with type ('a0, 'a1, 'a2) t := ('a0, 'a1, 'a2) t
val hash_fold_t : 'a Base__Ppx_hash_lib.hash_fold -> 'b Base__Ppx_hash_lib.hash_fold -> 'c Base__Ppx_hash_lib.hash_fold -> ('a, 'b, 'c) t Base__Ppx_hash_lib.hash_fold
val sexp_of_t : ('a0 -> Sexplib0.Sexp.t) -> ('a1 -> Sexplib0.Sexp.t) -> ('a2 -> Sexplib0.Sexp.t) -> ('a0, 'a1, 'a2) t -> Sexplib0.Sexp.t
val create : 'a0 -> 'a1 -> 'a2 -> ('a0, 'a1, 'a2) t

Constructor

Accessors

val part0 : ('a, _, _) t -> 'a
val part1 : (_, 'a, _) t -> 'a
val part2 : (_, _, 'a) t -> 'a

Functional update

val set_part0 : (_, 'a1, 'a2) t -> 'a0 -> ('a0, 'a1, 'a2) t
val set_part1 : ('a0, _, 'a2) t -> 'a1 -> ('a0, 'a1, 'a2) t
val set_part2 : ('a0, 'a1, _) t -> 'a2 -> ('a0, 'a1, 'a2) t
val map : ('a0, 'a1, 'a2) t -> f0:('a0 -> 'b0) -> f1:('a1 -> 'b1) -> f2:('a2 -> 'b2) -> ('b0, 'b1, 'b2) t

Map all parts

Map individual parts

val map_part0 : ('b, 'a1, 'a2) t -> f:('b -> 'c) -> ('c, 'a1, 'a2) t
val map_part1 : ('a0, 'b, 'a2) t -> f:('b -> 'c) -> ('a0, 'c, 'a2) t
val map_part2 : ('a0, 'a1, 'b) t -> f:('b -> 'c) -> ('a0, 'a1, 'c) t
OCaml

Innovation. Community. Security.