chunk n list = case list of { [] -> [] ; (y:ys) -> ch' ys (n-1) (y:) } where ch' [] _ k = k [] : [] ch' (y:ys) 0 k = k [] : ch' ys (n-1) (y:) ch' (y:ys) (c+1) k = ch' ys c (k . (y:))
Post a Comment
No comments:
Post a Comment