Skip to content

feat(repeat): revive repeat_pattern as generic repeat_apply - #910

Merged
martin-henz merged 1 commit into
masterfrom
feat/repeat-apply
Aug 12, 2026
Merged

feat(repeat): revive repeat_pattern as generic repeat_apply#910
martin-henz merged 1 commit into
masterfrom
feat/repeat-apply

Conversation

@martin-henz

Copy link
Copy Markdown
Member

Summary

  • Rune's repeat_pattern applied a closure to a value n times, but it was rune-specific (asserting the result stayed a Rune after each step) even though the underlying n-times-application logic is generic. It was removed from the rune bundle in docs/enhancement: fix landing page, sound/scrabble docs, remove rune's repeat_pattern #888 with a note that this belongs in the repeat module.
  • Revive it as repeat_apply in the repeat module: no rune dependency, arguments reordered to (func, n, x) to match the existing repeat(func, n) signature.

Test plan

  • yarn tsc passes in src/bundles/repeat
  • yarn test passes (8/8, including new repeat_apply cases: n-times application, n=0 identity, negative/non-integer n error)
  • yarn lint passes

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q3x3dGYsWpd1QfJaA9h3Za

Rune's repeat_pattern applied a closure to a value n times, but it was
rune-specific (asserted the result stayed a Rune after each step) even
though the underlying n-times-application logic is generic. It was
removed from the rune bundle in #888.

Bring it back as repeat_apply in the repeat module, with no rune
dependency, and with arguments reordered to (func, n, x) to match the
existing repeat(func, n) signature.
@martin-henz
martin-henz merged commit 7e25449 into master Aug 12, 2026
12 checks passed
@martin-henz
martin-henz deleted the feat/repeat-apply branch August 12, 2026 23:39
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.

1 participant