nustack
ReferenceNulang

attributes.sort

Sort attribute: the structural taxonomy of a Term.

Module nu.lang.attributes.sort.

Sort attribute: the structural taxonomy of a Term.

A sort is a node's structural category. Sorts form a tree with two roots, Ref and Interaction; subsort walks it. The composition matrix records, per parent sort, the child sorts that parent may hold; matrix_sort folds any sort onto the eight that carry a row. The synthesized has_command folds the sort tree to a subtree-presence flag.

The user-facing Term classes that declare these sorts live in nu.lang.kinds; this module owns the value space (Sort enum, matrix, helpers) and the sort-flavored attribute folds only.

NameCallMeaning
matrix_sortlang.matrix_sort(sort)Resolve sort to the matrix sort it slot-fits as, or None.
subsortlang.subsort(sort, ancestor)Return whether sort is ancestor or descends from it in the tree.

matrix_sort

Resolve sort to the matrix sort it slot-fits as, or None.

lang.matrix_sort(sort)

Path nu.lang.matrix_sort. Defined on nu.lang.attributes.sort, bound as a function. Builds Sort | None.

A Reduction slot-fits as a ScalarQuery, anything under Command as a ScalarCommand, and so on. An interior sort with no matrix row yields None.

Arguments

NameTypeDefaultMeaning
sortSort

Undocumented: example.

subsort

Return whether sort is ancestor or descends from it in the tree.

lang.subsort(sort, ancestor)

Path nu.lang.subsort. Defined on nu.lang.attributes.sort, bound as a function. Builds bool.

Arguments

NameTypeDefaultMeaning
sortSort
ancestorSort

Undocumented: example.

On this page