https://kotlinlang.org logo
Title
p

pakoito

03/10/2019, 12:42 PM
can you explain it a bit? 😄
j

Jannis

03/10/2019, 12:48 PM
The basic structure of it is: You create a policy datatype which describes how to repeat/retry computation. That type is an instance of some typeclasses like alternative/applicative/monoid etc and has some powerful composition functions. Then all you need to do is call a retry/repeat function with that schedule.
some slides that show this
the talk for it is also good, the interesting bits start somewhere in the middle, i'll look up the slide number ...
at like slide 40
I also did a port of this once, but I think this can be done better for arrow
p

pakoito

03/10/2019, 12:51 PM
does it require any of the ZIO environment internals? that’s our bane because we depend on coroutines for threading and such
j

Jannis

03/10/2019, 12:52 PM
nah, it is much older than that afaik
r

raulraja

03/10/2019, 1:19 PM
if anyone attempts this try it over EnvFx
That is ZIO + Environment over the suspended system
Which in 0.9.0 will become EnvIO if we are able to fix the cancelation and stack safety which are still missing there
i

Imran/Malic

03/14/2019, 1:46 PM
Can you explain what some implications are from EnvFx. I do understand the code, but what can I do with it. Is it something like a Store for all my Dependencies? Do I even need it if I use a Reader Monad? //I did not yet use a Reader Monad for some of my projects
p

pakoito

03/14/2019, 3:16 PM
It's like IO but you can
ask()
for the environment that it carries. So it's like extension functions and receivers but embedded on your concurrency framework
i

Imran/Malic

03/14/2019, 7:56 PM
Damn, so I could carry the computation of a DI framework?
p

pakoito

03/14/2019, 8:06 PM
ye
i

Imran/Malic

03/14/2019, 10:57 PM
I have a question I am trying to model multiple Services (API calls) as Products and these services are self-sufficient. Is there a better way to model this as Coproducts, because at the time I stumbled over it, I thought "this is it". I am not sure If I can then sum multiple Coproducts (API Services) into a type class. To be specific, is this a good way of modeling or am I on the wrong track here.
p

pakoito

03/14/2019, 11:40 PM
Use tuples or create a new interface to provide them
try this
i

Imran/Malic

03/15/2019, 12:10 PM
Thanks, I'll get back to you, when I figure it out.
i

Imran/Malic

03/20/2019, 10:17 AM
didn’t you send it before 🙂
r

raulraja

03/20/2019, 10:19 AM
It packs DI, Custom error handling, throwable handling and IO effect suspension all in one efficient datatype defined over
suspend
functions with an underlying effect aware runtime and event loop that is going to be stacksafe and performant. Additionally allows you to describe entire architectures just as pure functions and suspended effects. Supports concurrency out of the box and implements the Effects type classes so you can run your programs thanks to Arrow's polymorphism to any framework. It complements and is comptaible with
coroutines-core
based programs and adds extra layers of safety atop the coroutines
async/await
model generalized and stack safe for all monad capable data types. https://gist.github.com/raulraja/0088c4d41c3fdcf5aa77e73316f4af22 If you've followed John De Goes latest work on Evironment + Zio. This is the Kotlin version of it which we had already supported before through the typeclassless technique pioneered by @pakoito and the Reader/Kleisli types but not over
suspend
. The future of Arrow effects is
suspend
and pure imperative syntax for effects based programs.
:arrow: 9