Module Location.PathMap

the PathMap submodule provides special maps with paths as keys

type key = path
type 'a t

the abstract type for the map holding values of type 'a. Multiple values are allowed to associate with the same path

val empty : 'a t

an empty map

val singleton : key -> 'a -> 'a t

create a map with only one entry

val add : key -> 'a -> 'a t -> 'a t

add a new entry to a map. May create duplicated entries

val remove : key -> 'a t -> 'a t

remove a path and all its children from a map

val merge : ?⁠equal:('a -> 'a -> bool) -> 'a t -> 'a t -> 'a t

merge ?(equal=Stdlib.(=)) t1 t2 merges t1 and t2, eliminating duplicated entries. Two entries path1 => value1 and path2 => value2 are considered identical if path1 = path2 and equal value1 value2.

Duplications in t1 or t2 are not eliminated.

val find_overlapping : key -> 'a t -> (relation * 'a) Stdlib.Seq.t

find_overlapping path t find all entries in t that overlaps with path. Each (rel, value) in the returned sequence means that there is an entry path' => value in t such that path' `rel` path

val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t