-
Notifications
You must be signed in to change notification settings - Fork 0
006 gram hs migration #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sp, which now uses `pattern` and `pure`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a comprehensive migration to the updated Gram-HS library constructor API, systematically replacing the old pattern/patternWith constructor names with the new pure/pattern (in Lisp) and point/pattern (in Haskell) functions throughout the codebase. The migration maintains functional equivalence while ensuring consistency with the updated library's naming conventions.
Key Changes:
- Updated Pattern constructor imports from
Pattern.Core (pattern, patternWith)toPattern.Core (point, pattern)across all affected modules - Replaced atomic pattern constructions (
pattern value) withpoint valuein Haskell code andpure valuein Lisp examples - Replaced pattern-with-elements constructions (
patternWith decoration elements) withpattern decoration elementsthroughout the codebase - Added comprehensive migration documentation including specifications, quickstart guides, and task checklists
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test/PatternLisp/RuntimeSpec.hs |
Updated imports and replaced pattern with point for atomic patterns; updated test comments |
test/PatternLisp/PrimitivesSpec.hs |
Updated test descriptions and examples from pattern/pattern-with to pure/pattern |
test/PatternLisp/PatternSpec.hs |
Updated all test cases to use pure for atomic patterns and pattern for patterns with elements |
test/PatternLisp/GramSpec.hs |
Updated imports and replaced constructors in test helper functions |
test/PatternLisp/GramSerializationSpec.hs |
Updated imports and constructor usage in serialization tests |
test/PatternLisp/CodecSpec.hs |
Updated imports and helper functions to use new constructor names |
src/PatternLisp/Syntax.hs |
Renamed PatternWith primitive to Pure; updated primitive documentation and name mappings |
src/PatternLisp/Primitives.hs |
Updated initial environment to register pure instead of pattern-with; updated comments |
src/PatternLisp/PatternPrimitives.hs |
Replaced all patternWith calls with pattern and pattern calls with point; updated module documentation |
src/PatternLisp/Gram.hs |
Updated import and replaced atomic pattern with point |
src/PatternLisp/Eval.hs |
Updated primitive application handlers for Pure and PatternCreate with corrected error messages |
src/PatternLisp/Codec.hs |
Extensive updates replacing ~40 occurrences of patternWith with pattern and atomic pattern with point |
specs/006-gram-hs-migration/tasks.md |
Added comprehensive task breakdown for migration with 38 tasks across 6 phases |
specs/006-gram-hs-migration/spec.md |
Added feature specification with user stories, requirements, and success criteria |
specs/006-gram-hs-migration/research.md |
Added migration guide analysis and codebase analysis documentation |
specs/006-gram-hs-migration/quickstart.md |
Added quickstart guide with migration steps and common patterns |
specs/006-gram-hs-migration/plan.md |
Added implementation plan with constitution checks and project structure |
specs/006-gram-hs-migration/data-model.md |
Added data model documentation clarifying no structural changes |
specs/006-gram-hs-migration/contracts/README.md |
Added contracts documentation for internal API changes |
specs/006-gram-hs-migration/checklists/requirements.md |
Added specification quality checklist |
specs/003-pattern-state-functions/quickstart.md |
Updated examples to use pure and pattern instead of old constructors |
examples/pattern-predicates.plisp |
Updated example code to use pure for atomic patterns |
examples/pattern-basics.plisp |
Updated example code to use pure and pattern |
docs/plisp-serialization-design.md |
Updated documentation examples and primitive lists |
docs/pattern-state-lisp-design.md |
Updated all code examples to use new constructor names |
.github/workflows/build-and-test.yml |
Added cache restore-key and cabal v2-update command |
.cursor/rules/specify-rules.mdc |
Added migration to recent changes list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/build-and-test.yml
Outdated
| ~/.cabal/packages | ||
| key: ${{ runner.os }}-cabal-${{ matrix.ghc-version }}-${{ hashFiles('cabal.project', 'pattern-lisp.cabal') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-cabal-${{ matrix.ghc-version }}-${{ hashFiles('cabal.project', 'pattern-lisp.cabal') }}- |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duplicate cache restore-key pattern may cause cache restoration issues. The key ${{ runner.os }}-cabal-${{ matrix.ghc-version }}-${{ hashFiles('cabal.project', 'pattern-lisp.cabal') }}- with a trailing dash appears twice in the restore-keys list (lines 40 and 41). This duplication is redundant and should be removed to avoid confusion and potential cache lookup inefficiencies.
.github/workflows/build-and-test.yml
Outdated
| cabal update | ||
| # Force update of source-repository-packages to get latest gram-hs | ||
| # This ensures we get the latest version with 'point' export | ||
| cabal v2-update |
Copilot
AI
Dec 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command cabal v2-update is redundant and unnecessary. The cabal update command on the previous line already updates the package index, including source-repository-packages. The v2-update command is deprecated in modern Cabal versions (the v2- prefix is no longer needed), and calling both update commands sequentially provides no additional benefit while adding unnecessary build time.
| cabal v2-update |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@akollegger I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you. |
…-update Co-authored-by: akollegger <[email protected]>
Clean up CI/CD workflow cache configuration and remove deprecated commands
This pull request implements the migration to updated Pattern constructor names as part of the Gram-HS library integration. The primary focus is on replacing the old
patternandpattern-with/patternWithconstructors with the newpure,pattern, and (in Haskell)pointfunctions in all documentation, specs, and example code. No changes are made to the underlying data model or external API—this is a refactoring for internal consistency and future compatibility. Additionally, new documentation and checklists are added for the migration.Pattern Constructor Migration
patternfor atomic patterns withpure(in Lisp/Plisp examples/specs) and withpoint(in Haskell internal API), and replaced all uses ofpattern-with/patternWithwithpatternfor patterns with elements. This affects example files, documentation, and quickstart guides. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]Documentation and Specification Updates
.cursor/rules/specify-rules.mdcto document the new constructor usage and migration plan for Gram-HS, including migration rationale and test coverage. [1] [2]These changes ensure all internal and example code is consistent with the new Gram-HS constructor API, paving the way for future development and maintenance.