haskell: Phase 11 — Data.Map BST skeleton (Adams weight-balanced)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m6s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 08:34:42 +00:00
parent d2638170db
commit a29bb6feca
2 changed files with 142 additions and 1 deletions

View File

@@ -179,7 +179,7 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
### Phase 11 — Data.Map
- [ ] Implement a weight-balanced BST in pure SX in `lib/haskell/map.sx`.
- [x] Implement a weight-balanced BST in pure SX in `lib/haskell/map.sx`.
Internal node representation: `("Map-Node" key val left right size)`.
Leaf: `("Map-Empty")`.
- [ ] Core operations: `empty`, `singleton`, `insert`, `lookup`, `delete`,
@@ -304,6 +304,13 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
_Newest first._
**2026-05-07** — Phase 11 BST skeleton in `lib/haskell/map.sx`:
- Adams-style weight-balanced tree: node = `("Map-Node" k v l r size)`,
empty = `("Map-Empty")`. delta=3 / gamma=2 ratios. Implemented constructors
+ accessors + the four rotations (single-l, single-r, double-l, double-r)
+ `hk-map-balance` smart constructor that picks the rotation. Spot-checked
with eval calls; user-facing operations (insert/lookup/etc.) come next.
**2026-05-07** — Phase 10 conformance: statistics.hs (5/5) + newton.hs (5/5) → Phase 10 complete:
- `program-statistics.sx`: mean / variance / stdDev on a [Double], exercising
`sum`, `map`, `fromIntegral`, `/`, `sqrt`. 5/5.