How roughen (as opposed to flatten) a list in a functional style?

Posted by iamsungod on Stack Overflow See other posts from Stack Overflow or by iamsungod
Published on 2010-05-20T15:26:25Z Indexed on 2010/05/21 11:30 UTC
Read the original article Hit count: 115

For instance, I have a list (1 2 3 4 5 6 7 8 9 10 11), and want to roughen it by 3 elements (or another length) to get ((1 2 3) (4 5 6) (7 8 9) (10 11)). What pretty code could I use for this? Thanks.

© Stack Overflow or respective owner

Related posts about scala

Related posts about functional-programming