fp2/non_empty_list

Types

pub type NonEmptyList(a) {
  NonEmptyList(head: a, tail: List(a))
}

Constructors

  • NonEmptyList(head: a, tail: List(a))

Functions

pub fn append(init: NonEmptyList(a), end: a) -> NonEmptyList(a)
pub fn append_list(init: List(a), end: a) -> NonEmptyList(a)
pub fn of(head: a) -> NonEmptyList(a)
pub fn prepend(tail: NonEmptyList(a), head: a) -> NonEmptyList(a)
pub fn prepend_list(tail: List(a), head: a) -> NonEmptyList(a)
pub fn to_list(it: NonEmptyList(a)) -> List(a)