Add more recipes
Follow-up to https://github.com/typelevel/cats-effect/issues/3410 / https://github.com/typelevel/cats-effect/pull/3412, which introduced the Recipes page:
https://typelevel.org/cats-effect/docs/recipes
"Recipes" are small examples that show how to solve common problems using Cats Effect. A "reverse-index" to the CE standard library, if you like. So ideally the recipes page will cover all of std.
Recipe ideas
- [x] "how to atomically update a ref with the result of an effect" aka
AtomicCell - [ ] "how to handle multiple callbacks from some unsafe API" aka
Dispatcher(+Queue) - [ ] "how to guarantee exclusive access to some resource" aka
Mutex - [ ] "how to replace
KleisliwithIOLocal" - [ ] your ideas here 😁
I think somebody on the Discord brought up the idea that the recipes could act like a kind of reverse-index for CE concepts. That would be great for discoverability. For instance, I only realized yesterday that Dispatcher is exactly what I needed a couple months back when I implemented a callback-to-cats-effect thing. It probably makes sense to have a recipe for that, OTOH (at least for me) the example in the docs for Dispatcher here would have been the perfect starting point, I just wasn't aware. It probably doesn't make sense to duplicate the docs, but just add a pointer of some kind?