Let’s say I have a simple fibonacci function. The below code does not compile because of a type error of the return that returns the recursive function. What is the right type?
However, be aware that each recursive call through a public actor method is an asynchronous canister message send, so this will be horribly slow. For a recursive algorithm, your solution of doing the recursion in a synchronous helper function actually is waaaay better.