Hacker News new | ask | show | jobs
by kod 2746 days ago
Sounds like you are confused about what @tailrec does.

@tailrec is not necessary to enable tailcalls.

All the annotation does is error if a function is not able to be optimized for tail calls.

The (attempt at) optimization takes place either way, you don't need the annotation unless there's some doubt in your mind.