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
raulraja
03/21/2020, 10:43 AM
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.