Module Common.Specialized

This module defines signature and functors used to 'specialize' a fixed-point type that is polymorphic in the type of meta-data to a particular type of meta-data.

This specialization is useful since we end up with a concrete type of kind * (i.e. not a type _constructor_) allowing us to make the type Comparable. In the analysis and optimization code, we work with map's and sets of our IR types a lot and this approach makes the types much nicer to work with.

module type Meta = sig ... end

Signature of all meta data used to annotate IRs

module type Unspecialized = sig ... end
module type Unspecialized2 = sig ... end
module type S = sig ... end

Since the type t is now concrete (i.e. not a type _constructor_) we can construct a Comparable.S giving us Map and Set specialized to the type.

module Make (X : Unspecialized) (Meta : Meta) : S with type t = Meta.t X.t and module Meta := Meta
module Make2 (X : Unspecialized2) (First : S) (Meta : Meta) : S with type t = (First.Meta.t, Meta.t) X.t and module Meta := Meta