query
On this page

init

lib.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]
(lib.lists.init)

Noogle also knows

Aliases