package saltoIL

  1. Overview
  2. Docs

Module Salto_id.PathSource

Sourcetype 'a t
Sourceval compare : 'a t -> 'a t -> int

Total order

Sourcetype typed_path = Types.type_expr t
Sourceval get_desc : 'a t -> 'a

Get description of path

Sourceval void : 'a t -> unit t

Drop the description

Sourceval equal : 'a t -> 'b t -> bool

Equality test between paths

Sourceval equal_id : _ t -> Id.t -> bool

Equality test between a path and an identifier

Sourceval pp : Format.formatter -> _ t -> unit

Formatter of Salto paths

Sourceval from_path : OCamlPath.t -> 'a -> Location.t -> 'a t

Constructor of path recovered from the typed OCaml AST

Sourceval from_ident : Id.t -> string list -> 'a -> 'a t

from_ident id fields desc returns the path obtained by projecting fields on the identifier id

Sourceval append : Id.t -> 'a t -> 'a t

append id path returns a new path corresponding to id.path

Sourceval split : _ t -> (Id.t * string list) list

split p returns a list of flat paths (head, names) where head is the head identifier of the sub-path and names is the list of projection names of the sub-path. NB: the returned list should contain at least one element, and if the path is non-applicative, the returned list is a singleton

Sourceval head : _ t -> Id.t

head p returns the head identifier of the path p

Sourceval fold : init:(Id.t -> 'a) -> proj:('a -> string -> 'a) -> apply:('a -> 'a -> 'a) -> _ t -> 'a
Sourceval name_loc : _ t -> string Location.loc

path_name_loc p returns the name of the path p

Sourceval lident_loc : _ t -> Longident.t Location.loc

lident_loc p return the identifier p as a longident