Mina_stdlib.Nonempty_listA non-empty list that is safe by construction.
module Stable : sig ... endtype 'a t = 'a Stable.Latest.tval to_yojson : ( 'a -> Yojson.Safe.t ) -> 'a t -> Yojson.Safe.tval hash_fold_t :
( Ppx_hash_lib.Std.Hash.state -> 'a -> Ppx_hash_lib.Std.Hash.state ) ->
Ppx_hash_lib.Std.Hash.state ->
'a t ->
Ppx_hash_lib.Std.Hash.stateval init : 'a -> 'a list -> 'a tCreate a non-empty list by proving you have a head element
val singleton : 'a -> 'a tCreate a non-empty list with a single element
val uncons : 'a t -> 'a * 'a listDeconstruct a non-empty list into the head and tail
val head : 'a t -> 'aThe first element of the container
val tail : 'a t -> 'a listThe zero or more tail elements of the container
val last : 'a t -> 'aval of_list_opt : 'a list -> 'a t optionConvert a list into a non-empty-list, returning None if the list is * empty
val find : 'a t -> f:( 'a -> bool ) -> 'a optionval find_map : 'a t -> f:( 'a -> 'b option ) -> 'b optionval fold : 'a t -> init:'accum -> f:( 'accum -> 'a -> 'accum ) -> 'accumval iter : 'a t -> f:( 'a -> unit ) -> unitval length : 'a t -> intval to_list : 'a t -> 'a listNote: This is O(1) not O(n) like on most container
val min_elt : compare:( 'a -> 'a -> int ) -> 'a t -> 'aval max_elt : compare:( 'a -> 'a -> int ) -> 'a t -> 'aval iter_deferred :
'a t ->
f:( 'a -> unit Async_kernel.Deferred.t ) ->
unit Async_kernel.Deferred.t