File: odoc_type.mli

package info (click to toggle)
ocaml 5.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 43,124 kB
  • sloc: ml: 355,439; ansic: 51,636; sh: 25,098; asm: 5,413; makefile: 3,673; python: 919; javascript: 273; awk: 253; perl: 59; fortran: 21; cs: 9
file content (74 lines) | stat: -rw-r--r-- 2,644 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*             Sebastien Hinderer, projet Cambium, INRIA Paris            *)
(*                                                                        *)
(*   Copyright 2022 Institut National de Recherche en Informatique et     *)
(*     en Automatique.                                                    *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(** Representation and manipulation of a type, but not class nor module type.*)

(** This module has an implementation although it declares only types.
    This is because other modules use the let module construct or access it
    so it is needed as a real module. *)

module Name = Odoc_name

type private_flag = Asttypes.private_flag = Private | Public

type record_field = {
  rf_name : string;
  rf_mutable : bool;
  rf_type : Types.type_expr;
  mutable rf_text : Odoc_types.info option;
}
(** Description of a record type field. *)

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

type variant_constructor = {
  vc_name : string;
  vc_args : constructor_args;
  vc_ret : Types.type_expr option;
  mutable vc_text : Odoc_types.info option;
}
(** Description of a variant type constructor. *)

type type_kind =
    Type_abstract
  | Type_variant of variant_constructor list
  | Type_record of record_field list
  | Type_open
(** The various kinds of type. *)

type object_field = {
  of_name : string;
  of_type : Types.type_expr;
  mutable of_text : Odoc_types.info option;
}

type type_manifest =
    Other of Types.type_expr
  | Object_type of object_field list

type t_type = {
  ty_name : Name.t;
  mutable ty_info : Odoc_types.info option;
  ty_parameters : (Types.type_expr * Types.Variance.t) list;
  ty_kind : type_kind;
  ty_private : private_flag;
  ty_manifest : type_manifest option;
  mutable ty_loc : Odoc_types.location;
  mutable ty_code : string option;
}

(** Representation of a type. *)