3 ms·
Loops are generally special cases of recursion. You can always derive an iterator from a recursor by forgetting things, but you need product types or ambient st
by tel 13y ago
Loops are generally special cases of recursion. You can always derive an iterator from a recursor by forgetting things, but you need product types or ambient state to go the opposite way.
In Turing complete languages they're both special cases of fixed-point equations, though, so in that sense they both have the same goal.