4 ms·
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 li
by eru 2y ago
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.