Skip to content

Conversation

@aryairani
Copy link
Contributor

@aryairani aryairani commented Dec 25, 2025

Overview

#6073 reported that text.find doesn't find Nat literals in pattern matches.

See transcript diff for before and after.

Closes #6073

  • What does this change accomplish and why?

    • i.e. How does it change the user experience?
    • i.e. What was the old behavior/API and what is the new behavior/API?
  • Include "before and after" examples if appropriate. (You can copy/paste screenshots directly into this editor.)

  • List any Github issues that this PR closes, in closing-issues-using-keywords format.

Implementation approach and notes

Changes txtPattern to recognize more that Text cases.

Interesting/controversial decisions

I wasn't sure if show was the right move here or if we needed something more sophisticated, but it's a step in the right direction in any case.

Test coverage

  • Have you included tests (which could be a transcript) for this change, or is it somehow covered by existing tests?

  • Would you recommend improving the test coverage (either as part of this PR or as a separate issue) or do you think it’s adequate?

adequate

  • If you only tested by hand, because that's all that's practical to do for this change, mention that. Include screenshots.
    n/a

Loose ends

It doesn't work to use a negative number to search for a negative number, not sure why yet, but that limitation already existed.

n/a

Final checklist

  • Choose your PR title well: Your pull request title is what's used to create release notes, so please make it descriptive of the change itself, which may be different from the initial motivation to make the change.
  • Update your PR description if the specifics of the PR have changed over time.
  • Include transcripts or screenshots that demonstrate the changed behavior.
  • If you changed .cabal files, make sure the package.yaml files are up-to-date instead.

@aryairani aryairani requested a review from ceedubs December 25, 2025 02:40
@aryairani
Copy link
Contributor Author

aryairani commented Jan 3, 2026

Searching for a negative number fails, but I didn't have time to dig into it.
iirc "123" will find 123, +123, or -123, but "-123" won't find anything.

@aryairani aryairani merged commit 896d22d into trunk Jan 3, 2026
31 checks passed
@aryairani aryairani deleted the arya/find-numbers-in-match branch January 3, 2026 03:21
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.

text.find doesn't find Nat literals in pattern match

4 participants