<@UGPMTH1D5> good question. Look here <https://kot...
# arrow
i
Whenever your using Reader outside of the context of Id you’ll need ReaderT. That is my digestible version.
And essentially local does nothing else than what it says in our API’s
d
So one issue - my monad is now
ReaderT<ForEitherT<ForIO, X>, D, A>
i
ok go on
d
bbl.....
i
come again?
d
be back later
💪🏽 1
😅 1
i
BTW I recommend you to flatten your Stack and stay in your Context F without making it concrete to IO. Thereby you don’t need Reader and avoid the performance issues with all <something>T classes as ReaderT, EitherT etc.
But if your using top level functions a la Haskell. You do you 😎
r
Transformers and complex transformers stack are hard to use in Kotlin because kinds are emulated and you will end up having to call fix n times as many layers
d
I am finding that.
r
also inference is not great
d
I am also finding that.
😓
r
that is why we arebaking some of those concerns in IO
including DI
The Reader though is pointless in Kotlin because Kotlin has receiver functions
so
R.() -> IO<A>
is the same as
(R) -> IO<A>
d
hmmmmmmmmmmmmmmmm
r
and you can just encode:
d
let me ponder and iterate
r
Copy code
fun <R>.foo(): IO<Int> where R: MyService, R: MyService2...
you can use actual subtype constrains for DI in Kotlin because of delegates
also IO will have facilities for environment injection