Commit 74a431e
Build make_key through the constructors
make_key was the last thing in lambda.ml constructing terms raw. It could,
owning the type, and the argument for letting it was that folding would change
the key: it substitutes alias bindings as it canonicalizes, substitution can
put a constant where a variable was, and the constructors would then fold what
the raw rebuild left alone.
That is true of the mechanism and false of the outcome. Routing every
construction through the constructors leaves generated JavaScript unchanged
across the runtime, Belt and the 626 test modules, so the keys still make the
same sharing decisions. The argument was worth checking rather than asserting.
It is safe to fold here now for a second reason: since the preceding commit,
no key reaches generated code. They are compared - in same_actions,
up_ok_action and the action store - and nothing else.
What remains of L-constructors in make_key is pattern matching.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8g8qwBARAcvW9MyuKQq8H1 parent d9e67ca commit 74a431e
1 file changed
Lines changed: 17 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
1288 | 1284 | | |
1289 | 1285 | | |
1290 | 1286 | | |
| |||
1295 | 1291 | | |
1296 | 1292 | | |
1297 | 1293 | | |
1298 | | - | |
| 1294 | + | |
1299 | 1295 | | |
1300 | | - | |
1301 | | - | |
| 1296 | + | |
| 1297 | + | |
1302 | 1298 | | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1308 | 1303 | | |
1309 | | - | |
1310 | | - | |
| 1304 | + | |
| 1305 | + | |
1311 | 1306 | | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1317 | 1312 | | |
1318 | 1313 | | |
1319 | 1314 | | |
| |||
0 commit comments