Hi!
I believe the canonical way to handle this in Yesod is the "reader pattern" (https://www.fpcomplete.com/blog/2017/06/readert-design-pattern):
* it's by the same author
* yesod is a ReaderT and I'm not aware of a way to replace this monad with one of your own (e.g. some effects systems State monad, which you can then run as a MVar, so that you have concurrent writing/reading possible between the different threads spawned by yesod for handling each request)
======
Georgi