package accessor_base

  1. Overview
  2. Docs

See also: Accessor_core.List

val nil : (_, Base.unit, 'a Base.list, [< Accessor_base__.Import.variant ]) Accessor.Simple.t

Access () iff the list is empty.

val cons : ('i -> ('a * 'a Base.list) -> 'b * 'b Base.list, 'i -> 'a Base.list -> 'b Base.list, [< Accessor_base__.Import.variant ]) Accessor.t

Access the head and tail of a list, if it is nonempty.

val nth : Base.int -> (_, 'a, 'a Base.list, [< Accessor_base__.Import.optional ]) Accessor.Simple.t

Access an element at a specified position in a list, if the list is long enough to have such an element.

val reversed : ('i -> 'a Base.list -> 'b Base.list, 'i -> 'a Base.list -> 'b Base.list, [< Accessor_base__.Import.isomorphism ]) Accessor.t

Access a reversed version of a list.

val split_n : Base.int -> ('i -> ('a Base.list * 'a Base.list) -> 'b Base.list * 'b Base.list, 'i -> 'a Base.list -> 'b Base.list, [< Accessor_base__.Import.isomorphism ]) Accessor.t

Access a list as its prefix and suffix, split around a given index.

val prefixed : 'a Base.list -> equal:('a -> 'a -> Base.bool) -> (_, 'a Base.list, 'a Base.list, [< Accessor_base__.Import.variant ]) Accessor.Simple.t

prefixed prefix ~equal verifies that a list starts with prefix, accessing the suffix left after stripping the prefix if so.

val suffixed : 'a Base.list -> equal:('a -> 'a -> Base.bool) -> (_, 'a Base.list, 'a Base.list, [< Accessor_base__.Import.variant ]) Accessor.Simple.t

suffixed suffix ~equal verifies that a list ends with suffix, accessing the prefix left after stripping the suffix if so.

val each : ('i -> 'a -> 'b, 'i -> 'a Base.list -> 'b Base.list, [< Accessor_base__.Import.many ]) Accessor.t

Access every element in a list.

val eachi : ((Base.int * 'it) -> 'a -> 'b, 'it -> 'a Base.list -> 'b Base.list, [< Accessor_base__.Import.many ]) Accessor.t

Like each, but also provides you with the index of each element.

include Accessor.Monad.S with type 'a t := 'a Base.list
val map : ?how:[ `Parallel | `Sequential ] -> (Base.unit -> 'a -> 'b, Base.unit -> 'at -> 'bt, [> Accessor.Subtyping.many ]) Accessor.t -> 'at -> f:('a -> 'b Base.list) -> 'bt Base.list
val mapi : ?how:[ `Parallel | `Sequential ] -> ('i -> 'a -> 'b, Base.unit -> 'at -> 'bt, [> Accessor.Subtyping.many ]) Accessor.t -> 'at -> f:('i Accessor.Index.t -> 'a -> 'b Base.list) -> 'bt Base.list
val all : (Base.unit -> 'a Base.list -> 'a, Base.unit -> 'at -> 'bt, [> Accessor.Subtyping.many ]) Accessor.t -> 'at -> 'bt Base.list
val iter : ?how:[ `Parallel | `Sequential ] -> (Base.unit -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ]) Accessor.t -> 'at -> f:('a -> Base.unit Base.list) -> Base.unit Base.list
val iteri : ?how:[ `Parallel | `Sequential ] -> ('i -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ]) Accessor.t -> 'at -> f:('i Accessor.Index.t -> 'a -> Base.unit Base.list) -> Base.unit Base.list
val sum : ?how:[ `Parallel | `Sequential ] -> (module Base.Container.Summable with type t = 'sum) -> (Base.unit -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ]) Accessor.t -> 'at -> f:('a -> 'sum Base.list) -> 'sum Base.list
val sumi : ?how:[ `Parallel | `Sequential ] -> (module Base.Container.Summable with type t = 'sum) -> ('i -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ]) Accessor.t -> 'at -> f:('i Accessor.Index.t -> 'a -> 'sum Base.list) -> 'sum Base.list
val count : ?how:[ `Parallel | `Sequential ] -> (Base.unit -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ]) Accessor.t -> 'at -> f:('a -> Base.bool Base.list) -> Base.int Base.list
val counti : ?how:[ `Parallel | `Sequential ] -> ('i -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ]) Accessor.t -> 'at -> f:('i Accessor.Index.t -> 'a -> Base.bool Base.list) -> Base.int Base.list
val map_reduce : ?how:[ `Parallel | `Sequential ] -> (Base.unit -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ]) Accessor.t -> 'at -> empty:'b -> combine:('b -> 'b -> 'b) -> f:('a -> 'b Base.list) -> 'b Base.list
val map_reducei : ?how:[ `Parallel | `Sequential ] -> ('i -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ]) Accessor.t -> 'at -> empty:'b -> combine:('b -> 'b -> 'b) -> f:('i Accessor.Index.t -> 'a -> 'b Base.list) -> 'b Base.list
val map_reduce_nonempty : ?how:[ `Parallel | `Sequential ] -> (Base.unit -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.nonempty_getter ]) Accessor.t -> 'at -> combine:('b -> 'b -> 'b) -> f:('a -> 'b Base.list) -> 'b Base.list
val map_reduce_nonemptyi : ?how:[ `Parallel | `Sequential ] -> ('i -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.nonempty_getter ]) Accessor.t -> 'at -> combine:('b -> 'b -> 'b) -> f:('i Accessor.Index.t -> 'a -> 'b Base.list) -> 'b Base.list
OCaml

Innovation. Community. Security.