query
On this page

init

lib.init

Docs pulled from | This Revision | 21 minutes ago


Return all elements but the last.

This function throws an error if the list is empty.

Inputs

list

1. Function argument

Type

init :: [a] -> [a]

Examples

lib.lists.init usage example

init [ 1 2 3 ]
=> [ 1 2 ]
(lib.lists.init)

Noogle also knows

Aliases