base
Full standard library replacement for OCaml
1024" x-on:close-sidebar="sidebar=window.innerWidth > 1024 && true">
package base
-
base
-
-
base.base_internalhash_types
-
base.caml
-
base.md5
-
base.shadow_stdlib
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Library base
val sexp_of_t : ( 'a -> Sexplib0.Sexp.t ) -> 'a t -> Sexplib0.Sexp.t
module Uid : sig ... end
Every Id.t
contains a unique id that is distinct from the Uid.t
in any other Id.t
.
create ~name
defines a new type identity. Two calls to create
will result in two distinct identifiers, even for the same arguments with the same type. If the type 'a
doesn't support sexp conversion, then a good practice is to have the converter be [%sexp_of: _]
, (or sexp_of_opaque
, if not using ppx_sexp_conv).
Accessors
val hash : _ t -> int
val name : _ t -> string
val hash_fold_t : Hash.state -> _ t -> Hash.state
same_witness t1 t2
and same_witness_exn t1 t2
return a type equality proof iff the two identifiers are the same (i.e., physically equal, resulting from the same call to create
). This is a useful way to achieve a sort of dynamic typing. same_witness
does not allocate a Some
every time it is called.
same t1 t2 = is_some (same_witness t1 t2)
.
ON THIS PAGE
No table of contents