Co

class Co(val name: String, val part: AvailObject.() -> A_BasicObject? = null, val traverse: A_Type.() -> A_Type) : TypeTag.Modifier.Variant

A Covariant relationship. When a TypeTag declares such a relationship, then for all A and B having that TypeTag, if A ⊆ B, then traverse(A) ⊆ traverse(B), where traverse is a function provided by the Co instance.

Constructors

Link copied to clipboard
constructor(name: String, part: AvailObject.() -> A_BasicObject? = null, traverse: A_Type.() -> A_Type)

Properties

Link copied to clipboard

The symbolic name of the variant, for descriptive purposes.

Link copied to clipboard
val part: AvailObject.() -> A_BasicObject? = null

An optional function mapping an instance of a type into an instance of the type's covariant property. This doesn't always make sense, as the object doesn't necessarily have some subobject that is homomorphic to the covariant relationship. In that case, the default null is used instead of the function, which indicates a mechanism for producing such a subobject is unavailable.

Link copied to clipboard

A function that extracts a co-/contravariant type from the original type, where this Variant is applicable. For example, given something with the tag SET_TYPE_TAG (the TypeTag for set types), the set type's element type can be extracted by running the traverse function of the "element" covariant type parameter.

Functions

Link copied to clipboard
open override fun applyTo(typeTag: TypeTag)

Adjust the TypeTag to accommodate this modifier.