package alt-ergo-lib

  1. Overview
  2. Docs

Lists utilies

This modules defines some helper functions on lists

Misc functions

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

Iterate on the list

val apply : ('a -> 'a) -> 'a list -> 'a list * bool

apply f [a_1; ...; a_n] returns a couple [f a_1; ...; f a_n], same same such that: (1) "same" is true if and only if a_i == a_i for each i; and (2) if same is true, then the resulting list is physically equal to the argument *

val apply_right : ('a -> 'a) -> ('b * 'a) list -> ('b * 'a) list * bool

similar to function apply, but the elements of the list are couples *

val find_opt : ('a -> bool) -> 'a list -> 'a option

Tries and find the first element of the list satisfying the predicate.

OCaml

Innovation. Community. Security.