Module

Data.List.Partial

Package
lists
Repository
purescript/purescript-lists

Partial helper functions for working with strict linked lists.

#head Source

head :: forall a. Partial => List a -> a

Get the first element of a non-empty list.

Running time: O(1).

#tail Source

tail :: forall a. Partial => List a -> List a

Get all but the first element of a non-empty list.

Running time: O(1)

#last Source

last :: forall a. Partial => List a -> a

Get the last element of a non-empty list.

Running time: O(n)

#init Source

init :: forall a. Partial => List a -> List a

Get all but the last element of a non-empty list.

Running time: O(n)