haskell: Phase 11 — Data.Map module wiring (import qualified ... as Map)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 44s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 44s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -188,7 +188,7 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
|
||||
- [x] Combining: `unionWith`, `intersectionWith`, `difference`.
|
||||
- [x] Transforming: `foldlWithKey`, `foldrWithKey`, `mapWithKey`, `filterWithKey`.
|
||||
- [x] Updating: `adjust`, `insertWith`, `insertWithKey`, `alter`.
|
||||
- [ ] Module wiring: `import Data.Map` and `import qualified Data.Map as Map`
|
||||
- [x] Module wiring: `import Data.Map` and `import qualified Data.Map as Map`
|
||||
resolve to the `map.sx` namespace dict in the eval import handler.
|
||||
- [ ] Unit tests in `lib/haskell/tests/map.sx` (≥ 20 tests: empty, singleton,
|
||||
insert + lookup hit/miss, delete root, fromList with duplicates,
|
||||
@@ -304,6 +304,20 @@ No OCaml changes are needed. The view type is fully representable as an SX dict.
|
||||
|
||||
_Newest first._
|
||||
|
||||
**2026-05-07** — Phase 11 module wiring: `import Data.Map`:
|
||||
- Added `hk-bind-data-map!` helper in `eval.sx` that registers
|
||||
`<alias>.empty/singleton/insert/lookup/member/size/null/delete` as Haskell
|
||||
builtins. Default alias is `"Map"`.
|
||||
- New `:import` case in `hk-bind-decls!` dispatches to `hk-bind-data-map!`
|
||||
when modname = `"Data.Map"`. Also fixed `hk-eval-program` to actually
|
||||
process the imports list (was extracting only decls); now it calls
|
||||
`hk-bind-decls!` once on imports, then once on decls.
|
||||
- `test.sh` and `conformance.sh` now load `lib/haskell/map.sx` after
|
||||
`eval.sx` so the BST functions exist when the import handler binds.
|
||||
- Verified `import qualified Data.Map as Map` and `import Data.Map`
|
||||
(default alias) resolve `Map.empty`, `Map.insert`, `Map.lookup`, `Map.size`,
|
||||
`Map.member` correctly.
|
||||
|
||||
**2026-05-07** — Phase 11 updating (adjust/insertWith/insertWithKey/alter):
|
||||
- `adjust` recurses to find the key, replaces value with `f(v)`; no-op when
|
||||
missing. `insertWith` and `insertWithKey` recurse with rebalance and use
|
||||
|
||||
Reference in New Issue
Block a user