Merged
Conversation
…e Signature Documentation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new GraphView-based bulk graph transformation layer to pattern-hs, plus supporting API/doc updates and test coverage, aiming to enable composable transformation pipelines and context-aware/iterative algorithms over graphs.
Changes:
- Introduces
Pattern.Graph.Transform(bulk transforms +paraGraph/paraGraphFixed) andPattern.Graph.Types(GraphView,Substitution). - Adds
unfold(anamorphism) toPattern.Coreand expands top-levelPatternexports/docs for graph transformation workflows. - Refactors
fromGraphLensintoPattern.Graphto avoid circular imports; wires new specs/tests and cabal exposure.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
libs/pattern/src/Pattern/Graph/Transform.hs |
New transformation/iteration API over GraphView. |
libs/pattern/src/Pattern/Graph/Types.hs |
Defines GraphView + Substitution used by transform/filtering. |
libs/pattern/src/Pattern/PatternGraph.hs |
Adds toGraphView + materialize for PatternGraph ↔ GraphView. |
libs/pattern/src/Pattern/Graph.hs |
Adds fromGraphLens and toGraphView (from GraphLens) + docs/exports. |
libs/pattern/src/Pattern/Graph/GraphQuery.hs |
Removes fromGraphLens export and updates docs to match refactor. |
libs/pattern/src/Pattern/Core.hs |
Exposes new unfold function with Haddocks/examples. |
libs/pattern/src/Pattern.hs |
Updates public API surface and documentation to include transform modules. |
libs/pattern/tests/Spec/Pattern/Graph/TransformSpec.hs |
Adds test suite for new transform functionality. |
libs/pattern/tests/Spec/Pattern/GraphSpec.hs |
Adds toGraphView integration tests for GraphLens. |
libs/pattern/tests/Spec/Pattern/Graph/GraphQuerySpec.hs |
Updates imports for moved fromGraphLens. |
libs/pattern/tests/Test.hs |
Registers new transform spec in test runner. |
libs/pattern/pattern.cabal |
Exposes new modules + includes new test module. |
specs/036-graph-transform/* |
Adds feature spec/plan/research/quickstart/contracts for the new feature. |
.cursor/rules/specify-rules.mdc |
Notes the new feature in rule documentation. |
…a in place and added a short comment that it is required; Removed the unused TypeFamilies pragma; test now selects the node whose enriched value is 2; Import now includes materialize
… to:
-- Reconcile.HasIdentity v (Id v), Ord (Id v) in signatures so it’s clear why the extension is required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new bulk graph transformation module and improves the documentation and API surface of the
pattern-hslibrary. The most important changes are the addition of thePattern.Graph.Transformmodule for graph transformations, new exports and documentation in the mainPattern.hsmodule, and refactoring to avoid circular imports between graph modules. These updates make the library easier to use for graph transformation pipelines and clarify the separation between graph querying and transformation.Graph transformation features:
Pattern.Graph.Transformmodule, including bulk graph transformation functions (unfoldGraph,mapGraph,mapAllGraph,filterGraph,foldGraph,mapWithContext,paraGraph,paraGraphFixed), and exported it inpattern.cabalandPattern.hs. [1] [2]Pattern.hsto highlight graph transformation pipelines and the new module. [1] [2]API and documentation improvements:
GraphViewandSubstitutiontypes to the exports and documentation ofPattern.GraphandPattern.hs, clarifying their use in transformation pipelines. [1] [2]unfoldfunction (anamorphism) toPattern.Core, enabling recursive construction ofPatternvalues from seed data. [1] [2]Refactoring for modularity and circular import avoidance:
fromGraphLensconstructor forGraphQueryfromPattern.Graph.GraphQuerytoPattern.Graphto avoid circular imports, and updated documentation and module exports accordingly. [1] [2] [3] [4]Test coverage:
Spec.Pattern.Graph.TransformSpecto the test suite inpattern.cabalfor the new transformation module.Feature plan and rule updates:
.cursor/rules/specify-rules.mdcto document the new graph transformation features and their Haskell implementation. [1] [2]