Refactor Haskell compiler maintainability and typeclass contracts - #145
Refactor Haskell compiler maintainability and typeclass contracts#145Un3qual wants to merge 49 commits into
Conversation
|
Skipping CodeAnt AI review — this PR changes more than 100 files, which usually means a migration, codemod, or vendored drop. Line-level review on diffs this large produces duplicate findings on the same rewrite pattern and drowns out anything that actually matters. If you still want a review, comment |
|
Important Review skippedToo many files! This PR contains 106 files, which is 6 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (106)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Summary
Semigroup,Monoid,Enum, andBoundedcontractsNFDatacontracts for pure compiler products and reduceJazz.Compiler.Forcefrom 1,112 lines to 89 while retaining named phase boundariesWhy
The Haskell architecture had sound phase boundaries but accumulated oversized orchestration modules, duplicated ownership types, long positional APIs, manual structural forcing, and hand-maintained composition helpers. This refactor keeps the distinct compiler representations and proof boundaries while making responsibility and navigation explicit.
The audit also corrected one supplied-report claim:
forceCompiledModules,forceExpr,forceListWith,forceSurfaceExpr, andforceTokensare active benchmark APIs. They remain supported; the structural entry points now delegate to declaration-localNFDatainstances.Runtime values, closures, evaluator state, host effects, and inference's intentionally shallow pre-finalization ownership boundary do not receive blanket
NFDatainstances. Rendered runtime-output forcing remains deliberately selective.Impact
Verification
nix --extra-experimental-features 'nix-command flakes' develop --command cabal build all -fdevelopmentnix --extra-experimental-features 'nix-command flakes' develop --command cabal test all -fdevelopment --test-show-details=direct --test-option=--sequential— all 63 suites passed; no failed-suite orFAIL:log entriesnix --extra-experimental-features 'nix-command flakes' develop --command cabal checkgit diff --checkRuntime/Types.hsretains the documented formatter exception: the pinned Ormolu Haddock parser cannot parse GHC 9.14's validdata VExplicitResultHintsexport syntax; the development build and runtime suites cover that file.Summary by cubic
Refactors the Haskell compiler for clearer phase ownership and smaller modules, replaces bespoke forcing/accumulators with lawful typeclass contracts, and centralizes runtime outcomes. Public behavior and representations are unchanged; manual structural forcing is replaced by declaration-local NFData without widening runtime strictness.
Semigroup/Monoid; derivesEnum/Boundedfor surface numeric types; adds minimal law-focused tests.NFDatafor pure compiler products and reduces the forcing façade to namedrnfboundaries; runtime closures/env/state remain intentionally non-NFData.scripts/check-haskell-format.sh, rejection of partialerrorand qualifiedMap.!, and advisory HLint; adjusts Cabal warnings for the pinned formatter.Diagnostics.Strictnessprovides the only cross‑phase diagnostic forcing;ModuleResolverdrops a duplicateResolvedModulein favor of the canonical graph artifact.Migration
runSource*orrunModuleGraph*(and theirObservedvariants) for compilation/execution, or construct explicit runtime requests where applicable.forceCompiledModules,forceExpr,forceListWith,forceSurfaceExpr, orforceTokens; they now delegate to localNFDatainstances.Written for commit 088db94. Summary will update on new commits.