jon.recoil.org

Module Path

type t =
  1. | Pident of Ident.t
    (*

    Examples: x, List, int

    *)
  2. | Pdot of Path.t * string
    (*

    Examples: List.map, Float.Array

    *)
  3. | Papply of Path.t * Path.t
    (*

    Examples: Set.Make(Int), Map.Make(Set.Make(Int))

    *)
  4. | Pextra_ty of Path.t * Path.extra_ty
    (*

    Pextra_ty (p, extra) are additional paths of types introduced by specific OCaml constructs. See below.

    *)
and extra_ty =
  1. | Pcstr_ty of string
    (*

    Pextra_ty (p, Pcstr_ty c) is the type of the inline record for constructor c inside type p.

    For example, in

      type 'a t = Nil | Cons of {hd : 'a; tl : 'a t}

    The inline record type {hd : 'a; tl : 'a t} cannot be named by the user in the surface syntax, but internally it has the path Pextra_ty (Pident `t`, Pcstr_ty "Cons").

    *)
  2. | Pext_ty
    (*

    Pextra_ty (p, Pext_ty) is the type of the inline record for the extension constructor p.

    For example, in

      type exn += Error of {loc : loc; msg : string}

    The inline record type {loc : loc; msg : string} cannot be named by the user in the surface syntax, but internally it has the path Pextra_ty (Pident `Error`, Pext_ty).

    *)
  3. | Punboxed_ty
    (*

    Pextra_ty (p, Punboxed_ty) is the type of the unboxed version of p.

    Example: float#, or t# given type t = { i : int ; s : string }.

    *)
val unboxed_version : Path.t -> Path.t
val is_unboxed_version : Path.t -> bool
val same : Path.t -> Path.t -> bool
val compare : Path.t -> Path.t -> int
val compare_extra : Path.extra_ty -> Path.extra_ty -> int
val find_free_opt : Ident.t list -> Path.t -> Ident.t option
val exists_free : Ident.t list -> Path.t -> bool
val scope : Path.t -> int
val flatten : Path.t -> [ `Contains_apply | `Ok of Ident.t * string list ]
val name : ?paren:(string -> bool) -> Path.t -> string
val head : Path.t -> Ident.t
val print : Stdlib.Format.formatter -> Path.t -> unit
val heads : Path.t -> Ident.t list
val last : Path.t -> string
val is_constructor_typath : Path.t -> bool
module Map : Stdlib.Map.S with type key = Path.t
module Set : Stdlib.Set.S with type elt = Path.t