Module TypeCore.VarMap

module VarMap: MzMap.S  with type key = var
This module provides a clean way to map a variable to any given piece of data. Beware, however, that this module only works with rigid variables (it's unclear what it should do for flexible variables), so it's up to the client to properly run TypeCore.is_flexible beforehand.

include Map.S
val keys : 'a t -> key list
Get a list of all keys in a map.
val union : 'a t -> 'a t -> 'a t
union m1 m2 keeps the values from m1
val inter : 'a t -> 'a t -> 'a t
inter m1 m2 keeps the values from m1
val minus : 'a t -> 'a t -> 'a t
minus m1 m2 returns m1 minus all the elements that are also in m2, that is, m1 \ (m1 ∩ m2)
val xor : 'a t -> 'a t -> 'a t
xor m1 m2 is (m1m2) \ (m1m2)
val to_list : 'a t -> (key * 'a) list
to_list translates the map to a list.
val find_opt : key -> 'a t -> 'a option
same as Map.find but returns a 'a option