This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0
README

List.Split

Split lists into chunks

Splitters

chunksOfLeft : Int -> List a -> List (List a)

Split list into smaller lists of length k, starting from the left.

chunksOfLeft 3 [1,2,3,4,5,6,7,8] == [[1,2,3],[4,5,6],[7,8]]
chunksOfRight : Int -> List a -> List (List a)

Split list into smaller lists of length k, starting from the right.

chunksOfRight 3 [1,2,3,4,5,6,7,8] == [[1,2], [3,4,5], [6,7,8]]
module List.Split where
{-| Split lists into chunks

# Splitters
@docs chunksOfLeft, chunksOfRight

-}

import List exposing (..)

{-| Split list into smaller lists of length `k`, starting from the left.

    chunksOfLeft 3 [1,2,3,4,5,6,7,8] == [[1,2,3],[4,5,6],[7,8]]
-}
chunksOfLeft : Int -> List a -> List (List a)
chunksOfLeft k xs =
  let len = length xs
  in  if len > k
      then take k xs :: chunksOfLeft k (drop k xs)
      else [xs]

{-| Split list into smaller lists of length `k`, starting from the right.

    chunksOfRight 3 [1,2,3,4,5,6,7,8] == [[1,2], [3,4,5], [6,7,8]]
-}
chunksOfRight : Int -> List a -> List (List a)
chunksOfRight k = map reverse << chunksOfLeft k << reverse