Frama-C:
Plug-ins:
Libraries:

Frama-C API - List

List manipulation

include Fclib.Monad.Iterators with type 'a iterable := 'a list and type 'a monad := 'a t
val fold : ('a -> 'b -> 'a t) -> 'a -> 'b list -> 'a t
val map : ('a -> 'b t) -> 'a list -> 'b list t
val iter : ('a -> unit t) -> 'a list -> unit t
val add : 'a t -> 'a list -> 'a list

add elt list adds elt to the list if it is not bottom.

val values : 'a t list -> 'a list

Filters the given list to remove Bottom elements.

val join : ('a -> 'a -> 'a) -> 'a list -> 'a t

Joins all elements of a list. Returns `Bottom if the list is empty.

val join_values : ('a -> 'a -> 'a) -> 'a t list -> 'a t

join_values filters the given list to remove `Bottom elements and join the remaining values. Returns `Bottom if the list is empty. join_values f l has the same result as values l |> join f but only iterates through the list once.

val filter_map : ('a -> 'b t) -> 'a list -> 'b list

filter_map f l maps the function f to the list l and does not keep bottoms.