Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Haskell (for example) doesn't even have a looping primitive. Why would it have a tree traversal primitive?

Both looping and tree traversal can be done with library functions.

In general, everything that can be done with library functions, should be done with library functions.

> Doesn't for_tree(...) look a lot nicer and simpler and less error prone than needing to implement a recursive function for each operation you would want to do on a tree?

Eh, in Haskell you can derive many of these things automatically. And even Rust has some automatic derivation.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: