mltypes.mli 845 Bytes
Newer Older
1
open Caml_cduce
2 3 4
open Asttypes
open Types

5 6
exception Error of string

7 8 9
type t = { uid : int; mutable recurs : int; mutable def : def }
and def =
  | Link of t
10
  | Arrow of string * t * t
11 12
  | Tuple of t list
  | PVariant of (string * t option) list  (* Polymorphic variant *)
13 14
  | Variant of string * (string * t list) list * bool
  | Record of string * (string * t) list * bool
15 16
  | Builtin of string * t list
  | Abstract of string
17
  | Var of int
18 19


20 21
val reg_uid: t -> unit

22 23
(* Load an external .cmi *)
val has_cmi: string -> bool
24
val load_module: string -> (string * t) list
25 26

(* Load the .cmi corresponding to a CDuce compilation unit *)
27
val read_cmi: string -> string * (string * Types.type_expr * t) list
28 29

val print : Format.formatter -> t -> unit
30
val print_ocaml : Format.formatter -> Types.type_expr -> unit
31 32


33
val find_value: string -> t * int
Pietro Abate's avatar
Pietro Abate committed
34