Module Records.Atom

type oty = Ty.t * bool

An optional type (see Sstt.Ty.O).

type t = {
  1. bindings : oty LabelMap.t;
    (*

    mapping from labels to optional types

    *)
  2. opened : bool;
    (*

    if true, denotes an open record

    *)
}

A single record type.

val dom : t -> LabelSet.t

dom t returns the set of explicit labels in t. Note that this does not mean that labels in dom t are present in the record values captured by t: even if a binding is present in t, it could be associated with a possibly absent type.

val find : Label.t -> t -> oty

find l t returns the type associated with the label l in t, even if t does not have an explicit binding for l.

val to_tuple : Label.t list -> t -> oty list

to_tuple lst r returns the list of oty associated with each label of lst in r. Each type is computed using find.

val to_tuple_with_default : Label.t list -> t -> oty list

to_tuple_with_default lst r returns the list d :: to_tuple lst r where

val compare : t -> t -> int

Comparison working on the internal representation of t.

val equal : t -> t -> bool

Equality, equal a b is equivalent to compare a b = 0.

val map_nodes : (Ty.t -> Ty.t) -> t -> t

map_nodes f r applies f to all nodes in r.bindings.