package coq-core

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Sparse lists.

Constructors
type +'a t = private
  1. | Nil
  2. | Cons of 'a * 'a t
  3. | Default of int * 'a t
    (*

    'a t is an efficient representation of 'a option list.

    *)
val empty : 'a t

The empty list.

val cons : 'a -> 'a t -> 'a t

Isomorphic to Some x :: l.

val default : 'a t -> 'a t

Isomorphic to None :: l.

val cons_opt : 'a option -> 'a t -> 'a t

cons if Some, default otherwise

val defaultn : int -> 'a t -> 'a t

Iterated variant of default.

Destructor
val view : 'a t -> ('a option * 'a t) option
val is_empty : 'a t -> bool
val is_default : 'a t -> bool
Usual list-like operators
val length : 'a t -> int
val equal : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val to_list : 'a t -> 'a option list
val of_full_list : 'a list -> 'a t
Iterators ignoring optional values
module Skip : sig ... end

These iterators ignore the default values in the list.

Smart iterators
module Smart : sig ... end

These iterators also ignore the default values in the list.

OCaml

Innovation. Community. Security.