TristanCacqueray / ki-effectful

MIT License
7 stars 1 forks source link

Should `await` be in `StructuredConcurrency`? #8

Closed michaelpj closed 4 months ago

michaelpj commented 4 months ago

At the moment you can't do everything you want to do with Ki using just StructuredConcurrency :> es, because await and awaitAll are in STM, which requires Concurrent :> es. That seems like a shame!

TristanCacqueray commented 4 months ago

You can use Effectful.Ki.atomically to get STM values, thus I don't think we need to deal with await, or do we?

michaelpj commented 4 months ago

:facepalm:

So you can! It just didn't occur to me that STM might be also provided by StructuredConcurrency. Never mind!

I guess it's a bit unclear where to slice these things, it's also a little odd to have STM when you just ask for StructuredConcurrency...

michaelpj commented 3 months ago

I raised https://github.com/TristanCacqueray/ki-effectful/issues/9 about the STM question, which I do think is interesting.