package core_kernel

  1. Overview
  2. Docs
Industrial strength alternative to OCaml's standard library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.14.2.tar.gz
sha256=66f5353964d35a994ec7fdc88fe60ae5d497ac89a8042786f3e37d9e2202ce4b
md5=ede2f6d22eaa8320f88bac67d41b5cff

doc/core_kernel.univ/Univ/index.html

Module UnivSource

An extensible "universal" variant type.

Every type id (Type_equal.Id.t) corresponds to one branch of the variant type.

Sourcetype t
Sourceval sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
Sourceval type_id_name : t -> string
Sourceval create : 'a Core_kernel.Type_equal.Id.t -> 'a -> t
Sourceval does_match : t -> _ Core_kernel.Type_equal.Id.t -> bool

does_match t id returns true iff t was created by create id v.

Sourceval match_ : t -> 'a Core_kernel.Type_equal.Id.t -> 'a option

match_ t id returns Some v if t was created by create id v, and returns None otherwise.

match_exn t id returns v if t was created by create id v, and raises otherwise.

Sourceval match_exn : t -> 'a Core_kernel.Type_equal.Id.t -> 'a
Sourcemodule View : sig ... end
Sourceval view : t -> View.t

view t provides access to the GADT representation of t. This is currently the same as the underlying representation, but is put in the View module to make later changes to the underlying representation easier.