Skip to content

Fix variable naming conflicts in doctests and documentation accuracy#41

Merged
akollegger merged 2 commits intorefactor/rename-pattern-constructorsfrom
copilot/sub-pr-40
Dec 30, 2025
Merged

Fix variable naming conflicts in doctests and documentation accuracy#41
akollegger merged 2 commits intorefactor/rename-pattern-constructorsfrom
copilot/sub-pr-40

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 30, 2025

Addresses review comments from PR #40 regarding variable naming conflicts in doctest examples and documentation inconsistencies.

Changes

  • Documentation: Corrected pattern-construction.md to state "two functionally equivalent ways" (was "three") for creating atomic patterns, reflecting that only point and pure remain after patternWith removal.

  • Doctest variable naming: Renamed all variables named pattern to p in Pattern.Core.hs to avoid shadowing the pattern function. Affects Functor and Traversable instance examples.

-- Before (naming conflict)
pattern = pattern "greeting" [elem1, elem2]
fmap (map toUpper) pattern

-- After (no conflict)
p = pattern "greeting" [elem1, elem2]
fmap (map toUpper) p

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Note

Documentation cleanup and doctest fixes

  • Updates docs/users/api/pattern-construction.md to reflect only two atomic constructors (point, pure) and clarifies that pattern is for patterns with elements
  • Renames doctest variables from pattern to p in Pattern/Core.hs Functor and Traversable examples to avoid shadowing the pattern function; no functional code changes

Written by Cursor Bugbot for commit 4966c95. This will update automatically on new commits. Configure here.

Co-authored-by: akollegger <53756+akollegger@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Pattern library documentation for constructor changes Fix variable naming conflicts in doctests and documentation accuracy Dec 30, 2025
Copilot AI requested a review from akollegger December 30, 2025 21:47
@akollegger akollegger marked this pull request as ready for review December 30, 2025 21:50
@akollegger akollegger merged commit 4fa37d8 into refactor/rename-pattern-constructors Dec 30, 2025
1 check passed
@akollegger akollegger deleted the copilot/sub-pr-40 branch December 30, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants