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
//! The Flow runtime value model.
//!
//! This crate is what a value *is* while a program runs, and the operations
//! the language fixes on values rather than on any one program:
//!
//! - the built-in data types of `data.md` — unbounded [`Int`], exact
//! [`Decimal`], code-point [`Text`], [`Bytes`], [`List`], [`Dict`] and
//! [`Set`] sorted by key, [`Duration`] and [`Instant`] — with the operators
//! std declares for them, including where they fault ([`Fault`]);
//! - records, enum values and tuples by declaration ([`Record`],
//! [`Variant`], [`Tuple`]);
//! - `types.md`'s structural equality and total order over every data value
//! ([`compare`], [`equal`]), and the text form interpolation inserts
//! ([`interpolate`], [`text_form`]), written by the one walk every
//! spelling of a value shares ([`Spelling`], [`spell_within`]);
//! - the values a run holds that are not data — functions and other
//! evaluator-made values ([`Native`]), task handles ([`TaskId`]) and host
//! tokens ([`HostToken`]) — which have none of those operations and are
//! refused by each of them ([`DataError`]).
//!
//! Every rule here is exact and independent of the host's word size, locale,
//! hash order and floating-point unit: replay computes pure work again, so
//! two implementations that disagreed on any result would disagree on a run.
//!
//! # What is deliberately absent
//!
//! **Types.** The checker owns types; at run time a value carries no type
//! beyond the declaration a record or enum value needs for its text.
//!
//! **Encoding.** The value encoding and the history format are `abi.md`'s and
//! `trace.md`'s and live with the protocol and the history; this crate
//! exposes the parts an encoder reads and a decoder builds from.
//!
//! **Limits.** An `Int` has no bound and a `Text` no size here; the host's
//! limits on a program's own values are the evaluator's to enforce, and every
//! measure it needs — [`Int::bits`], [`Text::byte_len`], [`Bytes::len`] —
//! costs constant time.
//!
//! # Structure
//!
//! History writes a value once and points at it afterwards, and writes a
//! text, a list or a dictionary as a tree whose parts can be pointed at too
//! (`trace.md`, *Values*). The structure that takes is the structure a value
//! has here, so a writer reads it and a reader builds it again, sharing what
//! was shared:
//!
//! - [`Value::identity`] tells a value apart from those made separately, so
//! a writer can point at a value it has written;
//! - [`List::parts`] and [`List::from_parts`] give a list as its front, a
//! window onto a tree of shared [`Node`]s, and its back;
//! [`Dict::root`] and [`Dict::from_tree`] a dictionary as its tree;
//! [`Node::shape`], [`Node::leaf`] and [`Node::branch`] each node;
//! - [`Text::root`], [`Text::of_block`] and [`Text::join_shared`] a text as
//! a tree of [`Node`]s whose leaves are [`Run`]s onto shared [`Block`]s.
//!
//! Every builder checks what it is given ([`StructureError`]) and keeps the
//! trees balanced, rebalancing a tree another writer did not keep balanced,
//! so a value read from history behaves as one made here.
//!
//! # Unicode
//!
//! Normalization, case mapping and grapheme segmentation use the tables of
//! one Unicode version, [`UNICODE_VERSION`], which std's version fixes. Every
//! table comes from a pinned crate; none is the Rust toolchain's.
//!
//! # Depth
//!
//! Equality, order, text and dropping walk a value with a stack on the heap,
//! never the native one, so a value nested as deeply as memory allows is
//! compared, printed and dropped like any other.
pub use ;
pub use ;
pub use ;
pub use Int;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use BigInt;