Structured concurrency in Haskell

Hello folks,

I’d like to announce a new structured concurrency library in the Haskell ecosystem, which was heavily inspired by many of the blog posts and libraries shared here. I’d just like to say thanks for all of the interesting material!

Package: https://hackage.haskell.org/package/ki
Source code: https://github.com/mitchellwrosen/ki

One of the main differences in Haskell as compared to Python and Kotlin is the existence of the GHC runtime system. It makes writing concurrent code in Haskell a bit more “adversarial”, as a thread does not typically voluntarily yield control, and can be delivered a so-called “asynchronous exception” from the RTS at any time.

Otherwise, the straightforward concept of delimiting the lifetime of concurrent threads with a syntactic block of code translated over very nicely!

What about the other main piece of structured concurrency, which is cancellation? (I haven’t read the package material.)