Expand description
Runtime values.
Values have value semantics: collections are shared through Arc and
copied on write, so forking a world is cheap and worlds never affect each
other. Equality and hashing are structural (they decide which worlds
merge); the language’s == lives in crate::ops and compares numbers
across types.
Structs§
- Closure
- Delayed
- The distribution of a variable whose draw is delayed, updated exactly by the observations so far.
- Enum
Value - Hashed
- A collection, and its hash once computed. Worlds are hashed whenever
they merge, and most of their collections haven’t changed since the last
time: each is hashed once. Changing a collection (through
DerefMut) forgets its hash, and collections with different hashes are unequal without comparing them. - Multiset
- A bag’s contents: each distinct value, sorted, and how many times it’s in the bag (never zero). A sorted vector rather than a map: bags are small, copied whenever they change, and compared each time worlds merge, which is fastest in contiguous memory.
- Record