TypeTag

TypeTag is an enumeration that corresponds with the basic type structure of Avail's type lattice. Even though the type lattice contains an infinite collection of infinitely long chains of types, some of which have an infinite number of direct ancestors and direct descendants, we're still able to extract a pragmatic tree of types from the lattice.

Since this restricted set of types form a tree, they're defined in such an order that all of a type's descendants follow it. Since this is recursively true, the types are effectively listed in depth-last order. The ordinals are assigned in the order of definition, but each type keeps track of the maximum ordinal of all of its descendants (which occupy a contiguous span of ordinals just after the type's ordinal). We can test if type A is a subtype of B by checking if a.ordinal ≥ b.ordinal and a.highOrdinal ≤ b.highOrdinal. For a proper subtype test, we turn the first condition into an inequality.

Author

Mark van Gulik

Parameters

instance

The most general instance of this TypeTag.

modifiers

The vararg list of Modifiers, which set flags or declare covariant and contravariant relationships.

Entries

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed class Modifier

Properties

Link copied to clipboard

The array of Contravariant relationships defined during construction.

Link copied to clipboard

The array of Covariant relationships defined during construction.

Link copied to clipboard
val depth: Int

The number of ancestors of this TypeTag

Link copied to clipboard

The highest ordinal value of all of this TypeTag's descendants, including itself. The descendants' ordinals must start just after the current TypeTag's ordinal, and be contiguously numbered. Since the ordinals are assigned by the Enum mechanism, that means a TypeTag definition must be followed immediately by each of its children and their descendants, which is prefix tree order.

Link copied to clipboard

A flag set during initialization, indicating this TypeTag has no direct instances.

Link copied to clipboard

If object X has tag T, then X's type has tag T.metaTag.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The parent of this TypeTag.

Link copied to clipboard

Every TypeTag has a (potentially infinite) collection of values that use that tag. After initialization, this property has the least upper bound A_Type that constrains all those values.

Link copied to clipboard

Some TypeTags occur in exactly one AvailObject. If so, this field will be initialized to a lambda that produces the value.

Functions

Link copied to clipboard
Link copied to clipboard
fun isSubtagOf(otherTag: TypeTag): Boolean
Link copied to clipboard
fun valueOf(value: String): TypeTag

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.