package dolmen_type

  1. Overview
  2. Docs
Module type
Class type

List helpers

val init : int -> (int -> 'a) -> 'a list

Create a list of the given length by calling th e givne function for each element (starting from 0 up until the length minus one.

val replicate : int -> 'a -> 'a list

Create a list containing n-times the given element.

val take_drop : int -> 'a list -> 'a list * 'a list

take_drop n l tries and split the list into a first list containing the first n elements of l, and in a second list the rest.

  • raises Invalid_argument

    if l has less than n elements.

val iter3 : ('a -> 'b -> 'c -> unit) -> 'a list -> 'b list -> 'c list -> unit

Same as List.iter2 but for 3 lists.

val map3 : ('a -> 'b -> 'c -> 'd) -> 'a list -> 'b list -> 'c list -> 'd list

Same as List.map2 but for 3 lists.