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 typeS. - A type points at itself: the root
(Type: Type Type)is a point, and a sub-type ofTis(S: T S), a value ofTwhose 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§
- Type
Markers - The two points a type hierarchy needs: the root type
(Type: Type Type)and theExtendsmarker of extra parents,Nonewhen the hierarchy has no multiple inheritance. - Types
Decorator - 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
Extendsmarker 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.