Module Accessor_base__.Accessor_map

val at : 'key -> (_'data Base.option('key'data'cmp) Base.Map.t[< Accessor_base__.Import.field ]) Accessor_base__.Import.Accessor.Simple.t

If key maps to some data in the map being accessed, at key accesses Some data, otherwise it accesses None. You can use at key to determine or control whether there is a mapping for key at all. For example, Accessor.set (at key) map None removes any mapping for key in map.

val ati : 'key -> (('key * 'i) -> 'data Base.option -> 'data Base.option'i -> ('key'data'cmp) Base.Map.t -> ('key'data'cmp) Base.Map.t[< Accessor_base__.Import.field ]) Accessor_base__.Import.Accessor.t

ati is the indexed version of at. The index is simply whatever key was supplied as an argument.

val found : 'key -> (_'data('key'data'cmp) Base.Map.t[< Accessor_base__.Import.optional ]) Accessor_base__.Import.Accessor.Simple.t

found key is like at key, but it does not give any control over whether key exists in the map. It either accesses the data or it doesn't, depending on whether it exists.

val foundi : 'key -> (('key * 'i) -> 'data -> 'data'i -> ('key'data'cmp) Base.Map.t -> ('key'data'cmp) Base.Map.t[< Accessor_base__.Import.optional ]) Accessor_base__.Import.Accessor.t

foundi is the indexed version of found. The index is simply whatever key was supplied as an argument.

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

each accesses each datum in the map.

val eachi : (('k * 'i) -> 'a -> 'b'i -> ('k'a'cmp) Base.Map.t -> ('k'b'cmp) Base.Map.t[< Accessor_base__.Import.many ]) Accessor_base__.Import.Accessor.t

eachi is the indexed version of each. The indices are the keys that map to the data being accessed.

val empty_default : ('k1'cmp1) Base.Map.comparator -> ('i -> ('k1'a'cmp1) Base.Map.t -> ('k2'b'cmp2) Base.Map.t'i -> ('k1'a'cmp1) Base.Map.t Base.option -> ('k2'b'cmp2) Base.Map.t Base.option[< Accessor_base__.Import.isomorphism ]) Accessor_base__.Import.Accessor.t

empty_default (module M) is an isomorphism between Map.t option and Map.t, treating None identically with Map.empty (module M). Note that this isn't well-behaved in general because it doesn't satisfy construct (get a) = a:

construct (get (Some (Map.empty (module M))))
= construct (Map.empty (module M))
= None
val of_accessor : ('k'cmp) Base.Map.comparator -> ('i -> 'a -> _Base.unit -> 'at -> _[> Accessor_base__.Import.many_getter ]) Accessor_base__.Import.Accessor.t -> 'at -> key_of_index:('i Accessor_base__.Import.Accessor.Index.t -> 'k) -> [ `Duplicate_key of 'k | `Ok of ('k'a'cmp) Base.Map.t ]

of_accessor (module M) accessor x ~key_of_index is a M.Map.t created by traversing x with accessor, mapping each index to the data being accessed.

val of_accessor_exn : ('k'cmp) Base.Map.comparator -> ('i -> 'a -> _Base.unit -> 'at -> _[> Accessor_base__.Import.many_getter ]) Accessor_base__.Import.Accessor.t -> 'at -> key_of_index:('i Accessor_base__.Import.Accessor.Index.t -> 'k) -> ('k'a'cmp) Base.Map.t

Raising version of of_accessor.

val of_accessor_or_error : ('k'cmp) Base.Map.comparator -> ('i -> 'a -> _Base.unit -> 'at -> _[> Accessor_base__.Import.many_getter ]) Accessor_base__.Import.Accessor.t -> 'at -> key_of_index:('i Accessor_base__.Import.Accessor.Index.t -> 'k) -> ('k'a'cmp) Base.Map.t Base.Or_error.t

Or_error version of of_accessor.

val of_accessor_fold : ('k'cmp) Base.Map.comparator -> ('i -> 'a -> _Base.unit -> 'at -> _[> Accessor_base__.Import.many_getter ]) Accessor_base__.Import.Accessor.t -> 'at -> key_of_index:('i Accessor_base__.Import.Accessor.Index.t -> 'k) -> init:'acc -> f:('acc -> 'a -> 'acc) -> ('k'acc'cmp) Base.Map.t

A version of of_accessor that allows you to accumulate multiple values per key with a function.

val of_accessor_multi : ('k'cmp) Base.Map.comparator -> ('i -> 'a -> _Base.unit -> 'at -> _[> Accessor_base__.Import.many_getter ]) Accessor_base__.Import.Accessor.t -> 'at -> key_of_index:('i Accessor_base__.Import.Accessor.Index.t -> 'k) -> ('k'a Base.list'cmp) Base.Map.t

A version of of_accessor that allows you to collect multiple values per key into a list.

val of_accessor_reduce : ('k'cmp) Base.Map.comparator -> ('i -> 'a -> _Base.unit -> 'at -> _[> Accessor_base__.Import.many_getter ]) Accessor_base__.Import.Accessor.t -> 'at -> key_of_index:('i Accessor_base__.Import.Accessor.Index.t -> 'k) -> f:('a -> 'a -> 'a) -> ('k'a'cmp) Base.Map.t

A version of of_accessor that allows you to combine multiple values per key with a function.

include Accessor_base__.Import.Accessor.Applicative_without_return.S3 with type ('data, 'key, 'cmp) t := ('key'data'cmp) Base.Map.t
type ('inner, 'outer, 'kind) accessor
type 'a optional_args
type ('a, 'd, 'e) t
val map : ((Base.unit -> 'a -> 'bBase.unit -> 'at -> 'bt[> Accessor.Subtyping.nonempty ]) accessor -> 'at -> f:('a -> ('b'd'e) t) -> ('bt'd'e) t) optional_args
val mapi : (('i -> 'a -> 'bBase.unit -> 'at -> 'bt[> Accessor.Subtyping.nonempty ]) accessor -> 'at -> f:('i Accessor.Index.t -> 'a -> ('b'd'e) t) -> ('bt'd'e) t) optional_args
val iter : ((Base.unit -> 'a -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> f:('a -> (Base.unit'd'e) t) -> (Base.unit'd'e) t) optional_args
val iteri : (('i -> 'a -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> f:('i Accessor.Index.t -> 'a -> (Base.unit'd'e) t) -> (Base.unit'd'e) t) optional_args
val sum : ((module Base.Container.Summable with type t = 'sum) -> (Base.unit -> 'a -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> f:('a -> ('sum'd'e) t) -> ('sum'd'e) t) optional_args
val sumi : ((module Base.Container.Summable with type t = 'sum) -> ('i -> 'a -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> f:('i Accessor.Index.t -> 'a -> ('sum'd'e) t) -> ('sum'd'e) t) optional_args
val count : ((Base.unit -> 'a -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> f:('a -> (Base.bool'd'e) t) -> (Base.int'd'e) t) optional_args
val counti : (('i -> 'a -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> f:('i Accessor.Index.t -> 'a -> (Base.bool'd'e) t) -> (Base.int'd'e) t) optional_args
val all : (Base.unit -> ('a'd'e) t -> 'aBase.unit -> 'at -> 'bt[> Accessor.Subtyping.nonempty ]) accessor -> 'at -> ('bt'd'e) t
val all_unit : (Base.unit -> (Base.unit'd'e) t -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> (Base.unit'd'e) t
val map_reduce_nonempty : ((Base.unit -> 'a -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> combine:('b -> 'b -> 'b) -> f:('a -> ('b'd'e) t) -> ('b'd'e) t) optional_args
val map_reduce_nonemptyi : (('i -> 'a -> _Base.unit -> 'at -> _[> Accessor.Subtyping.nonempty_getter ]) accessor -> 'at -> combine:('b -> 'b -> 'b) -> f:('i Accessor.Index.t -> 'a -> ('b'd'e) t) -> ('b'd'e) t) optional_args