Skip to content

Commit

Permalink
keep the text width to 80 columns (mli)
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12521 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
Jacques Garrigue committed May 31, 2012
1 parent 60557a9 commit de82439
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 61 deletions.
3 changes: 2 additions & 1 deletion typing/cmt_format.mli
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ val save_cmt :
binary_annots ->
string option -> (* source file *)
Env.t -> (* initial env *)
Types.signature option -> (* if a .cmi was generated, the signature saved there *)
Types.signature option -> (* if a .cmi was generated,
the signature saved there *)
unit

(* Miscellaneous functions *)
Expand Down
7 changes: 4 additions & 3 deletions typing/ctype.mli
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ val enforce_constraints: Env.t -> type_expr -> unit
val unify: Env.t -> type_expr -> type_expr -> unit
(* Unify the two types given. Raise [Unify] if not possible. *)
val unify_gadt: newtype_level:int -> Env.t ref -> type_expr -> type_expr -> unit
(* Unify the two types given and update the environment with the local constraints. Raise [Unify] if not possible. *)
(* Unify the two types given and update the environment with the
local constraints. Raise [Unify] if not possible. *)
val unify_var: Env.t -> type_expr -> type_expr -> unit
(* Same as [unify], but allow free univars when first type
is a variable. *)
Expand All @@ -174,7 +175,7 @@ val rigidify: type_expr -> type_expr list
(* "Rigidify" a type and return its type variable *)
val all_distinct_vars: Env.t -> type_expr list -> bool
(* Check those types are all distinct type variables *)
val matches : Env.t -> type_expr -> type_expr -> bool
val matches: Env.t -> type_expr -> type_expr -> bool
(* Same as [moregeneral false], implemented using the two above
functions and backtracking. Ignore levels *)

Expand All @@ -196,7 +197,7 @@ type class_match_failure =
| CM_Private_method of string
| CM_Virtual_method of string
val match_class_types:
?trace:bool -> Env.t -> class_type -> class_type -> class_match_failure list
?trace:bool -> Env.t -> class_type -> class_type -> class_match_failure list
(* Check if the first class type is more general than the second. *)
val equal: Env.t -> bool -> type_expr list -> type_expr list -> bool
(* [equal env [x1...xn] tau [y1...yn] sigma]
Expand Down
24 changes: 16 additions & 8 deletions typing/env.mli
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ val lookup_cltype: Longident.t -> t -> Path.t * class_type_declaration

(* Insertion by identifier *)

val add_value: ?check:(string -> Warnings.t) -> Ident.t -> value_description -> t -> t
val add_value:
?check:(string -> Warnings.t) -> Ident.t -> value_description -> t -> t
val add_annot: Ident.t -> Annot.ident -> t -> t
val add_type: Ident.t -> type_declaration -> t -> t
val add_exception: Ident.t -> exception_declaration -> t -> t
Expand All @@ -95,7 +96,9 @@ val open_pers_signature: string -> t -> t

(* Insertion by name *)

val enter_value: ?check:(string -> Warnings.t) -> string -> value_description -> t -> Ident.t * t
val enter_value:
?check:(string -> Warnings.t) ->
string -> value_description -> t -> Ident.t * t
val enter_type: string -> type_declaration -> t -> Ident.t * t
val enter_exception: string -> exception_declaration -> t -> Ident.t * t
val enter_module: string -> module_type -> t -> Ident.t * t
Expand All @@ -117,7 +120,7 @@ val read_signature: string -> string -> signature
val save_signature: signature -> string -> string -> signature
(* Arguments: signature, module name, file name. *)
val save_signature_with_imports:
signature -> string -> string -> (string * Digest.t) list -> signature
signature -> string -> string -> (string * Digest.t) list -> signature
(* Arguments: signature, module name, file name,
imported units with their CRCs. *)

Expand Down Expand Up @@ -156,14 +159,19 @@ val mark_value_used: string -> value_description -> unit
val mark_type_used: string -> type_declaration -> unit

type constructor_usage = Positive | Pattern | Privatize
val mark_constructor_used: constructor_usage -> string -> type_declaration -> string -> unit
val mark_constructor: constructor_usage -> t -> string -> constructor_description -> unit
val mark_exception_used: constructor_usage -> exception_declaration -> string -> unit
val mark_constructor_used:
constructor_usage -> string -> type_declaration -> string -> unit
val mark_constructor:
constructor_usage -> t -> string -> constructor_description -> unit
val mark_exception_used:
constructor_usage -> exception_declaration -> string -> unit

val in_signature: t -> t

val set_value_used_callback: string -> value_description -> (unit -> unit) -> unit
val set_type_used_callback: string -> type_declaration -> ((unit -> unit) -> unit) -> unit
val set_value_used_callback:
string -> value_description -> (unit -> unit) -> unit
val set_type_used_callback:
string -> type_declaration -> ((unit -> unit) -> unit) -> unit

(* Forward declaration to break mutual recursion with Includemod. *)
val check_modtype_inclusion:
Expand Down
3 changes: 2 additions & 1 deletion typing/parmatch.mli
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ val omegas : int -> pattern list
val omega_list : 'a list -> pattern list
val normalize_pat : pattern -> pattern
val all_record_args :
(Path.t * Longident.t loc * label_description * pattern) list -> (Path.t * Longident.t loc * label_description * pattern) list
(Path.t * Longident.t loc * label_description * pattern) list ->
(Path.t * Longident.t loc * label_description * pattern) list

val le_pat : pattern -> pattern -> bool
val le_pats : pattern list -> pattern list -> bool
Expand Down
22 changes: 14 additions & 8 deletions typing/printtyp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,27 @@ val type_scheme_max: ?b_reset_names: bool ->
(* Fin Maxence *)
val tree_of_value_description: Ident.t -> value_description -> out_sig_item
val value_description: Ident.t -> formatter -> value_description -> unit
val tree_of_type_declaration: Ident.t -> type_declaration -> rec_status -> out_sig_item
val tree_of_type_declaration:
Ident.t -> type_declaration -> rec_status -> out_sig_item
val type_declaration: Ident.t -> formatter -> type_declaration -> unit
val tree_of_exception_declaration: Ident.t -> exception_declaration -> out_sig_item
val exception_declaration: Ident.t -> formatter -> exception_declaration -> unit
val tree_of_exception_declaration:
Ident.t -> exception_declaration -> out_sig_item
val exception_declaration:
Ident.t -> formatter -> exception_declaration -> unit
val tree_of_module: Ident.t -> module_type -> rec_status -> out_sig_item
val modtype: formatter -> module_type -> unit
val signature: formatter -> signature -> unit
val tree_of_modtype_declaration: Ident.t -> modtype_declaration -> out_sig_item
val tree_of_signature : Types.signature -> out_sig_item list
val tree_of_typexp : bool -> type_expr -> out_type
val tree_of_modtype_declaration:
Ident.t -> modtype_declaration -> out_sig_item
val tree_of_signature: Types.signature -> out_sig_item list
val tree_of_typexp: bool -> type_expr -> out_type
val modtype_declaration: Ident.t -> formatter -> modtype_declaration -> unit
val class_type: formatter -> class_type -> unit
val tree_of_class_declaration: Ident.t -> class_declaration -> rec_status -> out_sig_item
val tree_of_class_declaration:
Ident.t -> class_declaration -> rec_status -> out_sig_item
val class_declaration: Ident.t -> formatter -> class_declaration -> unit
val tree_of_cltype_declaration: Ident.t -> class_type_declaration -> rec_status -> out_sig_item
val tree_of_cltype_declaration:
Ident.t -> class_type_declaration -> rec_status -> out_sig_item
val cltype_declaration: Ident.t -> formatter -> class_type_declaration -> unit
val type_expansion: type_expr -> Format.formatter -> type_expr -> unit
val prepare_expansion: type_expr * type_expr -> type_expr * type_expr
Expand Down
4 changes: 2 additions & 2 deletions typing/typecore.mli
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ val type_object:
(Env.t -> Location.t -> Parsetree.class_structure ->
Typedtree.class_structure * Types.class_signature * string list) ref
val type_package:
(Env.t -> Parsetree.module_expr -> Path.t -> Longident.t list -> type_expr list ->
Typedtree.module_expr * type_expr list) ref
(Env.t -> Parsetree.module_expr -> Path.t -> Longident.t list ->
type_expr list -> Typedtree.module_expr * type_expr list) ref

val create_package_type : Location.t -> Env.t ->
Longident.t * (Longident.t * Parsetree.core_type) list ->
Expand Down
21 changes: 16 additions & 5 deletions typing/typedecl.mli
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ open Format

val transl_type_decl:
Env.t -> (string loc * Parsetree.type_declaration) list ->
(Ident.t * string Asttypes.loc * Typedtree.type_declaration) list * Env.t
(Ident.t * string Asttypes.loc * Typedtree.type_declaration) list * Env.t

val transl_exception:
Env.t -> Location.t -> Parsetree.exception_declaration -> Typedtree.exception_declaration
Env.t -> Location.t ->
Parsetree.exception_declaration -> Typedtree.exception_declaration

val transl_exn_rebind:
Env.t -> Location.t -> Longident.t -> Path.t * exception_declaration

val transl_value_decl:
Env.t -> Location.t -> Parsetree.value_description -> Typedtree.value_description
Env.t -> Location.t ->
Parsetree.value_description -> Typedtree.value_description

val transl_with_constraint : Env.t -> Ident.t -> Path.t option -> Types.type_declaration -> Parsetree.type_declaration -> Typedtree.type_declaration
val transl_with_constraint:
Env.t -> Ident.t -> Path.t option -> Types.type_declaration ->
Parsetree.type_declaration -> Typedtree.type_declaration

val abstract_type_decl: int -> type_declaration
val approx_type_decl:
Expand All @@ -43,7 +48,13 @@ val check_recmod_typedecl:
val is_fixed_type : Parsetree.type_declaration -> bool

(* for typeclass.ml *)
val compute_variance_decls : Env.t -> (Ident.t * Types.type_declaration * Types.type_declaration * Types.class_declaration * Types.class_type_declaration * 'a Typedtree.class_infos) list -> (Types.type_declaration * Types.type_declaration * Types.class_declaration * Types.class_type_declaration) list
val compute_variance_decls:
Env.t ->
(Ident.t * Types.type_declaration * Types.type_declaration *
Types.class_declaration * Types.class_type_declaration *
'a Typedtree.class_infos) list ->
(Types.type_declaration * Types.type_declaration *
Types.class_declaration * Types.class_type_declaration) list

type error =
Repeated_parameter
Expand Down
61 changes: 39 additions & 22 deletions typing/typedtree.mli
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ and pattern_desc =
| Tpat_alias of pattern * Ident.t * string loc
| Tpat_constant of constant
| Tpat_tuple of pattern list
| Tpat_construct of Path.t * Longident.t loc * constructor_description * pattern list * bool
| Tpat_construct of
Path.t * Longident.t loc * constructor_description * pattern list * bool
| Tpat_variant of label * pattern option * row_desc ref
| Tpat_record of ( Path.t * Longident.t loc * label_description * pattern) list * closed_flag
| Tpat_record of
(Path.t * Longident.t loc * label_description * pattern) list *
closed_flag
| Tpat_array of pattern list
| Tpat_or of pattern * pattern * row_desc option
| Tpat_lazy of pattern
Expand All @@ -55,7 +58,7 @@ and expression =
exp_env: Env.t }

and exp_extra =
Texp_constraint of core_type option * core_type option
| Texp_constraint of core_type option * core_type option
| Texp_open of Path.t * Longident.t loc * Env.t

and expression_desc =
Expand All @@ -67,17 +70,23 @@ and expression_desc =
| Texp_match of expression * (pattern * expression) list * partial
| Texp_try of expression * (pattern * expression) list
| Texp_tuple of expression list
| Texp_construct of Path.t * Longident.t loc * constructor_description * expression list * bool
| Texp_construct of
Path.t * Longident.t loc * constructor_description * expression list *
bool
| Texp_variant of label * expression option
| Texp_record of (Path.t * Longident.t loc * label_description * expression) list * expression option
| Texp_record of
(Path.t * Longident.t loc * label_description * expression) list *
expression option
| Texp_field of expression * Path.t * Longident.t loc * label_description
| Texp_setfield of expression * Path.t * Longident.t loc * label_description * expression
| Texp_setfield of
expression * Path.t * Longident.t loc * label_description * expression
| Texp_array of expression list
| Texp_ifthenelse of expression * expression * expression option
| Texp_sequence of expression * expression
| Texp_while of expression * expression
| Texp_for of
Ident.t * string loc * expression * expression * direction_flag * expression
Ident.t * string loc * expression * expression * direction_flag *
expression
| Texp_when of expression * expression
| Texp_send of expression * meth * expression option
| Texp_new of Path.t * Longident.t loc * Types.class_declaration
Expand Down Expand Up @@ -108,16 +117,18 @@ and class_expr =
and class_expr_desc =
Tcl_ident of Path.t * Longident.t loc * core_type list
| Tcl_structure of class_structure
| Tcl_fun of label * pattern * (Ident.t * string loc * expression) list * class_expr * partial
| Tcl_fun of
label * pattern * (Ident.t * string loc * expression) list * class_expr *
partial
| Tcl_apply of class_expr * (label * expression option * optional) list
| Tcl_let of rec_flag * (pattern * expression) list *
(Ident.t * string loc * expression) list * class_expr
| Tcl_constraint of class_expr * class_type option * string list * string list * Concr.t
| Tcl_constraint of
class_expr * class_type option * string list * string list * Concr.t
(* Visible instance variables, methods and concretes methods *)

and class_structure =
{
cstr_pat : pattern;
{ cstr_pat : pattern;
cstr_fields: class_field list;
cstr_type : Types.class_signature;
cstr_meths: Ident.t Meths.t }
Expand All @@ -133,9 +144,12 @@ and class_field_kind =
| Tcfk_concrete of expression

and class_field_desc =
Tcf_inher of override_flag * class_expr * string option * (string * Ident.t) list * (string * Ident.t) list
Tcf_inher of
override_flag * class_expr * string option * (string * Ident.t) list *
(string * Ident.t) list
(* Inherited instance variables and concrete methods *)
| Tcf_val of string * string loc * mutable_flag * Ident.t * class_field_kind * bool
| Tcf_val of
string * string loc * mutable_flag * Ident.t * class_field_kind * bool
(* None = virtual, true = override *)
| Tcf_meth of string * string loc * private_flag * class_field_kind * bool
| Tcf_constr of core_type * core_type
Expand All @@ -160,7 +174,8 @@ and module_expr_desc =
| Tmod_structure of structure
| Tmod_functor of Ident.t * string loc * module_type * module_expr
| Tmod_apply of module_expr * module_expr * module_coercion
| Tmod_constraint of module_expr * Types.module_type * module_type_constraint * module_coercion
| Tmod_constraint of
module_expr * Types.module_type * module_type_constraint * module_coercion
| Tmod_unpack of expression * Types.module_type

and structure = {
Expand Down Expand Up @@ -364,20 +379,22 @@ and 'a class_infos =

(* Auxiliary functions over the a.s.t. *)

val iter_pattern_desc : (pattern -> unit) -> pattern_desc -> unit
val map_pattern_desc : (pattern -> pattern) -> pattern_desc -> pattern_desc
val iter_pattern_desc: (pattern -> unit) -> pattern_desc -> unit
val map_pattern_desc: (pattern -> pattern) -> pattern_desc -> pattern_desc

val let_bound_idents: (pattern * expression) list -> Ident.t list
val rev_let_bound_idents: (pattern * expression) list -> Ident.t list
val pat_bound_idents: pattern -> Ident.t list

val let_bound_idents_with_loc: (pattern * expression) list -> (Ident.t * string loc) list
val rev_let_bound_idents_with_loc: (pattern * expression) list -> (Ident.t * string loc) list
val let_bound_idents_with_loc:
(pattern * expression) list -> (Ident.t * string loc) list
val rev_let_bound_idents_with_loc:
(pattern * expression) list -> (Ident.t * string loc) list

(* Alpha conversion of patterns *)
val alpha_pat : (Ident.t * Ident.t) list -> pattern -> pattern
val alpha_pat: (Ident.t * Ident.t) list -> pattern -> pattern

val mknoloc : 'a -> 'a Asttypes.loc
val mkloc : 'a -> Location.t -> 'a Asttypes.loc
val mknoloc: 'a -> 'a Asttypes.loc
val mkloc: 'a -> Location.t -> 'a Asttypes.loc

val pat_bound_idents : pattern -> (Ident.t * string Asttypes.loc) list
val pat_bound_idents: pattern -> (Ident.t * string Asttypes.loc) list
35 changes: 24 additions & 11 deletions typing/typetexp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,28 @@ exception Error of Location.t * error
val report_error: formatter -> error -> unit

(* Support for first-class modules. *)
val transl_modtype_longident: (Location.t -> Env.t -> Longident.t -> Path.t) ref (* from Typemod *)
val transl_modtype: (Env.t -> Parsetree.module_type -> Typedtree.module_type) ref (* from Typemod *)
val create_package_mty: Location.t -> Env.t -> Parsetree.package_type -> (Longident.t Asttypes.loc * Parsetree.core_type) list * Parsetree.module_type
val transl_modtype_longident: (* from Typemod *)
(Location.t -> Env.t -> Longident.t -> Path.t) ref
val transl_modtype: (* from Typemod *)
(Env.t -> Parsetree.module_type -> Typedtree.module_type) ref
val create_package_mty:
Location.t -> Env.t -> Parsetree.package_type ->
(Longident.t Asttypes.loc * Parsetree.core_type) list *
Parsetree.module_type

val find_type: Env.t -> Location.t -> Longident.t -> Path.t * Types.type_declaration
val find_constructor : Env.t -> Location.t -> Longident.t -> Path.t * Types.constructor_description
val find_label : Env.t -> Location.t -> Longident.t -> Path.t * Types.label_description
val find_value: Env.t -> Location.t -> Longident.t -> Path.t * Types.value_description
val find_class: Env.t -> Location.t -> Longident.t -> Path.t * Types.class_declaration
val find_module: Env.t -> Location.t -> Longident.t -> Path.t * Types.module_type
val find_modtype: Env.t -> Location.t -> Longident.t -> Path.t * Types.modtype_declaration
val find_class_type: Env.t -> Location.t -> Longident.t -> Path.t * Types.class_type_declaration
val find_type:
Env.t -> Location.t -> Longident.t -> Path.t * Types.type_declaration
val find_constructor:
Env.t -> Location.t -> Longident.t -> Path.t * Types.constructor_description
val find_label:
Env.t -> Location.t -> Longident.t -> Path.t * Types.label_description
val find_value:
Env.t -> Location.t -> Longident.t -> Path.t * Types.value_description
val find_class:
Env.t -> Location.t -> Longident.t -> Path.t * Types.class_declaration
val find_module:
Env.t -> Location.t -> Longident.t -> Path.t * Types.module_type
val find_modtype:
Env.t -> Location.t -> Longident.t -> Path.t * Types.modtype_declaration
val find_class_type:
Env.t -> Location.t -> Longident.t -> Path.t * Types.class_type_declaration

0 comments on commit de82439

Please sign in to comment.