2 ms·
Take a look at parsers. E.g. Parsec (http://www.haskell.org/haskellwiki/Parsec http://www.haskell.org/haskellwiki/Parsec). They probably have lots of tail-cal
by eru 16y ago
Take a look at parsers. E.g. Parsec (http://www.haskell.org/haskellwiki/Parsec http://www.haskell.org/haskellwiki/Parsec). They probably have lots of tail-calls, and wouldn't look nice with loops. Some parsers also make use of continuation passing (http://en.wikipedia.org/wiki/Continuation-passing_style http://en.wikipedia.org/wiki/Continuation-passing_style), which only works with tail-call optimizations.