1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! [`Held`] — what a by-key read of a SET election hands back: an entity's whole set, with the
//! ordinal each member is asked and attributed under.
/// One entity's SET in one column — the `m` values it holds there, each wearing the ordinal that
/// identifies it in every answer downstream.
///
/// # It is [`Folded`](super::Folded)'s family and not [`Ranked`](super::Ranked)'s
///
/// Nothing here is ranked, scored or compared: a by-key read is a READ. What it shares with
/// [`Folded`] — and the reason it is the carrier the set door's `get_` answers in — is the
/// ORDINAL LAW. A set retrieve runs the engine once per query vector, `Folded::streams[j]` is what
/// query vector `j`'s own stream said about an entity, and `j` is a position in the set the caller
/// asked with. This type is where that set comes from when the caller asks with an entity's own, so
/// its ordinal and `Folded`'s subscript are the SAME NUMBER — which is what makes the by-example set
/// road's answer attributable at all.
///
/// # Why the ordinal is carried rather than left to the index
///
/// `members()[j]` would give the same value, and a caller reading it would be inferring the law
/// rather than being handed it. [`enumerate`](Self::enumerate) is the one place the correspondence
/// is written down, so a reader who has a `Folded` and wants to know what `streams[2]` was about has
/// somewhere to go. The list is never reordered by anything here, which is the invariant that makes
/// the index meaningful in the first place.
///
/// # The arity that a single election refuses is this type's ordinary state
///
/// `get_<field>` on a UNIT election refuses when the engine holds several — the declaration said
/// one, and picking one of several is a choice nobody made. On a SET election several is the whole
/// point, so the same door answers the WHOLE SET instead. One door, two answer shapes, split by the
/// election's label at EMISSION: nothing here judges at run time.
///
/// EMPTY is not representable through the door — a column holding nothing for a key is `Unindexed`,
/// which is a fact about the caller's own argument rather than a set of zero. The type itself does
/// not forbid it, for the reason the framework forbids nothing it does not have to: a third party
/// building one has its own reasons.