4 ms·
I like trio a lot, wish there was a grpc library with typing hints that could run on it.
by zinclozenge 6y ago
I like trio a lot, wish there was a grpc library with typing hints that could run on it.
- eru 6y agoYes, that would be neat. Trio's nurseries remind a little bit of IO in Haskell. Forgetting all about Monads etc, you can re-interpret IO-typing in Haskell as the requirement to keep carry something like a 'nursery' around with your code. Parts of code that don't have access to such a 'nursery'-like object can't do IO. (And because it's Haskell, that access is also tracked in the types.)
- samprotas 6y agoIt’s also very directly related the to “effectively standard” (but not included) async library in Haskell. https://hackage.haskell.org/package/async https://hackage.haskell.org/package/async The package description at the top of the link touches on the motivations which basically mirror this article. I’ve personally never reached for the built in forkIO. withAsync or it’s helpers like mapConcurrently are always equally capable, easier to use, and with none of the foot guns.