Map with tail recursion


#1

Originally published at: https://purelyfunctional.tv/recursion-101/map-with-tail-recursion/
In the sixth lesson in Recursion 101, we rewrite map to be tail recursive. This lesson includes a video screencast and some code. The lesson is 3 minutes long.


#2

@ericnormand could you do this with the loop macro to hold the accumulator? I was curious why you prefer using a helper function for this. Thanks for the great material!


#3

Hi @chadhs,

Yes, you can do it with a loop. See the tenth lesson: https://purelyfunctional.tv/recursion-101/looprecur/

Rock on!
Eric


#4

Awesome thanks, almost to that lesson, should have read the upcoming titles…