Does ReScript has a way to implement an generics retry function?

Like Tenacity in Python Pip.

I Don’t know how to write this generic function

This is relatively simple to implement with a few higher order functions:

I would point out that the decorators in python are not the same as the @ decorators you see in ReScript. They can accomplish similar things and you may be able to implement a similar retry API as tenacity, although I would recommend being more explicit and just using higher order functions.

One thing that also may be different to the python API is that in ReScript the arity (the number of arguments) of a function is fixed at compile time. You can see this in the playground link, you need to write a function that receives 1, 2, 3 etc. arguments.

1 Like