Polysemy concurrency effect#2748
Conversation
mdimjasevic
left a comment
There was a problem hiding this comment.
Thanks for this!
I just have one tiny comment in a sequential interpreter, but even if my comment is valid, I think we can do that in a follow-up PR to fix it.
| ------------------------------------------------------------------------------ | ||
|
|
||
| -- | Safely perform "concurrency" by doing it sequentially. | ||
| sequentiallyPerformConcurrency :: Sem (Concurrency safe ': r) a -> Sem r a |
There was a problem hiding this comment.
Should this have been 'Safe instead of safe in the type :: Sem (Concurrency safe ': r) a -> Sem r a?
There was a problem hiding this comment.
@isovector , I guess this has slipped your attention because I merged this before you got a chance to reply. Here's just a reminder.
|
@isovector , I just pushed an empty commit to your fork/branch to trigger our CI that otherwise has a hard time figuring out it should run. I hope this is fine by you. Otherwise I can copy your branch into |
|
@mdimjasevic thanks for being on top of it! |
This PR adds a
Concurrencyeffect topolysemy-wire-zoo, which lifts behavior fromunliftiofor splitting up tasks over multiple threads. In general, this is unsafe in application code and polysemy doesn't handle it very well, and in most cases it is going to create surprising bugs if it's used in application code.That being said, there are "safe" usages of
Concurrencywhere the only actions being lifted areIO, which is something interpreters can guarantee. TheConcurrencyeffect tracks enforces this safety constraint at the type level.Checklist
changelog.d