package orsetto

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

A functor to create a Set module.

Parameters

Signature

type t

The set type

val nil : t

The empty set.

val one : E.t -> t

Use one e to create a set with one element v.

val min : t -> E.t

Use min u to return the ordinally least element in u. Raises Not_found if u is empty.

val max : t -> E.t

Use min u to return the ordinally greatest element in u. Raises Not_found if u is empty.

val empty : t -> bool

Use empty u to test whether u is the empty set.

val size : t -> int

Use size u to compute the size of u.

val member : E.t -> t -> bool

Use member e u to test whether the element e is a member of the set u.

val compare : t -> t -> int

Use compare u1 u2 to compare the sequence of elements in u1 and the sequence of elements in u2 in order of increasing ordinality. Two sets are ordinally equal if the sequences of their elements are ordinally equal.

val subset : t -> t -> bool

Use subset u1 u2 to test whether u1 is a subset of u2.

val disjoint : t -> t -> bool

Use disjoint u1 u2 to test whether u1 and u2 are disjoint.

val put : E.t -> t -> t

Use put e u to obtain a new set produced by inserting the element e into u. If s already contains a member ordinally equal to e then it is replaced by e in the set returned.

val clear : E.t -> t -> t

Use clear e u to obtain a new set produced by deleting the element in u ordinally equal to the element e. If there is no such element in the set, then the set is returned unchanged.

val union : t -> t -> t

Use union u1 u2 to obtain a new set from the union of u1 and u2. Elements of the new set belonging to the intersection are copied from u2.

val diff : t -> t -> t

Use diff u1 u2 to obtain a new set from the difference of u1 and u2.

val intersect : t -> t -> t

Use interset u1 u2 to obtain a new set from the intersection of u1 and u2. All the elements in the new set are copied from u2.

val of_seq : E.t Seq.t -> t

Use of_seq s to consume a sequence s and compose a new set by inserting each value produced in the order produced.

val of_seq_incr : E.t Seq.t -> t

Use of_seq_incr s to compose the set with elements in the sequence s. Runs in linear time if the sequence c is known to be in increasing order. Otherwise, there is an additional linear cost beyond of_seq s.

val of_seq_decr : E.t Seq.t -> t

Use of_seq_decr s to compose the set with elements in the sequence s. Runs in linear time if the sequence c is known to be in decreasing order. Otherwise, there is an additional linear cost beyond of_seq s.

val to_seq_incr : t -> E.t Seq.t

Use to_seq_incr u to produce the list of elements in u in order of increasing ordinality.

val to_seq_decr : t -> E.t Seq.t

Use to_seq_decr u to produce the list of elements in u in order of decreasing ordinality.

val to_seq_nearest_decr : E.t -> t -> E.t Seq.t

Use to_seq_nearest_decr e u to obtain the element ordinally less than or equal to e in u. Raises Not_found if u is empty or all the keys are ordinally greater.

val to_seq_nearest_incr : E.t -> t -> E.t Seq.t

Use to_seq_nearest_incr e u to obtain the element ordinally greater than or equal to e in u. Raises Not_found if u is empty or all the keys are ordinally lesser.

OCaml

Innovation. Community. Security.