accessor_base

Accessors for Base types, for use with the Accessor library
IN THIS PACKAGE
Module Accessor_base . List
val nil : ( _, Base.unit, 'a Base.list, [< Accessor_base__Import.variant ] ) Accessor.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.General.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.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.General.t

Access a reversed version of a list.

val prefixed : 'a Base.list -> equal:( 'a -> 'a -> Base.bool ) -> ( _, 'a Base.list, 'a Base.list, [< Accessor_base__Import.variant ] ) Accessor.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.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.General.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.General.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.General.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.General.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.General.t -> 'at -> 'bt Base.list
val iter : ?how:[ `Parallel | `Sequential ] -> ( Base.unit -> 'a -> _, Base.unit -> 'at -> _, [> Accessor.Subtyping.many_getter ] ) Accessor.General.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.General.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.General.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.General.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.General.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.General.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.General.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.General.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.General.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.General.t -> 'at -> combine:( 'b -> 'b -> 'b ) -> f:( 'i Accessor.Index.t -> 'a -> 'b Base.list ) -> 'b Base.list