-
Notifications
You must be signed in to change notification settings - Fork 118
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
Heterogeneous concurrent apply #803
Conversation
We want to use rule parallelism in ghcide, but our user rules have heterogeneous key and result types. The Apply applicative is to Shake as the Concurrently applicative is to async For an example of the intended usage, see: haskell/haskell-language-server@dfeb649
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you aware that just doing normal applicative operations in the Action monad already does them together? So if you do apply F <*> apply X
it will evaluate F
and X
in parallel. With that, do we need this mechanism?
I was vaguely aware, I requested that feature but it wasn't clear when/how it works. Can you clarify whether F and G are evaluated in parallel in Do we still need this? Maybe. |
Any combination of operations that doesn't use Looking at the docs for |
That seems too good to be true. Why do we need |
There are still useful cases for parallel though - if your Shake threads are doing meaningful work, or there are monadic dependencies in either branch, it can help. But it's use case is significantly diminished from when you didn't have applicative merging. |
In that case, all we need to do in ghcide is enable |
haskell/haskell-language-server#1667 enables ApplicativeDo in ghcide and seems to do the trick (although I have not collected any evidence of parallelism). Closing this PR as unneeded, since the applicative instance already does what we need and as you said |
Thanks, I've improved the docs. |
We want to use rule parallelism in ghcide, but our user rules have heterogeneous key and result types.
The Apply applicative is to Shake as the Concurrently applicative is to async.
For an example of the intended usage, see:
haskell/haskell-language-server@dfeb649