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

Haskell also has it in the Data.List.Split library, which is handy, although it's easy to define yourself.

λ> chunksOf 3 [1..12]

[[1,2,3],[4,5,6],[7,8,9],[10,11,12]]



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

Search: