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

orDie combinator #902

Merged
merged 15 commits into from
Dec 7, 2024
Merged

orDie combinator #902

merged 15 commits into from
Dec 7, 2024

Conversation

johnhungerford
Copy link
Contributor

  • Removes Abort[E] effect for any E
  • If E is Throwable, throw any failures
  • If E is not Throwable, throw a PanicException that contains E

@johnhungerford
Copy link
Contributor Author

Addresses #651

@johnhungerford
Copy link
Contributor Author

Snuck in a few more changes:

  • Supporting union aborts (I didn't realize this was fixed with SafeClassTag, and was still using Tag)
  • Improved (I think) handling of some aborts
    • Previously, to handle some aborts, you had to do effect.handleSomeAbort[ErrorType](). The need to call () at the end kept throwing me off and I think is going to be a big wart for users. It was even worse for catchSomeAbort
    • Now I have a single ops class for all of these ...SomeAbort methods
      • effect.someAbort[ErrorType].handled
      • effect.someAbort[ErrorType].caught(e => ...)
      • effect.someAbort[ErrorType].caughtPartial { case ... => ... }
      • effect.someAbort[ErrorType].toEmpty
      • effect.someAbort[ErrorType].toChoice

README.md Outdated Show resolved Hide resolved
@fwbrasil fwbrasil merged commit e21e85b into getkyo:main Dec 7, 2024
3 checks passed
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.

3 participants