I can see Doc `render`-ing blowing the stack pretty easily. It might be a good idea to move to trampoline for that recursive call.