You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few ways to improve this:
Thanks for this resource! Just a few suggestions for readability, performance and lack of stack overflows.
1. Use a Vector - you're doing random accesses which are O(N) for Lists but O(1) for Vectors.
2. Make conditionals positive, much easier to reason about than negative conditionals
3. (2) enables the recursive call to Iter() to be last in the Iter function, which allows Iter to be tail recursive, which means no matter how long the parameter is it will never cause a stack overflow.
0 commit comments