chunksOf n splits a vector into length-n pieces. The
last piece will be shorter if
n does not evenly divide the
length of the vector. If
n <= 0,
chunksOf n
l returns an infinite list of empty vectors. For example:
Note that
chunksOf n [] is
[], not
[[]]. This is intentional, and is consistent with a recursive
definition of
chunksOf; it satisfies the property that
chunksOf n xs ++ chunksOf n ys == chunksOf n (xs ++ ys)
whenever
n evenly divides the length of
xs.