query
On this page

init

lib.lists.init



Return all elements but the last. This function throws an error if the list is empty.

Example

init [ 1 2 3 ]
=> [ 1 2 ]

Type

init :: [a] -> [a]

Arguments

  • [list]

Noogle also knows

Aliases