package ocaml-base-compiler

  1. Overview
  2. Docs

Representation and manipulation of types.

type private_flag = Odoc_type.private_flag =
  1. | Private
  2. | Public
type record_field = Odoc_type.record_field = {
  1. rf_name : string;
    (*

    Name of the field.

    *)
  2. rf_mutable : bool;
    (*

    true if mutable.

    *)
  3. rf_type : Types.type_expr;
    (*

    Type of the field.

    *)
  4. mutable rf_text : info option;
    (*

    Optional description in the associated comment.

    *)
}

Description of a record type field.

type constructor_args = Odoc_type.constructor_args =
  1. | Cstr_record of record_field list
  2. | Cstr_tuple of Types.type_expr list

Description of a variant type constructor.

type variant_constructor = Odoc_type.variant_constructor = {
  1. vc_name : string;
    (*

    Name of the constructor.

    *)
  2. vc_args : constructor_args;
  3. vc_ret : Types.type_expr option;
  4. mutable vc_text : info option;
    (*

    Optional description in the associated comment.

    *)
}
type type_kind = Odoc_type.type_kind =
  1. | Type_abstract
    (*

    Type is abstract, for example type t.

    *)
  2. | Type_variant of variant_constructor list
    (*

    constructors

    *)
  3. | Type_record of record_field list
    (*

    fields

    *)
  4. | Type_open
    (*

    Type is open

    *)

The various kinds of a type.

type object_field = Odoc_type.object_field = {
  1. of_name : string;
  2. of_type : Types.type_expr;
  3. mutable of_text : Odoc_types.info option;
    (*

    optional user description

    *)
}
type type_manifest = Odoc_type.type_manifest =
  1. | Other of Types.type_expr
    (*

    Type manifest directly taken from Typedtree.

    *)
  2. | Object_type of object_field list
type t_type = Odoc_type.t_type = {
  1. ty_name : Name.t;
    (*

    Complete name of the type.

    *)
  2. mutable ty_info : info option;
    (*

    Information found in the optional associated comment.

    *)
  3. ty_parameters : (Types.type_expr * bool * bool) list;
    (*

    type parameters: (type, covariant, contravariant)

    *)
  4. ty_kind : type_kind;
    (*

    Type kind.

    *)
  5. ty_private : private_flag;
    (*

    Private or public type.

    *)
  6. ty_manifest : type_manifest option;
  7. mutable ty_loc : location;
  8. mutable ty_code : string option;
}

Representation of a type.

OCaml

Innovation. Community. Security.