package links

  1. Overview
  2. Docs
include module type of Stdlib.List
type !'a t = 'a list =
  1. | []
  2. | :: of 'a * 'a list
val length : 'a list -> int
val compare_lengths : 'a list -> 'b list -> int
val compare_length_with : 'a list -> int -> int
val is_empty : 'a list -> bool
val cons : 'a -> 'a list -> 'a list
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val nth_opt : 'a list -> int -> 'a option
val rev : 'a list -> 'a list
val init : int -> (int -> 'a) -> 'a list
val append : 'a list -> 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val flatten : 'a list list -> 'a list
val equal : ('a -> 'a -> bool) -> 'a list -> 'a list -> bool
val compare : ('a -> 'a -> int) -> 'a list -> 'a list -> int
val iteri : (int -> 'a -> unit) -> 'a list -> unit
val rev_map : ('a -> 'b) -> 'a list -> 'b list
val concat_map : ('a -> 'b list) -> 'a list -> 'b list
val fold_left_map : ('acc -> 'a -> 'acc * 'b) -> 'acc -> 'a list -> 'acc * 'b list
val fold_left : ('acc -> 'a -> 'acc) -> 'acc -> 'a list -> 'acc
val fold_right : ('a -> 'acc -> 'acc) -> 'a list -> 'acc -> 'acc
val iter2 : ('a -> 'b -> unit) -> 'a list -> 'b list -> unit
val map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
val rev_map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
val fold_left2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a list -> 'b list -> 'acc
val fold_right2 : ('a -> 'b -> 'acc -> 'acc) -> 'a list -> 'b list -> 'acc -> 'acc
val exists : ('a -> bool) -> 'a list -> bool
val for_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
val exists2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
val memq : 'a -> 'a list -> bool
val find_opt : ('a -> bool) -> 'a list -> 'a option
val find_index : ('a -> bool) -> 'a list -> int option
val find_map : ('a -> 'b option) -> 'a list -> 'b option
val find_mapi : (int -> 'a -> 'b option) -> 'a list -> 'b option
val filter : ('a -> bool) -> 'a list -> 'a list
val find_all : ('a -> bool) -> 'a list -> 'a list
val filteri : (int -> 'a -> bool) -> 'a list -> 'a list
val partition : ('a -> bool) -> 'a list -> 'a list * 'a list
val partition_map : ('a -> ('b, 'c) Stdlib.Either.t) -> 'a list -> 'b list * 'c list
val assoc : 'a -> ('a * 'b) list -> 'b
val assoc_opt : 'a -> ('a * 'b) list -> 'b option
val assq : 'a -> ('a * 'b) list -> 'b
val assq_opt : 'a -> ('a * 'b) list -> 'b option
val mem_assoc : 'a -> ('a * 'b) list -> bool
val mem_assq : 'a -> ('a * 'b) list -> bool
val remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) list
val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list
val split : ('a * 'b) list -> 'a list * 'b list
val combine : 'a list -> 'b list -> ('a * 'b) list
val sort : ('a -> 'a -> int) -> 'a list -> 'a list
val stable_sort : ('a -> 'a -> int) -> 'a list -> 'a list
val fast_sort : ('a -> 'a -> int) -> 'a list -> 'a list
val sort_uniq : ('a -> 'a -> int) -> 'a list -> 'a list
val merge : ('a -> 'a -> int) -> 'a list -> 'a list -> 'a list
val of_seq : 'a Stdlib.Seq.t -> 'a list
module Seq : sig ... end

This is the lazy evaluated sequence module for OCaml 4.06 compatability. The signatures and comments are based on the standard OCaml library.

val mem : 'a list -> 'a -> equal:('a -> 'a -> bool) -> bool
val findi : 'a list -> f:('a -> bool) -> (int * 'a) option
val find : 'a list -> f:('a -> bool) -> 'a option
val find_exn : 'a list -> f:('a -> bool) -> 'a
val for_all2_exn : 'a list -> 'b list -> f:('a -> 'b -> bool) -> bool
val for_all : 'a list -> f:('a -> bool) -> bool
val for_all_or_error : 'a list -> f:('a -> bool) -> error:('a -> 'b) -> (unit, 'b) Stdlib.result
val iter : 'a list -> f:('a -> unit) -> unit
val mapi : 'a list -> f:(int -> 'a -> 'b) -> 'b list
val map : 'a list -> f:('a -> 'b) -> 'b list
val map_if : 'a list -> b:('a -> bool) -> f:('a -> 'a) -> 'a list
val map_result : 'a list -> f:('a -> ('b, 'c) Stdlib.result) -> ('b list, 'c) Stdlib.result
val filter_opt : 'a option list -> 'a list
val filter_map : 'a list -> f:('a -> 'b option) -> 'b list
val unzip3 : ('a * 'b * 'c) list -> 'a list * 'b list * 'c list
val take : 'a list -> n:int -> 'a list

Take up to the first n elements of a list.

val drop : 'a list -> n:int -> 'a list

Remove the first n elements of a list.

val zip_nofail : 'a list -> 'b list -> ('a * 'b) list

Like zip, but in the case of length mismatch it zips as many elements as possible and then ends.

val to_seq : 'a list -> 'a Seq.t

Turn a list into a lazily evaluated sequence. This is for ocaml 4.06 compatibility.

val zip_exn : 'a list -> 'b list -> ('a * 'b) list

Create a tuple using the elements of two lists. Requires lists to be of equal length or fail.

val groupBy : (module Links_lens__.Lens_map_intf.S with type key = 'gr) -> f:('el -> 'gr) -> 'el list -> ('gr * 'el list) list

Take a list of elements and group them by the value generated by `f`.

OCaml

Innovation. Community. Security.