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

No, the standard library doesn't contain many of the things that Haskell's does because it's not Haskell, and people haven't really been asking for them like they have a variety of other things. And the reason people don't use them widely is that there's often better designs than passing around closures - lifetimes make useful mutation of closures' environments difficult, Rust largely revolves around mutation, so it's more common to invert the control flow (have functions return a command and interpret it, possibly in a loop, rather than have them take a closure) except in certain self-contained situations. That doesn't change the existence of HOFs.


Sounds to me like you're saying the exact same thing I am, which is that HOFs are too inconvenient to be practical in Rust.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: