Module Goblint_std.GobList

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

The normal haskell zip that throws no exception

val assoc_eq_opt : ('a -> 'a -> bool) -> 'a0 -> ('a1 * 'b) list -> 'b0 option
val fold_left3 : ('a -> 'b -> 'c -> 'd -> 'e) -> 'f -> 'g list -> 'h list -> 'i list -> 'j
val for_all3 : ('a -> 'b -> 'c -> bool) -> 'd list -> 'e list -> 'f list -> bool
val fold_while_some : ('a -> 'b -> 'a option) -> 'a0 -> 'b0 list -> 'a1 option
val equal : 'a BatOrd.eq -> 'a list BatOrd.eq
val remove_common_prefix : ('a -> 'b -> bool) -> 'c list -> 'd list -> 'c list * 'd list

remove_common_prefix eq l1 l2 removes the common prefix (p) of l1 and l2 and returns the rest of both lists a pair (l1', l2'). Formally, p @ l1' = l1 and p @ l2' = l2 such that p has maximal length.

This can be used to check being a prefix in both directions simultaneously:

  • if l1' = [], then l1 is a prefix of l2,
  • if l2' = [], then l2 is a prefix of l1.

In other cases, the common prefix is not returned (i.e. reconstructed) for efficiency reasons.

  • parameter eq

    equality predicate for elements

val until_last_with : ('a -> bool) -> 'a0 list -> 'a1 list * 'a2 list

Given a predicate and a list, returns two lists (l1, l2). l1 contains the prefix of the list until the last element that satisfies the predicate, l2 contains all subsequent elements. The order of elements is preserved.

module Syntax : sig ... end

Open this to use applicative functor/monad syntax for list.