3 ms·
Not tail call optimisation, tail call elimination. If the language is based on recursion, you can't just hope it happens commonly enough, it has to happen all
by masklinn 5y ago
Not tail call optimisation, tail call elimination.
If the language is based on recursion, you can't just hope it happens commonly enough, it has to happen all the time, even for corecursive functions.
Except I've never been super clear on Haskell having TCE or not, because laziness means there are limited opportunities for it to even fire.
- tome 5y agoBecause function evaluation is lazy all Haskell (well, GHC) calls are tail calls. The only thing that consumes stack is case.