package core_kernel

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

Install

Dune Dependency

Authors

Maintainers

Sources

v0.13.1.tar.gz
sha256=2e9dec37cf1b1a05fa3ad24ae8efd1e389b82928d598db097771405da1d6b214
md5=ee4f3b03ce7fa4cb0c27e9b02cc7712d

doc/core_kernel.univ/Univ/index.html

Module Univ

An extensible "universal" variant type.

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

type t
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val type_id_name : t -> string
val type_id_uid : t -> Core_kernel.Type_equal.Id.Uid.t
val create : 'a Core_kernel.Type_equal.Id.t -> 'a -> t
val does_match : t -> _ Core_kernel.Type_equal.Id.t -> bool

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

val 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.

val match_exn : t -> 'a Core_kernel.Type_equal.Id.t -> 'a
module View : sig ... end
val 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.

OCaml

Innovation. Community. Security.