silo:std.prelude

Source src/silo:std.prelude

1##! Auto-imported prelude of commonly-used stdlib items.
2##!
3##! Re-exports core numeric aliases, foundational traits, collection
4##! protocols, iterator types, AST types, and the `format` macro so
5##! user code sees them without explicit `:use`. Enum and union
6##! variants (`false`, `true`, `None`, `Some`, `Ok`, `Err`, …) come
7##! automatically when their parent type is imported.
8##!
9##! Deliberately omitted:
10##!   - Reflection (`:type-info`, the `Reflect` trait, type-info
11##!     records) — users `:use silo:std.reflection` explicitly.
12##!   - `HashMap` / `HashSet`, the BTree / VecDeque / LinkedList /
13##!     BinaryHeap types, sync primitives (`Mutex`, `RwLock`, `Atomic`,
14##!     `Lazy`), and IO traits (`Read` / `Write` / `BufRead` / `Seek`)
15##!     — users `:use` the owning module directly.
16##!
17##! Several planned items (`I128`, `U128`, `USize`, `ISize`, `Num`,
18##! `Integral`, `Neg`, `vec/1`..`vec/16`, `unwrap-or-default`,
19##! checked/wrapping operator variants, `format-args` / `parse`
20##! macros) land once their backing implementations do.
21:use
22  :open(pub) core
23    Range AnyInt AnyUInt AnyFloat AnyDecimal
24    U8 U16 U32 U64 I8 I16 I32 I64 Byte Codepoint Char Bytes
25    F16 F32 F64 D32 D64 D128
26    Bool Option Result Pair Ordering
27    Vec
28    Int Float Decimal Str Symbol Unit Never
29
30  :open(pub) traits
31    Add Sub Mul Div Eq Ord Not From Into TryFrom TryInto
32    Display Debug Hash Default Error
33    LowerHex Binary
34
35  :open(pub) codepoint
36    Ascii
37
38  :open(pub) str
39    str-from-utf16 str-from-utf8-lossy
40
41  :open(pub) path
42    Path PathSegment Component
43    main-separator
44
45  :open(pub) matcher Matcher CodepointMatcher ByteMatcher
46
47  :open(pub) collections
48    while
49    Foldable Mappable Filterable Keyed Chainable Indexed Zippable
50    Seq Map Set
51
52  :open(pub) iter
53    Iterator CharsIter chars-iter
54
55  :open(pub) locale
56    Locale PluralCategory
57
58  :aspect(pub) locale CurrentLocale
59
60  :open(pub) ast
61    Pattern MatchArm Expr Block
62    Token TokenSeq
63    TypeExprAst
64    FieldDef VariantDef RecordTypeDef UnionTypeDef TypeDef
65    ImplOpDef ImplDef TopLevelAst
66
67  :open(pub) fmt
68    FmtSpec Alignment SignMode default-fmt-spec
69
70  :open(pub) result Res
71  :open(pub) option Opt
72  :open(pub) error-report ErrorReport error-report error-report-with-cause
73  :open(pub) math MinMax IntMath
74
75  :open(pub) temporal
76    IDuration UDuration Instant
77    duration-from-secs duration-from-millis duration-from-micros duration-from-nanos
78    uduration-from-secs uduration-from-millis uduration-from-micros uduration-from-nanos
79
80  :open(pub) format
81    format
82:end
83