package melange

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

Belt.Set

The top level provides generic immutable set operations.

It also has three specialized inner modules Belt.Set.Int, Belt.Set.String and

Belt.Set.Dict: This module separates data from function which is more verbose but slightly more efficient

module Int : sig ... end

This module is Belt.Set specialized with value type to be a primitive type. It is more efficient in general, the API is the same with Belt.Set except its value type is fixed, and identity is not needed(using the built-in one)

module String : sig ... end

This module is Belt.Set specialized with value type to be a primitive type. It is more efficient in general, the API is the same with Belt.Set except its value type is fixed, and identity is not needed(using the built-in one)

module Dict : sig ... end
type ('value, 'id) id = (module Belt__.Belt_Id.Comparable with type identity = 'id and type t = 'value)
type ('value, 'id) cmp
type ('value, 'id) t = {
  1. cmp : ('value, 'id) cmp;
  2. data : ('value, 'id) Dict.t;
}
val fromArray : 'value array -> id:('value, 'identity) id -> ('value, 'identity) t
val remove : ('a, 'b) t -> 'a -> ('a, 'b) t
val add : ('a, 'b) t -> 'a -> ('a, 'b) t
val mergeMany : ('a, 'b) t -> 'a array -> ('a, 'b) t
val removeMany : ('a, 'b) t -> 'a array -> ('a, 'b) t
val union : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t
val intersect : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t
val diff : ('a, 'b) t -> ('a, 'b) t -> ('a, 'b) t
val subset : ('a, 'b) t -> ('a, 'b) t -> bool
val split : ('a, 'b) t -> 'a -> (('a, 'b) t * ('a, 'b) t) * bool
val make : id:('value, 'identity) id -> ('value, 'identity) t
val isEmpty : ('a, 'b) t -> bool
val cmp : ('a, 'b) t -> ('a, 'b) t -> int
val eq : ('a, 'b) t -> ('a, 'b) t -> bool
val forEachU : ('a, 'b) t -> ('a -> unit) Js.Fn.arity1 -> unit
val forEach : ('a, 'b) t -> ('a -> unit) -> unit
val reduceU : ('a, 'b) t -> 'c -> ('c -> 'a -> 'c) Js.Fn.arity2 -> 'c
val reduce : ('a, 'b) t -> 'c -> ('c -> 'a -> 'c) -> 'c
val everyU : ('a, 'b) t -> ('a -> bool) Js.Fn.arity1 -> bool
val every : ('a, 'b) t -> ('a -> bool) -> bool
val someU : ('a, 'b) t -> ('a -> bool) Js.Fn.arity1 -> bool
val some : ('a, 'b) t -> ('a -> bool) -> bool
val keepU : ('a, 'b) t -> ('a -> bool) Js.Fn.arity1 -> ('a, 'b) t
val keep : ('a, 'b) t -> ('a -> bool) -> ('a, 'b) t
val partitionU : ('a, 'b) t -> ('a -> bool) Js.Fn.arity1 -> ('a, 'b) t * ('a, 'b) t
val partition : ('a, 'b) t -> ('a -> bool) -> ('a, 'b) t * ('a, 'b) t
val size : ('a, 'b) t -> int
val toList : ('a, 'b) t -> 'a list
val toArray : ('a, 'b) t -> 'a array
val minimum : ('a, 'b) t -> 'a option
val minUndefined : ('a, 'b) t -> 'a Js.undefined
val maximum : ('a, 'b) t -> 'a option
val maxUndefined : ('a, 'b) t -> 'a Js.undefined
val get : ('a, 'b) t -> 'a -> 'a option
val getUndefined : ('a, 'b) t -> 'a -> 'a Js.undefined
val getExn : ('a, 'b) t -> 'a -> 'a
val has : ('a, 'b) t -> 'a -> bool
val fromSortedArrayUnsafe : 'value array -> id:('value, 'identity) id -> ('value, 'identity) t
val getData : ('a, 'b) t -> ('a, 'b) Dict.t
val getId : ('value, 'identity) t -> ('value, 'identity) id
val packIdData : id:('value, 'identity) id -> data:('value, 'identity) Dict.t -> ('value, 'identity) t
val checkInvariantInternal : ('a, 'b) t -> unit
OCaml

Innovation. Community. Security.