package containers-data

  1. Overview
  2. Docs
A set of advanced datatypes for containers

Install

Dune Dependency

Authors

Maintainers

Sources

containers-3.15.tbz
sha256=92143ceb4785ae5f8a07f3ab4ab9f6f32d31ead0536e9be4fdb818dd3c677e58
sha512=5fa80189d0e177af2302b48e72b70299d51fc36ac2019e1cbf389ff6a7f4705b10089405b5a719b3e4845b0d1349a47a967f865dc2e4e3f0d5a0167ef6c31431

doc/containers-data/CCFun_vec/index.html

Module CCFun_vecSource

Functional Vectors

Tree with a large branching factor for logarithmic operations with a low multiplicative factor.

status: experimental. DO NOT USE (yet)

  • since 2.1
Sourcetype 'a iter = ('a -> unit) -> unit
Sourcetype 'a gen = unit -> 'a option
Sourcetype 'a printer = Format.formatter -> 'a -> unit
Sourcetype 'a ktree = unit -> [ `Nil | `Node of 'a * 'a ktree list ]

Signature

Sourcetype 'a t
Sourceval empty : 'a t
Sourceval is_empty : _ t -> bool
Sourceval return : 'a -> 'a t
Sourceval length : _ t -> int
Sourceval push : 'a -> 'a t -> 'a t

Add element at the end.

Sourceval get : int -> 'a t -> 'a option
Sourceval get_exn : int -> 'a t -> 'a
Sourceval pop_exn : 'a t -> 'a * 'a t

Pop last element.

Sourceval pop : 'a t -> ('a * 'a t) option

Pop last element.

  • since 2.5
Sourceval iter : f:('a -> unit) -> 'a t -> unit
Sourceval iteri : f:(int -> 'a -> unit) -> 'a t -> unit

Iterate on elements with their index, in increasing order.

Sourceval iteri_rev : f:(int -> 'a -> unit) -> 'a t -> unit

Iterate on elements with their index, but starting from the end.

Sourceval fold : f:('b -> 'a -> 'b) -> x:'b -> 'a t -> 'b
Sourceval fold_rev : f:('b -> 'a -> 'b) -> x:'b -> 'a t -> 'b
Sourceval foldi : f:('b -> int -> 'a -> 'b) -> x:'b -> 'a t -> 'b
Sourceval append : 'a t -> 'a t -> 'a t
Sourceval map : ('a -> 'b) -> 'a t -> 'b t
Sourceval choose : 'a t -> 'a option
Conversions
Sourceval to_list : 'a t -> 'a list
Sourceval of_list : 'a list -> 'a t
Sourceval add_list : 'a t -> 'a list -> 'a t
Sourceval add_iter : 'a t -> 'a iter -> 'a t
Sourceval of_iter : 'a iter -> 'a t
Sourceval to_iter : 'a t -> 'a iter
Sourceval add_gen : 'a t -> 'a gen -> 'a t
Sourceval of_gen : 'a gen -> 'a t
Sourceval to_gen : 'a t -> 'a gen
IO
Sourceval pp : 'a printer -> 'a t printer
OCaml

Innovation. Community. Security.