package n_ary

  1. Overview
  2. Docs

Module N_ary.Enum3Source

Defines an enumeration type with 3 constructors. We refer to each constructor as a "case". Cases and their respective int values are numbered consecutively starting at zero.

Sourcetype t =
  1. | Case0
  2. | Case1
  3. | Case2
include Ppx_compare_lib.Comparable.S with type t := t
Sourceval compare : t -> t -> int
include Ppx_enumerate_lib.Enumerable.S with type t := t
Sourceval all : t list
include Ppx_compare_lib.Equal.S with type t := t
Sourceval equal : t -> t -> bool
include Ppx_hash_lib.Hashable.S with type t := t
Sourceval hash_fold_t : Base.Hash.state -> t -> Base.Hash.state
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t

Constants *

Sourceval case0 : t
Sourceval case1 : t
Sourceval case2 : t

Predicates

Sourceval is_case0 : t -> Base.bool
Sourceval is_case1 : t -> Base.bool
Sourceval is_case2 : t -> Base.bool

Conversions to and from int *

Sourceval to_int : t -> Base.int
Sourceval of_int : Base.int -> t Base.option
Sourceval of_int_exn : Base.int -> t
OCaml

Innovation. Community. Security.