haskell: Phase 12 — Data.Set full API (union/intersection/difference/isSubsetOf/filter/map/foldr/foldl)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 36s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 11:39:11 +00:00
parent 208953667b
commit 34513908df
2 changed files with 41 additions and 1 deletions

View File

@@ -206,7 +206,7 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
- [x] Implement `Data.Set` in `lib/haskell/set.sx`. Use a standalone
weight-balanced BST (same structure as Map but no value field) or wrap
`Data.Map` with unit values. _Chose the wrapper approach: Set k = Map k ()._
- [ ] API: `empty`, `singleton`, `insert`, `delete`, `member`, `fromList`,
- [x] API: `empty`, `singleton`, `insert`, `delete`, `member`, `fromList`,
`toList`, `toAscList`, `size`, `null`, `union`, `intersection`, `difference`,
`isSubsetOf`, `filter`, `map`, `foldr`, `foldl'`.
- [ ] Module wiring: `import Data.Set` / `import qualified Data.Set as Set`.
@@ -307,6 +307,14 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
_Newest first._
**2026-05-07** — Phase 12 Data.Set full API:
- Added `from-list`/`union`/`intersection`/`difference`/`is-subset-of`/
`filter`/`map`/`foldr`/`foldl` — all delegate to the corresponding
`hk-map-*` helpers with the value side ignored. `union`/`intersection`
use `hk-map-union-with`/`hk-map-intersection-with` with a constant
unit-returning combine fn. Spot-check confirms set semantics: dedupe
on fromList, correct /∩/ and isSubsetOf.
**2026-05-07** — Phase 12 Data.Set skeleton (wraps Data.Map with unit values):
- New `lib/haskell/set.sx`. `hk-set-empty/singleton/insert/delete/member/
size/null/to-list` all delegate to the corresponding `hk-map-*`. Storage