package containers

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val foldi : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'b

Fold on list, with index

val get : 'a t -> int -> 'a option
val get_exn : 'a t -> int -> 'a

Get the i-th element, or

  • raises Not_found

    if the index is invalid

val set : 'a t -> int -> 'a -> 'a t

Set i-th element (removes the old one), or does nothing if index is too high

val insert : 'a t -> int -> 'a -> 'a t

Insert at i-th position, between the two existing elements. If the index is too high, append at the end of the list

val remove : 'a t -> int -> 'a t

Remove element at given index. Does nothing if the index is too high.