Jannis11/06/2019, 7:21 PM
datatype that will enable users to easily express all sorts of retry/repeat strategies and I am at the point of choosing where to add the retry/repeat methods. Since the whole thing involves delay I was thinking Async or above (using
from coroutines), but then I saw the
interface which offers some sort of sleep method for
and some other implementations for rx2 and reactor. So the question is, where does this go in the typeclass hierarchy?
raulraja11/06/2019, 7:22 PM
simon.vergauwen11/07/2019, 8:26 AM
is a separate typeclass because
is not needed for a datatype to
, so all it’s syntax is enabled in
typeclass and it has a
function that returns the derived instance. I’ll try to take a good look @ the
PR asap, and we can discuss further there.
Jannis11/07/2019, 12:36 PM
simon.vergauwen11/09/2019, 12:01 PM
which you already have from
using typeclasses. That means you can have a more general
which is not bounded to
fun <F, A> Kind<F, A>.retry(schedule: Schedule, T: Timer<F>, M: Monad<F>: Kind<F, A> = ... fun <F, A> Kind<F, A>.retry(schedule: Schedule: C: Concurrent<F>): Kind<F, A> = retry(schedule, C.timer(), C)
Jannis11/09/2019, 7:30 PM
simon.vergauwen11/09/2019, 7:31 PM
not just a data type that defines how to retry? Even if it needs to run any effects to calculate the next retry you could defer that and run that effect within
using the typeclasses, no?
Jannis11/09/2019, 8:27 PM