#Reader with mutable set

1 messages · Page 1 of 1 (latest)

flint grotto
#

hi, im using Reader for dependency injection into functions. One of the dependency is a Set , it will be seeded data when app starts, and modified during the app lifetime. So im thinking of State monad. And so in Haskell there is the RSWT which combines Reader, State and Writer (I have never used RSWT in Haskell before, but thought it is the solution here).

So, is my solution correct to use the RSWT to both inject dependency and modify a dependency? If not, what should I do?

Im using F# btw, not Haskell

primal elm
#

I don’t think your solution is wrong, but I’ve found using reader/writer monads less convenient than partial application.

If you build a computation expression that joins all three, I think that might help your implementation code.

flint grotto
#

oh you mean rolling my own version of RWST?