Module Common.Nonempty_list

A non-empty list type. This can be constructed with the usual list syntax when the compiler is inferring the type, e.g.

let x : _ Nonempty_list.t = [1;2;3]

In Core v0.18, we can replace this with Core.Nonempty_list

type 'a t =
  1. | :: of 'a * 'a list
val map : ('a -> 'b) -> 'a t -> 'b t
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
include Ppx_compare_lib.Comparable.S1 with type 'a t := 'a t
val compare : 'a Base__Ppx_compare_lib.compare -> 'a t Base__Ppx_compare_lib.compare
include Ppx_compare_lib.Equal.S1 with type 'a t := 'a t
val equal : 'a Base__Ppx_compare_lib.equal -> 'a t Base__Ppx_compare_lib.equal
include Ppx_hash_lib.Hashable.S1 with type 'a t := 'a t
val hash_fold_t : 'a Base__Ppx_hash_lib.hash_fold -> 'a t Base__Ppx_hash_lib.hash_fold
include Sexplib0.Sexpable.S1 with type 'a t := 'a t
val t_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a t
val sexp_of_t : ('a -> Sexplib0__.Sexp.t) -> 'a t -> Sexplib0__.Sexp.t
val to_list : 'a t -> 'a list
val of_list_exn : 'a list -> 'a t