Module Acutis_internals.Nonempty

Lists with at least one item.

type 'a t =
  1. | :: of 'a * 'a list

We can use the standard list syntax: [1; 2; 3] and 1 :: 2 :: 3 :: [].

val cons : 'a -> 'a t -> 'a t
val hd : 'a t -> 'a

Like Stdlib.List.hd, except guaranteed to return.

val rev : 'a t -> 'a t
val map : ('a -> 'b) -> 'a t -> 'b t

Calls Stdlib.List.map.

val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

Calls Stdlib.List.map2.

val to_list : 'a t -> 'a list
val to_seq : 'a t -> 'a Stdlib.Seq.t