Module Cduce_types__.Iter

type pack =
| Int : (module Cduce_types.Types.Kind) -> pack
| Char : (module Cduce_types.Types.Kind) -> pack
| Atom : (module Cduce_types.Types.Kind) -> pack
| Times : (module Cduce_types.Types.Kind with type Dnf.atom = Cduce_types.Types.Node.t * Cduce_types.Types.Node.t and type Dnf.dnf = (Cduce_types.Types.Node.t * Cduce_types.Types.Node.t) Cduce_types__.Bdd.dnf and type Dnf.line = (Cduce_types.Types.Node.t * Cduce_types.Types.Node.t) Cduce_types__.Bdd.line) -> pack
| Xml : (module Cduce_types.Types.Kind with type Dnf.atom = Cduce_types.Types.Node.t * Cduce_types.Types.Node.t and type Dnf.dnf = (Cduce_types.Types.Node.t * Cduce_types.Types.Node.t) Cduce_types__.Bdd.dnf and type Dnf.line = (Cduce_types.Types.Node.t * Cduce_types.Types.Node.t) Cduce_types__.Bdd.line) -> pack
| Function : (module Cduce_types.Types.Kind with type Dnf.atom = Cduce_types.Types.Node.t * Cduce_types.Types.Node.t and type Dnf.dnf = (Cduce_types.Types.Node.t * Cduce_types.Types.Node.t) Cduce_types__.Bdd.dnf and type Dnf.line = (Cduce_types.Types.Node.t * Cduce_types.Types.Node.t) Cduce_types__.Bdd.line) -> pack
| Record : (module Cduce_types.Types.Kind with type Dnf.atom = bool * Cduce_types.Types.Node.t Cduce_types.Ident.label_map and type Dnf.dnf = (bool * Cduce_types.Types.Node.t Cduce_types.Ident.label_map) Cduce_types__.Bdd.dnf and type Dnf.line = (bool * Cduce_types.Types.Node.t Cduce_types.Ident.label_map) Cduce_types__.Bdd.line) -> pack
| Abstract : (module Cduce_types.Types.Kind) -> pack
| Absent : pack

Type pack represent the kind of a type component together with the corresponding Kind module from Types. The type of the module is constrained just enough to allow to process similar kinds in a uniform way :

  • for basic types, the type of the underlying representation is left abstract, only exposing the polymorphic variable part of the dnf.
  • for products, xml products and arrows, the type of the dnf is exposed and the same
  • for records the type of the dnf is exposed
  • an Absent constructor gives functions using packs a chance to check if the type has the absent flag and act accordingly.
val fold : ('a -> pack -> Cduce_types.Types.t -> 'a) -> 'a -> Cduce_types.Types.t -> 'a

fold f acc t calls (f acc Absent (.... f (f acc (Int _) t) (Chars _) t) ...)), that is folds the function t over all the type components of t. The pack argument passed to f allows one to discriminate on a particular kind of t.

val iter : (pack -> Cduce_types.Types.t -> unit) -> Cduce_types.Types.t -> unit

iter f t calls f for each type component of t.