krisajenkins/elm-exts/9.4.0

NOTE: this package is not compatible with Elm 0.19.1

Exts.List

Extensions to the core List library.

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

Split a list into chunks of length n.

Be aware that the last sub-list may be smaller than n-items long.

For example chunk 3 [1..10] => [[1,2,3], [4,5,6], [7,8,9], [10]]

mergeBy : (a -> comparable) -> List a -> List a -> List a

Merge two lists. The first argument is a function which returns the unique ID of each element. Where an element appears more than once, the last won wins.

singleton : a -> List a

Wrap a single item into a list.