Mappable_types.S1_container
S1_container
is the signature of an arity-1 mappable container.
include S1
include Generic with type ('a, 'phantom) t := 'a t and type 'a elt := 'a
Generic
refers to the container type as 'a t
, and the element type as 'a elt
; substitute t
/elt
(arity-0) or 'a t
/'a
(arity-1) accordingly below.
include Generic_types.Generic
with type ('a, 'phantom) t := 'a t
with type 'a elt := 'a
include Base.Container.S1 with type 'a t := 'a t
val mem : 'a t -> 'a -> equal:('a -> 'a -> bool) -> bool
val length : 'a t -> int
val is_empty : 'a t -> bool
val iter : 'a t -> f:('a -> unit) -> unit
val fold : 'a t -> init:'acc -> f:('acc -> 'a -> 'acc) -> 'acc
val fold_result :
'a t ->
init:'acc ->
f:('acc -> 'a -> ('acc, 'e) Base__.Result.t) ->
('acc, 'e) Base__.Result.t
val fold_until :
'a t ->
init:'acc ->
f:('acc -> 'a -> ('acc, 'final) Base__Container_intf.Continue_or_stop.t) ->
finish:('acc -> 'final) ->
'final
val exists : 'a t -> f:('a -> bool) -> bool
val for_all : 'a t -> f:('a -> bool) -> bool
val count : 'a t -> f:('a -> bool) -> int
val sum :
(module Base__Container_intf.Summable with type t = 'sum) ->
'a t ->
f:('a -> 'sum) ->
'sum
val find : 'a t -> f:('a -> bool) -> 'a option
val find_map : 'a t -> f:('a -> 'b option) -> 'b option
val to_list : 'a t -> 'a list
val to_array : 'a t -> 'a array
val min_elt : 'a t -> compare:('a -> 'a -> int) -> 'a option
val max_elt : 'a t -> compare:('a -> 'a -> int) -> 'a option