Do I need to make the function suspending and make...
# arrow
m
Do I need to make the function suspending and make the recursive call in an effect block or something?
p
IO is stack safe by design
oh, I see
@raulraja stack safety in coroutines attacks again
in any case you have
tailrecM
follow the types and those are safe
m
Cool, will give tailrecM a try
r
suspended functions are not stack safe though
but you can use tailrec suspend
or just get inside IO as soon as you can but if you model recursion with suspension you will need
tailrec
m
I've tried making such a function tailrec, but the fact that the function is declared as an IO block means you can't actually make a tail call
tailrecM FTW.
🤘🏼 2