Skip to main content

Module types

Module types 

Source
Expand description

A type hierarchy with recursive sub-typing and multiple inheritance, kept in the links themselves (issue #148).

  • The type of a link is its source: (v: S x) is a value of type S.
  • A type points at itself: the root (Type: Type Type) is a point, and a sub-type of T is (S: T S), a value of T whose target is itself.
  • More parents (multiple inheritance) are pairs (p: S T2) marked by (m: Extends p).

So Type -> SubType -> … -> Value is a chain of sources of any depth, and every query below walks it with a set of visited links, so cycles end.

Types is the interface, with every query and write as a default method over NamedTypeLinks, and TypesDecorator is the decorator that implements it over any other layer. It is the Rust port of typeSystem of @link-foundation/ui-links; the C# counterpart is Foundation.Data.Doublets.Cli.TypesDecorator<TLinkAddress>.

The pinned types of PinnedTypes are (1: 1 1), (2: 1 2), (3: 1 3), …: with the root at address 1 they are sub-types of it, so a pinned store is already a hierarchy.

Structs§

TypeMarkers
The two points a type hierarchy needs: the root type (Type: Type Type) and the Extends marker of extra parents, None when the hierarchy has no multiple inheritance.
TypesDecorator
A decorator that keeps a type hierarchy with recursive sub-typing and multiple inheritance in the links of the layer it wraps; see the module documentation.

Constants§

EXTENDS_NAME
The name of the Extends marker point.
ROOT_TYPE_NAME
The name of the root type point.

Traits§

Types
The queries and writes of a type hierarchy.

Functions§

ensure_point
The point named name, created and named when missing.