package rotor

  1. Overview
  2. Docs
An automatic refactoring tool for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

rotor-0.1.zip
md5=372ca9b6a7af2fdd99d5117d376870b4
sha512=6f5473951437a48bf9ae7a5d22a4283c02bed6a6e5c7bc02fc5f28dc5c28720f3e2c69f32a2a0c5b9447c2bc8c83746bb4de5b67909a98cc8921527582727063

doc/rotor/Moduletype/index.html

Module Moduletype

module Binding : sig ... end
val module_type_consistent_with : Elements.Module._sub_t -> Elements.ModuleType._sub_t -> bool

ST is consistent with S and FT is consistent with F.

module_type_sort env mt returns an optional _module_type value corresponding to the sort of the module type mt (i.e. either a structure or a functor). If the sort cannot be determined, then None is returned. env is used to lookup modules and module types encountered when examining the structure of mt, and thus should be the environment corresponding to the point in the AST where the mt parameter comes from.

Resolve a module type view to a concrete module type; this may involve looking up module types and the types of modules referenced by identifiers, hence the need to provide an environment.

lookup env mtv id looks up the element referenced by id in the module type view mtv; this may require module (type) identifiers to be resolved, hence the need to provide the environment env.

Version of lookup that takes an existential _module_type.

resolve_lookup env mty id first resolves the module type mty and then performs _lookup.

find a env returns the module type of the module or module type identified by a by using the appropriate compiler lookup function on env. If the lookup fails, then None is returned. If a is not of the correct sort (i.e. a _structure, _functor, _structure_type, or _functor_type atom), the Invalid_argument is raised.

contains env mt a returns true if and only if mt contains a binding for the element a.

find_param_by_id env x mty returns the module type of the functor parameter of mty with identifier x, or None if the x is not found. It will raise Invalid_argument if mty is not a functor type.

find_param_by_idx env idx mty returns the identifer and module type of the functor parameter of mty at index idx, or None if the x is not found. It will raise Invalid_argument if mty is not a functor type.

OCaml

Innovation. Community. Security.