@calcit/procs 0.13.39 → 0.13.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/install-state.gz +0 -0
- package/RFCs/08-05-systematic-nil-reduction-rfc.md +2 -2
- package/RFCs/08-18-calcit-typed-js-ffi-boundary-rfc.md +1 -1
- package/editing-history/20260824-0040-option-fold-shared-return.md +23 -0
- package/editing-history/20260824-0120-release-0.13.40.md +4 -0
- package/editing-history/202608241218-explicit-unit-literal.md +14 -0
- package/editing-history/202608241240-release-01341.md +5 -0
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
在不掩盖现有运行时行为的前提下,让类型系统逐步阻止业务代码依赖 `nil`:
|
|
9
9
|
|
|
10
|
-
- 无业务返回值使用 `Unit
|
|
10
|
+
- 无业务返回值使用 `Unit`,新代码以独立的 `&unit` 值表示;
|
|
11
11
|
- 正常的“可能缺失”最终使用名义类型 `Option<T>`;
|
|
12
12
|
- 可恢复失败使用 `Result<T, E>`;
|
|
13
13
|
- JavaScript `null`/`undefined` 只通过 `JsNullish<T>` 进入类型系统;
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
### Unit
|
|
66
66
|
|
|
67
|
-
`Unit` 只用于副作用操作或明确没有有意义返回值的表达式,例如写文件、注册 watcher
|
|
67
|
+
`Unit` 只用于副作用操作或明确没有有意义返回值的表达式,例如写文件、注册 watcher。新代码显式返回 `&unit`;它与 `nil` 不相等、不会通过 `nil?`,JavaScript 后端生成 `void 0`(而 `nil` 仍生成 `null`)。为了兼容既有代码,标注为 `Unit` 的位置仍可接受旧的 `nil`,而 `;nil` 也保留为旧的兼容宏;新业务代码不得把两者当 Unit 标记或缺失值容器。
|
|
68
68
|
|
|
69
69
|
### Optional<T>(遗留内部表示)
|
|
70
70
|
|
|
@@ -237,7 +237,7 @@ defstruct NodeProbe
|
|
|
237
237
|
```
|
|
238
238
|
|
|
239
239
|
当前 probe 使用 `Map<Tag, Dynamic>`,应迁移成命名 Struct。Storage mutation、console、
|
|
240
|
-
timer registration 等只有副作用的 wrapper 应显式以 `
|
|
240
|
+
timer registration 等只有副作用的 wrapper 应显式以 `&unit` 收尾并声明返回 `Unit`,不因
|
|
241
241
|
JavaScript 返回 `undefined` 就暴露 `Dynamic`。
|
|
242
242
|
|
|
243
243
|
## 类型表达案例目录
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# option:fold shared callback return type
|
|
2
|
+
|
|
3
|
+
- Higher-order callback matching must reuse the enclosing generic binding map.
|
|
4
|
+
A fresh map per callback makes repeated variables such as `option:fold`'s
|
|
5
|
+
return `U` independent and silently accepts incompatible branch results.
|
|
6
|
+
- Unhinted zero-argument thunks may safely retain a concrete return type from
|
|
7
|
+
their final expression. This supplies the none-branch binding for `U` while
|
|
8
|
+
keeping unhinted callbacks with parameters dynamic, avoiding retroactive
|
|
9
|
+
tightening of existing higher-order call sites.
|
|
10
|
+
- The inferred thunk annotation must preserve `SchemaKind::Macro` for
|
|
11
|
+
`defmacro` forms, matching the explicit-hint path; a dedicated regression
|
|
12
|
+
test prevents zero-argument macros from being exposed as ordinary functions.
|
|
13
|
+
- Callback signature matching stages generic bindings and commits them only on
|
|
14
|
+
success, so a rejected nested callback cannot constrain a later argument.
|
|
15
|
+
`option:fold` additionally recovers a concrete return type for unhinted
|
|
16
|
+
callback bodies during its own argument check, including parameterized
|
|
17
|
+
callbacks, without globally tightening unrelated higher-order calls.
|
|
18
|
+
- Preprocessing regressions cover direct folds, parameterized callbacks, and a
|
|
19
|
+
user macro expanding to `option:fold`; empty unhinted functions remain
|
|
20
|
+
dynamic rather than treating their parameter list as a return value.
|
|
21
|
+
- Regression coverage includes the shared-binding matcher and literal thunk
|
|
22
|
+
inference. The CLI reproduction now fails during preprocessing when a
|
|
23
|
+
`String` none branch is combined with a numeric Option payload and `identity`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Explicit Unit literal
|
|
2
|
+
|
|
3
|
+
- Added `&unit` as a distinct runtime `Calcit::Unit` value. It is intentionally
|
|
4
|
+
not a bare `unit` identifier, so existing programs can continue to bind a
|
|
5
|
+
local named `unit`.
|
|
6
|
+
- `&unit` has its own equality, hashing, display, parser/data conversion and
|
|
7
|
+
`type-of` result. JavaScript emits `void 0`, whereas legacy `nil` continues
|
|
8
|
+
to emit `null`.
|
|
9
|
+
- Unit schemas accept both `&unit` and legacy `nil` to preserve existing source
|
|
10
|
+
compatibility. JSON refuses to encode `&unit` so it cannot silently become
|
|
11
|
+
a nullable application value.
|
|
12
|
+
- Updated JS, IR and WASM code generation plus data-shape validation and
|
|
13
|
+
documentation. The parser/codegen tests cover the literal and the backend
|
|
14
|
+
suite passes.
|
package/lib/package.json
CHANGED