package containers-data

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

Install

Dune Dependency

Authors

Maintainers

Sources

v3.7.tar.gz
md5=58298b6d26c5198157e19b583e9eca2c
sha512=70f99a062f7696d4ed7a6336532261c93c49a9858a84a12f7f3d60190a5c664198e70be6281dc7c7932c07325dc9c579ff521367e4c7e083566910ba0f9ea760

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 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.