package containers

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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 sequence = ('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_seq : 'a t -> 'a sequence -> 'a t
Sourceval of_seq : 'a sequence -> 'a t
Sourceval to_seq : 'a t -> 'a sequence
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.