Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
anaphor
on Sept 1, 2013
|
parent
|
context
|
favorite
| on:
Brilliant or insane code?
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:
λ> chunksOf 3 [1..12]
[[1,2,3],[4,5,6],[7,8,9],[10,11,12]]