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

In .Safe module, use async's concurrently, race, and race_ #20

Closed
wants to merge 1 commit into from

Conversation

snoyberg
Copy link
Contributor

The upstream versions of the functions are more efficient, being
implemented via MVars and not leveraging the full Async machinery. In
addition to getting a performance boost from this change, we also
guarantee that, in the case of deadlocks, the exceptions generated from
the .Safe module match those generated by Control.Concurrent.Async.

Note that this change does not make sense for the unsafe module in this
package.

The upstream versions of the functions are more efficient, being
implemented via MVars and not leveraging the full Async machinery. In
addition to getting a performance boost from this change, we also
guarantee that, in the case of deadlocks, the exceptions generated from
the .Safe module match those generated by Control.Concurrent.Async.

Note that this change does not make sense for the unsafe module in this
package.
@snoyberg
Copy link
Contributor Author

Forgot to ping @feuerbach


-- | Helper function which converts an 'IO'-specialized combinator
-- into a generalized combinator.
unliftFuncs :: forall m a b c. (MonadBaseControl IO m, Forall (Pure m))
Copy link
Owner

Choose a reason for hiding this comment

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

Could we rename unliftFuncs to liftBaseOp2_? It's more like liftBaseOp_ in monad-control but the argument function takes two params and also it has Forall (Pure m) constraint.

@maoe
Copy link
Owner

maoe commented May 22, 2016

Made the fixes and some other optimizations: https://github.com/maoe/lifted-async/tree/snoyberg/develop

@snoyberg
Copy link
Contributor Author

Very nice!

On Sun, May 22, 2016 at 5:44 AM, Mitsutoshi Aoe notifications@github.com
wrote:

Made the fixes and some other optimizations:
https://github.com/maoe/lifted-async/tree/snoyberg/develop


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#20 (comment)

@maoe
Copy link
Owner

maoe commented May 22, 2016

Thanks for the contribution! I merged this commit into develop. GitHub doesn't seem to think this PR has been merged for some reason, so I'm closing this manually. I'll release a new version on Hackage 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

Successfully merging this pull request may close these issues.

None yet

2 participants