Skip to content
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

loops: repeat and forever #313

Merged
merged 1 commit into from
May 3, 2024
Merged

loops: repeat and forever #313

merged 1 commit into from
May 3, 2024

Conversation

fwbrasil
Copy link
Collaborator

@fwbrasil fwbrasil commented May 3, 2024

Moves repeat from Seqs to Loops and introduces a new forever method to loop indefinitely.

loop()
@tailrec def loop(): Unit < S =
run match
case kyo: Kyo[Unit, S] @unchecked =>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be Kyo[?, S] or Kyo[Any, S]? Does that impact cost of typecheck?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd need to do a type cast or use map(_ => ... in the next line. The type itself has no cost, generic type parameters aren't checked at runtime.

@fwbrasil fwbrasil merged commit df91a40 into main May 3, 2024
3 checks passed
@fwbrasil fwbrasil deleted the loops-repeat-foreach branch May 14, 2024 21:54
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