2016-02-18 07:11:59 -08:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* OCaml *)
|
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 1996 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. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
1995-08-09 08:06:35 -07:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Operations on module types *)
|
|
|
|
|
1996-09-23 04:33:27 -07:00
|
|
|
open Types
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
val scrape: Env.t -> module_type -> module_type
|
|
|
|
(* Expand toplevel module type abbreviations
|
|
|
|
till hitting a "hard" module type (signature, functor,
|
|
|
|
or abstract module type ident. *)
|
2018-09-20 16:45:34 -07:00
|
|
|
val scrape_for_functor_arg: Env.t -> module_type -> module_type
|
|
|
|
(* Remove aliases in a functor argument type *)
|
2018-03-22 00:44:54 -07:00
|
|
|
val scrape_for_type_of:
|
|
|
|
remove_aliases:bool -> Env.t -> module_type -> module_type
|
2018-09-20 16:45:34 -07:00
|
|
|
(* Process type for module type of *)
|
2019-04-12 03:33:41 -07:00
|
|
|
val freshen: scope:int -> module_type -> module_type
|
2004-02-14 09:38:02 -08:00
|
|
|
(* Return an alpha-equivalent copy of the given module type
|
|
|
|
where bound identifiers are fresh. *)
|
2016-07-21 09:38:28 -07:00
|
|
|
val strengthen: aliasable:bool -> Env.t -> module_type -> Path.t -> module_type
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Strengthen abstract type components relative to the
|
|
|
|
given path. *)
|
2016-07-21 07:32:58 -07:00
|
|
|
val strengthen_decl:
|
2016-07-21 09:38:28 -07:00
|
|
|
aliasable:bool -> Env.t -> module_declaration -> Path.t -> module_declaration
|
2018-07-06 00:45:25 -07:00
|
|
|
val nondep_supertype: Env.t -> Ident.t list -> module_type -> module_type
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Return the smallest supertype of the given type
|
2018-07-06 00:45:25 -07:00
|
|
|
in which none of the given idents appears.
|
2018-07-09 05:23:29 -07:00
|
|
|
@raise [Ctype.Nondep_cannot_erase] if no such type exists. *)
|
|
|
|
val nondep_sig_item: Env.t -> Ident.t list -> signature_item -> signature_item
|
|
|
|
(* Returns the signature item with its type updated
|
|
|
|
to be the smallest supertype of its initial type
|
|
|
|
in which none of the given idents appears.
|
|
|
|
@raise [Ctype.Nondep_cannot_erase] if no such type exists. *)
|
2004-04-09 06:32:28 -07:00
|
|
|
val no_code_needed: Env.t -> module_type -> bool
|
|
|
|
val no_code_needed_sig: Env.t -> signature -> bool
|
|
|
|
(* Determine whether a module needs no implementation code,
|
|
|
|
i.e. consists only of type definitions. *)
|
2003-06-19 08:53:53 -07:00
|
|
|
val enrich_modtype: Env.t -> Path.t -> module_type -> module_type
|
2017-11-03 11:20:57 -07:00
|
|
|
val enrich_typedecl: Env.t -> Path.t -> Ident.t -> type_declaration ->
|
|
|
|
type_declaration
|
2003-07-01 06:05:43 -07:00
|
|
|
val type_paths: Env.t -> Path.t -> module_type -> Path.t list
|
2013-12-16 19:52:50 -08:00
|
|
|
val contains_type: Env.t -> module_type -> bool
|
2016-11-21 00:59:42 -08:00
|
|
|
val lower_nongen: int -> module_type -> unit
|