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

> reverse a list without mutation using a foldLeft

This is maybe a little too obvious if you understand left folding at all. A less trivial exercise in the same vein is to implement right folding via left folding. It's just a one-liner, but if you haven't tried it before, it's enlightening and worth giving a shot.



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

Search: