I think the right solution for my “issue” is to go...
# arrow
k
I think the right solution for my “issue” is to go away from Ref and StateT and use a ReaderT that returns a value
x
and then I just do
myState = myState.copy(newVal=x)
instead of trying to put my state in a
Ref
and have
StateT
take
oldState
and return
(newState, Unit)
.
r
ReaderT in Kotlin is rather useless given the support for extension functions unless you are working with a transformer stack polymorphicaly that you want to make concrete to ReaderT or Kleisli.
In case it helps two different approaches to DI
Those encodings are more performance than stacking transformers because the transformers add an additional layer of nesting