-
Notifications
You must be signed in to change notification settings - Fork 36
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
MonadUnliftIO #69
Comments
👋 I found this issue because we also use recovering
:: MonadUnliftIO m
=> RetryPolicyM m
-> [RetryStatus -> Handler m Bool]
-> (RetryStatus -> m a)
-> m a
recovering policy hs f = withRunInIO $ \runInIO ->
Retry.recovering
(transPolicy runInIO policy)
(map ((.) $ transHandler runInIO) hs)
$ runInIO
. f
transPolicy :: (forall a . m a -> n a) -> RetryPolicyM m -> RetryPolicyM n
transPolicy f (RetryPolicyM p) = RetryPolicyM $ f . p
transHandler :: (m a -> n a) -> Handler m a -> Handler n a
transHandler f (Handler h) = Handler $ f . h And I'm considering making an Should I proceed on that, or is there a chance |
@ozataman any opinions on this?
@pbrisbin LMK what you think of the alternate module idea. If everybody likes it and you have the time, I think publishing retry with this separate module might be easier on everyone than maintaining a separate package. |
The separate module idea sounds great! Though I think |
Good call on the module name, we should follow conventions of the unliftio world. I'll leave the door open to let Oz weigh in if he wants to but I feel like there's little downside to this: it's non-breaking and opt in, unliftio-core introduces no new transitive dependencies, and it gives people a forward-looking way to use the library. The only downside is the duplication in code but retry is fairly stable at this point so I think most of that cost will be paid once. @pbrisbin I'd appreciate the PR greatly when you get the chance! Thank you for stepping up! |
@MichaelXavier Here you go, #81 |
Thanks for this highly useful library.
Would you consider switching from using exceptions to unliftio?
With
UnliftIO.Exception
, the exception handlers mask asynchronous exceptions by default, and it's less easy to catch asynchronous exceptions.The classes
MonadIO
,MonadCatch
, andMonadMask
are all replaced byMonadUnliftIO
.I would encourage users to switch.
The text was updated successfully, but these errors were encountered: