Skip to content

Use the stdlib Set for the compiler's sets - #8789

Draft
cknitt wants to merge 3 commits into
stdlib-hashsetfrom
stdlib-set
Draft

cknitt wants to merge 3 commits into
stdlib-hashsetfrom
stdlib-set

Conversation

@cknitt

@cknitt cknitt commented Oct 10, 2026

Copy link
Copy Markdown
Member

Third of four PRs moving the compiler's own collections onto the OCaml standard library, stacked on #8787. This one covers sets.

Set_ident, Set_int and Set_string are now Set.Make instances with the same comparison functions, including Ext_string.compare (length first) for strings, so iteration order is unchanged. Call sites use the stdlib argument order (Set_ident.add x s, Set_ident.mem x s, Set_ident.iter f s, …). Element and set types always differ, so the type checker verifies every flipped call. Ext_set and Set_gen are removed, together with the ounit tests of their balanced-tree invariants.

Output: byte-identical to #8787 on 628 files (Belt, all of tests/tests/src, and the benchmark stress inputs).

Performance: neutral (CPU −0.6%, allocation +0.35% vs master).

🤖 Generated with Claude Code

cknitt and others added 2 commits October 10, 2026 18:56
Set_ident, Set_int and Set_string are Set.Make instances with the same
comparisons; Ext_set and Set_gen are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt
cknitt added this pull request to stack #8788 October 10, 2026 18:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Christoph Knittel <ck@cca.io>
@pkg-pr-new

pkg-pr-new Bot commented Oct 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8789

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@8789

@rescript/darwin-arm64

npm i https://pkg.pr.new/@rescript/darwin-arm64@8789

@rescript/darwin-x64

npm i https://pkg.pr.new/@rescript/darwin-x64@8789

@rescript/linux-arm64

npm i https://pkg.pr.new/@rescript/linux-arm64@8789

@rescript/linux-x64

npm i https://pkg.pr.new/@rescript/linux-x64@8789

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8789

@rescript/win32-x64

npm i https://pkg.pr.new/@rescript/win32-x64@8789

commit: 5bae7ae

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant