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

Remove default implementation for withRunInIO #56

Closed
akrmn opened this issue Mar 2, 2020 · 1 comment
Closed

Remove default implementation for withRunInIO #56

akrmn opened this issue Mar 2, 2020 · 1 comment

Comments

@akrmn
Copy link

akrmn commented Mar 2, 2020

Forgot to mention, a consequence of #55 is that this default implementation will make withRunInIO loop through askUnliftIO for people who define an empty instance (or who derive anyclass).

{-# INLINE withRunInIO #-}
withRunInIO :: ((forall a. m a -> IO a) -> IO b) -> m b
withRunInIO inner = askUnliftIO >>= \u -> liftIO (inner (unliftIO u))

@snoyberg
Copy link
Member

snoyberg commented Mar 2, 2020

Good catch, thanks! That was a stupid mistake on my part. Releasing a fix shortly.

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

No branches or pull requests

2 participants