package regular

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

Data digesting for caching.

include Core_kernel.Std.Identifiable with type t = digest
type t = digest
val bin_t : t Bin_prot.Type_class.t
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (Core_kernel__.Import.int -> t) Bin_prot.Read.reader
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_shape_t : Bin_prot.Shape.t
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val of_string : string -> t
val to_string : t -> string
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (<) : t -> t -> bool
val (<>) : t -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val min : t -> t -> t
val max : t -> t -> t
val ascending : t -> t -> int
val descending : t -> t -> int
val between : t -> low:t -> high:t -> bool
val clamp_exn : t -> min:t -> max:t -> t
val clamp : t -> min:t -> max:t -> t Base__.Or_error.t
type comparator_witness
val validate_lbound : min:t Base__.Maybe_bound.t -> t Base__.Validate.check
val validate_ubound : max:t Base__.Maybe_bound.t -> t Base__.Validate.check
val validate_bound : min:t Base__.Maybe_bound.t -> max:t Base__.Maybe_bound.t -> t Base__.Validate.check
module Replace_polymorphic_compare : sig ... end
val comparator : (t, comparator_witness) Core_kernel__.Comparator.comparator
module Map : sig ... end
module Set : sig ... end
val hash : t -> Core_kernel__.Import.int
val hashable : t Core_kernel__.Hashable.Hashtbl.Hashable.t
module Table : sig ... end
module Hash_set : sig ... end
module Hash_queue : sig ... end
val pp : Base__.Import.Caml.Format.formatter -> t -> unit
val create : namespace:string -> t

create ~namespace create a digest initialized with the given namespace. Since a caching service is using a flat namespace of keys, the namespace parameter is used to distinguish data build by different functions that have the same parameters digests. A module name is a good candidate for the namespace.

val add : t -> ('a, Format.formatter, unit, t) Core_kernel.Std.format4 -> 'a

add digest fmt x y z ... is a variadic function that builds a string from arguments x y z ... using specified format fmt and adds this string to the digest.

val add_sexp : t -> ('a -> Core_kernel.Std.Sexp.t) -> 'a -> t

add_sexp d sexp_of x is add d "%a" Sexp.pp (sexp_of x)

OCaml

Innovation. Community. Security.