CamomileLibrary.USet

# Module CamomileLibrary.USet

    module USet: sig .. end

Sets of Unicode characters, implemented as sets of intervals. The signature is mostly same to Set.S in stdlib

    type t

    val empty : t

    val is_empty : t -> bool

    val mem : CamomileLibrary.UChar.t -> t -> bool

    val add : CamomileLibrary.UChar.t -> t -> t

    val add_range : CamomileLibrary.UChar.t ->
           CamomileLibrary.UChar.t -> t -> t

`add_range u1 u2 s` adds the characters in the range `u1` - `u2` to `s`. The range is determined by the code point order.

    val singleton : CamomileLibrary.UChar.t -> t

    val remove : CamomileLibrary.UChar.t -> t -> t

    val remove_range : CamomileLibrary.UChar.t ->
           CamomileLibrary.UChar.t -> t -> t

`remove_range u1 u2 s` removes the characters in the range `u1` - `u2` from `s`. The range is determined by the code point order.

    val union : t -> t -> t

    val inter : t -> t -> t

    val diff : t -> t -> t

    val compl : t -> t

`compl s` returns the compliment of `s`.

    val compare : t -> t -> int

    val equal : t -> t -> bool

    val subset : t -> t -> bool

    val from : CamomileLibrary.UChar.t -> t -> t

`from u s` returns the set of elements of `s` whose code points are equal or greater than `u`.

    val after : CamomileLibrary.UChar.t -> t -> t

`after u s` returns the set of elements of `s` whose code points are greater than `u`.

    val until : CamomileLibrary.UChar.t -> t -> t

`until u s` returns the set of elements of `s` whose code points are equal or smaller than `u`.

    val before : CamomileLibrary.UChar.t -> t -> t

`until u s` returns the set of elements of `s` whose code points are smaller than `u`.

    val iter : (CamomileLibrary.UChar.t -> unit) -> t -> unit

    val iter_range : (CamomileLibrary.UChar.t -> CamomileLibrary.UChar.t -> unit) ->
           t -> unit

`iter_range proc s` feeds the intervals contained in `s` to `proc` in increasing order. The intervals given to `proc` are always separated by the character not in `s`.

    val fold : (CamomileLibrary.UChar.t -> 'a -> 'a) -> t -> 'a -> 'a

    val fold_range : (CamomileLibrary.UChar.t -> CamomileLibrary.UChar.t -> 'a -> 'a) ->
           t -> 'a -> 'a

`fold_range f s x` is equivalent to `f u_i u_(i+1) (... (f u_3 u_4 (f u_1 u_2 x)))` if `s` is consisted of the intervals `u1`-`u2`, `u3`-`u4`, ..., `u_i`-`u_(i + 1)` in increasing order. The intervals given to `proc` are always separated by the character not in `s`.

    val for_all : (CamomileLibrary.UChar.t -> bool) -> t -> bool

    val exists : (CamomileLibrary.UChar.t -> bool) -> t -> bool

    val filter : (CamomileLibrary.UChar.t -> bool) ->
           t -> t

    val partition : (CamomileLibrary.UChar.t -> bool) ->
           t -> t * t

    val cardinal : t -> int

    val elements : t -> CamomileLibrary.UChar.t list

    val ranges : t ->
           (CamomileLibrary.UChar.t * CamomileLibrary.UChar.t) list

The list of the intervals contained in the set. The returned intervals are always separated by the character not in `s`.

    val min_elt : t -> CamomileLibrary.UChar.t

    val max_elt : t -> CamomileLibrary.UChar.t

    val choose : t -> CamomileLibrary.UChar.t

Returns a element roughly in the middle of the set. It is not guaranteed to return the same element for the sets with the same elements

    val uset_of_iset : ISet.t -> t

    val iset_of_uset : t -> ISet.t