Module Ocaml_typing.Mode_hint

type lock_item =
  1. | Value
  2. | Module
  3. | Class
  4. | Constructor

A description of what type of item is being closed over

type ident = {
  1. category : lock_item;
  2. lid : Ocaml_parsing.Longident.t;
    (*

    Sometimes we want the ident to represent M.x but the loc can only point to M. This field would store M.x.

    *)
}
type pinpoint_desc =
  1. | Unknown
  2. | Ident of ident
    (*

    An identifier

    *)
  3. | Function
    (*

    A function definition

    *)
  4. | Functor
    (*

    A functor definition

    *)
  5. | Lazy
    (*

    A lazy expression

    *)
  6. | Allocation
    (*

    An allocation

    *)
  7. | Expression
    (*

    An arbitrary expression

    *)
  8. | Class
    (*

    An class declaration

    *)
  9. | Object
    (*

    An object declaration

    *)
  10. | Loop
    (*

    a loop

    *)
  11. | Letop
    (*

    let op

    *)
  12. | Cases_result
    (*

    the result of cases

    *)

Description of pinpoints to accompany the location. The constructors are not mutually exclusive - some might be more precise than others

A pinpoint is a location in the source code, accompanied by additional description

type mutable_part =
  1. | Record_field of string
  2. | Array_elements
type always_dynamic =
  1. | Application
  2. | Try_with
type 'd const =
  1. | Unknown : ('l * 'r) const
    (*

    The constant bound is not explained.

    *)
  2. | Lazy_allocated_on_heap : (Allowance.disallowed * 'r) Allowance.pos const
  3. | Class_legacy_monadic : ('l * Allowance.disallowed) Allowance.neg const
  4. | Class_legacy_comonadic : ('l * Allowance.disallowed) Allowance.pos const
  5. | Tailcall_function : (Allowance.disallowed * 'r) Allowance.pos const
  6. | Tailcall_argument : (Allowance.disallowed * 'r) Allowance.pos const
  7. | Mutable_read : mutable_part -> (Allowance.disallowed * 'r) Allowance.neg const
  8. | Mutable_write : mutable_part -> (Allowance.disallowed * 'r) Allowance.neg const
  9. | Lazy_forced : (Allowance.disallowed * 'r) Allowance.neg const
  10. | Function_return : (Allowance.disallowed * 'r) Allowance.pos const
  11. | Stack_expression : ('l * Allowance.disallowed) Allowance.pos const
  12. | Module_allocated_on_heap : (Allowance.disallowed * 'r) Allowance.pos const
  13. | Always_dynamic : always_dynamic -> ('l * Allowance.disallowed) Allowance.neg const
  14. | Branching : ('l * Allowance.disallowed) Allowance.neg const
  15. | Is_used_in : pinpoint -> (Allowance.disallowed * 'r) const
    (*

    A variant of Is_closed_by where the closure mode is constant. INVARIANT: The pinpoint cannot be Unknown.

    *)
constraint 'd = _ * _

Hint for a constant bound. See Mode.Report.print_const for what each non-trivial constructor means.

type ('d0, 'd1) polarity =
  1. | Monadic : ('l * 'r, 'r * 'l) polarity
  2. | Comonadic : ('l * 'r, 'l * 'r) polarity
constraint 'd0 = _ * _ constraint 'd1 = _ * _
type closure_details = {
  1. closure : pinpoint;
  2. closed : pinpoint;
}
type containing =
  1. | Tuple
  2. | Record of string
  3. | Array
  4. | Constructor of string
type contains = {
  1. containing : containing;
  2. contained : pinpoint;
}
type is_contained_by = {
  1. containing : containing;
  2. container : Ocaml_parsing.Location.t;
}
type allocation_desc =
  1. | Unknown
  2. | Optional_argument
  3. | Function_coercion
  4. | Float_projection
type 'd morph =
  1. | Unknown : ('l * 'r) morph
    (*

    The morphism is not explained.

    *)
  2. | Unknown_non_rigid : ('l * 'r) morph
    (*

    Similiar to Unknown, but in the special case where the morph doesn't change the bound, it can be skipped.

    *)
  3. | Skip : ('l * 'r) morph
    (*

    The morphism doesn't change the bound and should be skipped in printing.

    *)
  4. | Close_over : ('d, 'l * Allowance.disallowed) polarity * closure_details -> ('l * Allowance.disallowed) morph
  5. | Is_closed_by : ('d, Allowance.disallowed * 'r) polarity * closure_details -> (Allowance.disallowed * 'r) morph
  6. | Captured_by_partial_application : (Allowance.disallowed * 'r) morph
  7. | Adj_captured_by_partial_application : ('l * Allowance.disallowed) morph
  8. | Crossing : ('l * 'r) morph
  9. | Allocation_r : allocation -> (Allowance.disallowed * 'r) morph
  10. | Allocation_l : allocation -> ('l * Allowance.disallowed) morph
  11. | Contains_l : ('l * Allowance.disallowed, 'd) polarity * contains -> 'd morph
  12. | Is_contained_by : ('l * 'r, 'd) polarity * is_contained_by -> 'd morph
  13. | Contains_r : (Allowance.disallowed * 'r, 'd) polarity * contains -> 'd morph
constraint 'd = _ * _

Hint for morphisms. When acompanied by a destination pinpoint, morph gives a source pinpoint and explains the relation between them. See Mode.Report.print_morph for what each non-trivial constructor means.