serokell / universum

:milky_way: Prelude written in @Serokell
MIT License
176 stars 26 forks source link

Add concurrent primitives using State #234

Closed Martoon-00 closed 2 years ago

Martoon-00 commented 3 years ago

I want to have modifyTVarS :: TVar s -> StateT s STM a -> STM a because it is often more convenient than modifyTVar.

We had a similar function in serokell-utils, but it is too large to be depended on for such a minor purpose. I think having this thing in universum is justified as we already export many methods related to concurrency.

A similar method is worth having for modifyMVar.