package dolmen_type

  1. Overview
  2. Docs

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.

OCaml

Innovation. Community. Security.