Commit 557f00b
fix(stdlib): single-ownership dedup of prelude/option/result (#133)
Per ADR-011 (#132): one canonical binding per name, module-owned.
- prelude.affine: `module prelude;`. Keeps the core sum types
`Option`/`Result` (+ constructors) as their canonical home and the
generic list/numeric utilities. Removes the 8 duplicate/conflicting
Option/Result *operations* it previously also defined (is_some,
is_none, unwrap, unwrap_or, is_ok, is_err, unwrap_result,
unwrap_or_result).
- option.affine: `module option;` + `use prelude::{Option, Some, None,
Result, Ok, Err};`. Now the single canonical home for Option ops.
- result.affine: `module result;` + `use prelude::{Result, Ok, Err,
Option, Some, None};`. Single canonical home for Result ops.
The previous flat-namespace conflicts (`prelude.map(arr,f)` vs
`option.map(f,opt)`; `prelude.unwrap`(Option) vs `result.unwrap`(Result))
are resolved by module ownership — each is now `module::name`, exactly
one definition per owning module. Verified: no leftover dup defs, no
prelude util calls a removed op, full suite green (214 tests).
Note: this removes the prelude `unwrap`/`unwrap_result` that #134
(PR #150) patched; the sound, panicking versions are `option::unwrap`
and `result::unwrap` (already correct). #150's regression tests remain
valid against those. Merge-order: if #150 lands first, resolve the
modify/delete in prelude.affine in favour of this deletion.
Closes #133
Refs #128, #132
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent dab2f39 commit 557f00b
3 files changed
Lines changed: 28 additions & 69 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
7 | 17 | | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
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 | 21 | | |
47 | 22 | | |
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 | 23 | | |
80 | 24 | | |
81 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
| |||
0 commit comments