Module Location.Map

the Map submodule provides special maps with locations as keys

type key = location
type 'a t

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

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 location and all its children from a map

val restrict_to : root list -> 'a t -> 'a t

restrict the domain of a map to roots, removing anything else

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 loc1 => value1 and loc2 => value2 are considered identical if loc1 = loc2 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 loc t find all entries in t that overlaps with loc. Each (rel, value) in the returned sequence means that there is an entry loc' => value in t such that loc' `rel` loc

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