Advertisement
Guest User

Haskell chunksOf implementation

a guest
Feb 13th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. chunksOf :: Int -> [a] -> [[a]]
  2. chunksOf _ [] = []
  3. chunksOf n xs = chunk : (chunksOf n rest)
  4.     where (chunk, rest) = splitAt n xs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement