diff --git a/Changes.md b/Changes.md index 580e6bdba4..f98c1cc7dc 100644 --- a/Changes.md +++ b/Changes.md @@ -1,4 +1,25 @@ +# 2.2.3 + +Features: +- #2646,#2622 Adding Belt.Option +- #2342, #2624 (|.) pipe syntax for t first convention +- #2589 Expose Id.MakeComparable functor +- #2587 Added production ready settings for react theme +- * remove refmt syntax version 2 + +Performances: +- #2438 using concrete predicates for integer comparison +- #2584 better handling of if then else common sub expression +Fixes: +- #2303 defining or using a module named "Block" causes runtime errors +- #2616,#2612,#2554 better error message +- #2352 return value of assignment expression +- #2413 no break generated after return statement in some code branches +- #2633 [@bs.string] in FFI +- #2608 short-circuiting of && fails due to extraction of variable +- #2559 fix Bytes.create semantics + # 2.2.2 Features: @@ -12,7 +33,7 @@ Fixes: # 2.2.0 Features: -- A beta release for the new stdlib called Belt +- A beta release for the new stdlib called Belt - #2436, #2381, #2377, #2353 bs.deriving abstract support @@ -25,7 +46,7 @@ Fixes: - #2399, turn partial application warnings to error in react template - #2465 build on FreeBSD - #2450 ignore bsb.lock -- #2356 ship build-schema.json +- #2356 ship build-schema.json - #2489, #2464 capitalize names in combination of '/' - #2459 subdirs:true by default for templates - #2428, fix trailing space on react-jsx @@ -35,11 +56,11 @@ Fixes: Features: - #2282, #2280,#2272,#2271,#2270,#2262,#2260,#2255,#2253 Automatically derive js converter between ocaml and Js values - see docs: https://bucklescript.github.io/bucklescript/Manual.html#_mapping_between_js_values_and_ocaml_values_since_2_1_0 -- #2238, #2225, #2221 + see docs: https://bucklescript.github.io/bucklescript/Manual.html#_mapping_between_js_values_and_ocaml_values_since_2_1_0 +- #2238, #2225, #2221 Make the compiler relocatable prebuilt compiler (this release for Mac/Win) -- #2276 update reason syntax@d0d18 +- #2276 update reason syntax@d0d18 - #2229 improve error message with regard to `@bs` - #2266, add Js_global.(encode|decode)URI(Component) bindings - #2220 make watcher mode in linux accept ninja progress animation @@ -69,7 +90,7 @@ Features # 1.10.3 Features: -- #2112, introduced a key `suffix`, so that user can +- #2112, introduced a key `suffix`, so that user can choose `suffix : ".bs.js"` - #2138, in combination of `.bs.js` suffix and `in-source` build, bsb is able to remove staled build artifact @@ -78,7 +99,7 @@ Features: it in reason syntax - #2096, clorized ninja build output -- #2120 better error message in the location of `{json||json}` +- #2120 better error message in the location of `{json||json}` - #2123 avoid namespace leaking in types - #2130 make Sys module not break React Native bindings - #2159, #2165 enhance user expereince of bsb (less verbose, status bar when failed) diff --git a/Makefile b/Makefile index 27e21effab..4cfe22f730 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ libs: $(MAKE) -C jscomp/runtime -j8 all $(MAKE) -C jscomp/others -j8 all $(MAKE) -C jscomp/stdlib -j8 all - + DEST=lib/ocaml RUNTIME=jscomp/runtime @@ -26,6 +26,8 @@ OTHERS=jscomp/others # scripts/build_uitil.js # function install # scripts/build_util.install + +# ATTENTION: syncup build_util.install for windows install: @echo "Installation" cp $(RUNTIME)/*.cmt* $(RUNTIME)/*.cmj* $(RUNTIME)/js.ml $(RUNTIME)/js.cmi \ diff --git a/docs/api/Belt.Array.html b/docs/api/Belt.Array.html index 93b213f9a7..df6be6c7d2 100644 --- a/docs/api/Belt.Array.html +++ b/docs/api/Belt.Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,7 +103,7 @@

    Module Belt.Array

    Belt.Array

    - mutable array: Utililites functions
    + mutable array: Utilities functions
    diff --git a/docs/api/Belt.HashMap.html b/docs/api/Belt.HashMap.html index 1b1d009e9e..9eb6777ea8 100644 --- a/docs/api/Belt.HashMap.html +++ b/docs/api/Belt.HashMap.html @@ -7,7 +7,7 @@ - + Belt.HashMap

    Next +

    Module Belt.HashMap

    module HashMap: Belt_HashMap
    @@ -101,7 +103,7 @@

    Module Belt.HashMap

    Belt.HashMap

    - The toplevel provides generic mutable hash map operations. + The top level provides generic mutable hash map operations.

    It also has two specialized inner modules @@ -224,7 +226,8 @@

    Module Belt.HashMap

    val toArray : ('key, 'value, 'id) t -> ('key * 'value) array
    val keysToArray : ('key, 'a, 'b) t -> 'key array
    val valuesToArray : ('a, 'value, 'b) t -> 'value array
    -
    val ofArray : ('key * 'value) array ->
    id:('key, 'id) id -> ('key, 'value, 'id) t
    +
    val fromArray : ('key * 'value) array ->
    id:('key, 'id) id -> ('key, 'value, 'id) t
    val mergeMany : ('key, 'value, 'id) t -> ('key * 'value) array -> unit
    val getBucketHistogram : ('a, 'b, 'c) t -> int array
    -
    val logStats : ('a, 'b, 'c) t -> unit
    \ No newline at end of file +
    val logStats : ('a, 'b, 'c) t -> unit
    +
    val ofArray : ('key * 'value) array ->
    id:('key, 'id) id -> ('key, 'value, 'id) t
    \ No newline at end of file diff --git a/docs/api/Belt.HashSet.html b/docs/api/Belt.HashSet.html index 1e327285e7..07cf04b77b 100644 --- a/docs/api/Belt.HashSet.html +++ b/docs/api/Belt.HashSet.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,7 +103,7 @@

    Module Belt.HashSet

    Belt.HashSet

    - The toplevel provides generic mutable hash set operations. + The top level provides generic mutable hash set operations.

    It also has two specialized inner modules @@ -167,5 +168,6 @@

    Module Belt.HashSet

    val logStats : ('a, 'b) t -> unit
    val toArray : ('a, 'id) t -> 'a array
    val ofArray : 'a array -> id:('a, 'id) id -> ('a, 'id) t
    +
    val fromArray : 'a array -> id:('a, 'id) id -> ('a, 'id) t
    val mergeMany : ('a, 'id) t -> 'a array -> unit
    val getBucketHistogram : ('a, 'b) t -> int array
    \ No newline at end of file diff --git a/docs/api/Belt.Id.html b/docs/api/Belt.Id.html index 6d2f0f6a8d..0030a65b37 100644 --- a/docs/api/Belt.Id.html +++ b/docs/api/Belt.Id.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -101,12 +102,12 @@

    Module Belt.Id

    Belt.Id

    - Provide utiliites to create identified comparators or hashes for - data structures used below. + Provide utilities to create identified comparators or hashes for + data structures used below.

    - It create a unique identifer per module of - functions so that different data structures with slightly different + It create a unique identifier per module of + functions so that different data structures with slightly different comparison functions won't mix

    @@ -122,7 +123,7 @@

    Module Belt.Id

    ('a, 'id) hash

    - Its runtime represenation is a hash function, but signed with a + Its runtime represenation is a hash function, but signed with a type parameter, so that different hash functions type mismatch
    @@ -138,7 +139,7 @@

    Module Belt.Id

    ('a, 'id) eq

    - Its runtime represenation is an eq function, but signed with a + Its runtime represenation is an eq function, but signed with a type parameter, so that different hash functions type mismatch
    @@ -154,7 +155,7 @@

    Module Belt.Id

    ('a,'id) cmp

    - Its runtime representation is a cmp function, but signed with a + Its runtime representation is a cmp function, but signed with a type parameter, so that different hash functions type mismatch
    @@ -176,13 +177,13 @@

    Module Belt.Id

    Unlike normal functions, when created, it comes with a unique identity (guaranteed - by the type system). + by the type system).

    - It can be created using function Belt_Id.comparableU orBelt_Id.comparable. + It can be created using function Belt_Id.comparableU orBelt_Id.comparable.

    - The idea of a unique identity when created is that it makes sure two sets would type + The idea of a unique identity when created is that it makes sure two sets would type mismatch if they use different comparison function
    @@ -191,6 +192,26 @@

    Module Belt.Id

    +
    module MakeComparableU: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val cmp : (t -> t -> int [@bs])
    end) -> Comparable with type t = M.t
    +
    + +
    +
    +
    module MakeComparable: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val cmp : t -> t -> int
    end) -> Comparable with type t = M.t
    +
    + +
    +
    val comparableU : cmp:('a -> 'a -> int [@bs]) -> (module Belt_Id.Comparable with type t = 'a)
    val comparable : cmp:('a -> 'a -> int) -> (module Belt_Id.Comparable with type t = 'a)
    module type Hashable = sig .. end
    @@ -206,13 +227,13 @@

    Module Belt.Id

    Unlike normal functions, when created, it comes with a unique identity (guaranteed - by the type system). + by the type system).

    It can be created using function Belt_Id.hashableU or Belt_Id.hashable.

    - The idea of a unique identity when created is that it makes sure two hash sets would type + The idea of a unique identity when created is that it makes sure two hash sets would type mismatch if they use different comparison function

    @@ -221,5 +242,27 @@

    Module Belt.Id

    +
    module MakeHashableU: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val hash : (t -> int [@bs])
    +
    val eq : (t -> t -> bool [@bs])
    end) -> Hashable with type t = M.t
    +
    + +
    +
    +
    module MakeHashable: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val hash : t -> int
    +
    val eq : t -> t -> bool
    end) -> Hashable with type t = M.t
    +
    + +
    +
    val hashableU : hash:('a -> int [@bs]) ->
    eq:('a -> 'a -> bool [@bs]) -> (module Belt_Id.Hashable with type t = 'a)
    val hashable : hash:('a -> int) ->
    eq:('a -> 'a -> bool) -> (module Belt_Id.Hashable with type t = 'a)
    \ No newline at end of file diff --git a/docs/api/Belt.List.html b/docs/api/Belt.List.html index 7385a40186..5a9a427f74 100644 --- a/docs/api/Belt.List.html +++ b/docs/api/Belt.List.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -275,6 +276,16 @@

    Module Belt.List

    +
    val shuffle : 'a t -> 'a t
    +
    + shuffle xs
    +
    Returns a new list in random order
    +
    +
    + +
    + +
    val drop : 'a t -> int -> 'a t option
    drop xs n @@ -435,12 +446,13 @@

    Module Belt.List

    -
    val ofArray : 'a array -> 'a t
    +
    val ofArray : 'a array -> 'a t
    +
    val fromArray : 'a array -> 'a t
    -
     
          ofArray [|1;2;3|]  = [1;2;3]
    +                    
     
          fromArray [|1;2;3|]  = [1;2;3]
         
    diff --git a/docs/api/Belt.Map.html b/docs/api/Belt.Map.html index ae1efe6dcf..a20cd27bb9 100644 --- a/docs/api/Belt.Map.html +++ b/docs/api/Belt.Map.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,7 +103,7 @@

    Module Belt.Map

    Belt.Map,

    - The toplevel provides generic immutable map operations. + The top level provides generic immutable map operations.

    It also has three specialized inner modules @@ -110,7 +111,7 @@

    Module Belt.Map

    Belt.Map.Dict: This module separate date from function - which is more verbbose but slightly more efficient
    + which is more verbose but slightly more efficient

    @@ -150,7 +151,10 @@

    Module Belt.Map

    ('key, 'identity) t

    - 'key is the element type + 'key is the field type +

    + + 'value is the element type

    'identity the identity of the collection
    @@ -173,14 +177,13 @@

    Module Belt.Map

    -
    val make : id:('k, 'id) id -> ('k, 'a, 'id) t
    +
    val make : id:('k, 'id) id -> ('k, 'v, 'id) t
    - make ~id
    + make ~id creates a new map by taking in the comparator
    -
     
         module IntCmp = (val Belt.Id.comparable ~cmp:(fun (x:int) y -> Pervasives.compare x y));;
    -     let s = make ~id:(module IntCmp)
    +                    
     
          let m = Belt.Map.make ~id:(module IntCmp)
         
    @@ -188,25 +191,23 @@

    Module Belt.Map

    val isEmpty : ('a, 'b, 'c) t -> bool
    - isEmpty s0
    + isEmpty m checks whether a map m is empty
    -
     
          module IntCmp = (val Belt.Id.comparable ~cmp:(fun (x:int) y -> Pervasives.compare x y));;
    -      isEmpty (ofArray [|1,"1"|] ~id:(module IntCmp)) = false;;
    +                    
     
          isEmpty (fromArray [|1,"1"|] ~id:(module IntCmp)) = false
         
    -
    val has : ('k, 'a, 'id) t -> 'k -> bool
    +
    val has : ('k, 'v, 'id) t -> 'k -> bool
    - has s k
    + has m k checks whether m has the key k
    -
     
          module IntCmp = (val Belt.Id.comparable ~cmp:(fun (x:int) y -> Pervasives.compare x y));;
    -      has (ofArray [|1,"1"|] ~id:(module IntCmp)) 1 = true;;
    +                    
     
          has (fromArray [|1,"1"|] ~id:(module IntCmp)) 1 = true
         
    @@ -215,10 +216,10 @@

    Module Belt.Map

    val cmpU : ('k, 'v, 'id) t ->
    ('k, 'v, 'id) t -> ('v -> 'v -> int [@bs]) -> int
    val cmp : ('k, 'v, 'id) t ->
    ('k, 'v, 'id) t -> ('v -> 'v -> int) -> int
    - cmp s0 s1 vcmp + cmp m0 m1 vcmp

    - Totoal ordering of map given total ordering of value function. + Total ordering of map given total ordering of value function.

    It will compare size first and each element following the order one by one.
    @@ -228,8 +229,8 @@

    Module Belt.Map

    -
    val eqU : ('k, 'a, 'id) t ->
    ('k, 'a, 'id) t -> ('a -> 'a -> bool [@bs]) -> bool
    -
    val eq : ('k, 'a, 'id) t ->
    ('k, 'a, 'id) t -> ('a -> 'a -> bool) -> bool
    +
    val eqU : ('k, 'v, 'id) t ->
    ('k, 'v, 'id) t -> ('v -> 'v -> bool [@bs]) -> bool
    +
    val eq : ('k, 'v, 'id) t ->
    ('k, 'v, 'id) t -> ('v -> 'v -> bool) -> bool
    eq m1 m2 veq tests whether the maps m1 and m2 are equal, that is, contain equal keys and associate them with @@ -241,8 +242,8 @@

    Module Belt.Map

    -
    val forEachU : ('k, 'a, 'id) t -> ('k -> 'a -> unit [@bs]) -> unit
    -
    val forEach : ('k, 'a, 'id) t -> ('k -> 'a -> unit) -> unit
    +
    val forEachU : ('k, 'v, 'id) t -> ('k -> 'v -> unit [@bs]) -> unit
    +
    val forEach : ('k, 'v, 'id) t -> ('k -> 'v -> unit) -> unit
    forEach m f applies f to all bindings in map m. f receives the 'k as first argument, and the associated value @@ -251,10 +252,7 @@

    Module Belt.Map

    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -
    -      let s0 = ofArray ~id:(module IntCmp) [|4,"4";1,"1";2,"2,"3""|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|4,"4";1,"1";2,"2,"3""|];;
           let acc = ref [] ;;
           forEach s0 (fun k v -> acc := (k,v) :: !acc);;
     
    @@ -264,8 +262,8 @@ 

    Module Belt.Map

    -
    val reduceU : ('k, 'a, 'id) t -> 'b -> ('b -> 'k -> 'a -> 'b [@bs]) -> 'b
    -
    val reduce : ('k, 'a, 'id) t -> 'acc -> ('acc -> 'k -> 'a -> 'acc) -> 'acc
    +
    val reduceU : ('k, 'v, 'id) t -> 'acc -> ('acc -> 'k -> 'v -> 'acc [@bs]) -> 'acc
    +
    val reduce : ('k, 'v, 'id) t -> 'acc -> ('acc -> 'k -> 'v -> 'acc) -> 'acc
    reduce m a f computes (f kN dN ... (f k1 d1 a)...), where k1 ... kN are the keys of all bindings in m @@ -273,18 +271,15 @@

    Module Belt.Map

    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -
    -      let s0 = ofArray ~id:(module IntCmp) [|4,"4";1,"1";2,"2,"3""|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|4,"4";1,"1";2,"2,"3""|];;
           reduce s0 [] (fun acc k v -> (k,v) acc ) = [4,"4";3,"3";2,"2";1,"1"];;
         
    -
    val everyU : ('k, 'a, 'id) t -> ('k -> 'a -> bool [@bs]) -> bool
    -
    val every : ('k, 'a, 'id) t -> ('k -> 'a -> bool) -> bool
    +
    val everyU : ('k, 'v, 'id) t -> ('k -> 'v -> bool [@bs]) -> bool
    +
    val every : ('k, 'v, 'id) t -> ('k -> 'v -> bool) -> bool
    every m p checks if all the bindings of the map satisfy the predicate p. Order unspecified
    @@ -294,8 +289,8 @@

    Module Belt.Map

    -
    val someU : ('k, 'a, 'id) t -> ('k -> 'a -> bool [@bs]) -> bool
    -
    val some : ('k, 'a, 'id) t -> ('k -> 'a -> bool) -> bool
    +
    val someU : ('k, 'v, 'id) t -> ('k -> 'v -> bool [@bs]) -> bool
    +
    val some : ('k, 'v, 'id) t -> ('k -> 'v -> bool) -> bool
    some m p checks if at least one binding of the map satisfy the predicate p. Order unspecified
    @@ -305,35 +300,31 @@

    Module Belt.Map

    -
    val size : ('k, 'a, 'id) t -> int
    +
    val size : ('k, 'v, 'id) t -> int
    size s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      size (ofArray [2,"2"; 2,"1"; 3,"3"] ~id:(module IntCmp)) = 2 ;;
    +                    
     
          size (fromArray [2,"2"; 2,"1"; 3,"3"] ~id:(module IntCmp)) = 2 ;;
         
    -
    val toArray : ('k, 'a, 'id) t -> ('k * 'a) array
    +
    val toArray : ('k, 'v, 'id) t -> ('k * 'v) array
    toArray s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      toArray (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) = [1,"1";2,"2";3,"3"]
    +                    
     
          toArray (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) = [1,"1";2,"2";3,"3"]
         
    -
    val toList : ('k, 'a, 'id) t -> ('k * 'a) list
    +
    val toList : ('k, 'v, 'id) t -> ('k * 'v) list
    In increasing order

    @@ -345,44 +336,39 @@

    Module Belt.Map

    -
    val ofArray : ('k * 'a) array -> id:('k, 'id) id -> ('k, 'a, 'id) t
    +
    val ofArray : ('k * 'v) array -> id:('k, 'id) id -> ('k, 'v, 'id) t
    +
    val fromArray : ('k * 'v) array -> id:('k, 'id) id -> ('k, 'v, 'id) t
    - ofArray kvs ~id
    + fromArray kvs ~id
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      toArray (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) = [1,"1";2,"2";3,"3"]
    +                    
     
          toArray (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) = [1,"1";2,"2";3,"3"]
         
    -
    val keysToArray : ('k, 'a, 'id) t -> 'k array
    +
    val keysToArray : ('k, 'v, 'id) t -> 'k array
    keysToArray s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      keysToArray (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) =
    +                    
     
          keysToArray (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) =
           [|1;2;3|];;
         
    -
    val valuesToArray : ('k, 'a, 'id) t -> 'a array
    +
    val valuesToArray : ('k, 'v, 'id) t -> 'v array
    valuesToArray s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      valuesToArray (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) =
    +                    
     
          valuesToArray (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) =
           [|"1";"2";"3"|];;
         
    @@ -392,7 +378,7 @@

    Module Belt.Map

    val minKey : ('k, 'a, 'b) t -> 'k option
    minKey s
    -
    Returns thte minimum key, None if not exist
    +
    Returns the minimum key, None if not exist
    @@ -411,7 +397,7 @@

    Module Belt.Map

    val maxKey : ('k, 'a, 'b) t -> 'k option
    maxKey s
    -
    Returns thte maximum key, None if not exist
    +
    Returns the maximum key, None if not exist
    @@ -427,17 +413,17 @@

    Module Belt.Map

    -
    val minimum : ('k, 'a, 'b) t -> ('k * 'a) option
    +
    val minimum : ('k, 'v, 'a) t -> ('k * 'v) option
    minimum s
    -
    Returns thte minimum key value pair, None if not exist
    +
    Returns the minimum key value pair, None if not exist
    -
    val minUndefined : ('k, 'a, 'b) t -> ('k * 'a) Js.undefined
    +
    val minUndefined : ('k, 'v, 'a) t -> ('k * 'v) Js.undefined
    See Belt_Map.minimum
    @@ -446,17 +432,17 @@

    Module Belt.Map

    -
    val maximum : ('k, 'a, 'b) t -> ('k * 'a) option
    +
    val maximum : ('k, 'v, 'a) t -> ('k * 'v) option
    maximum s
    -
    Returns thte maximum key value pair, None if not exist
    +
    Returns the maximum key value pair, None if not exist
    -
    val maxUndefined : ('k, 'a, 'b) t -> ('k * 'a) Js.undefined
    +
    val maxUndefined : ('k, 'v, 'a) t -> ('k * 'v) Js.undefined
    See Belt_Map.maximum
    @@ -465,24 +451,22 @@

    Module Belt.Map

    -
    val get : ('k, 'a, 'id) t -> 'k -> 'a option
    +
    val get : ('k, 'v, 'id) t -> 'k -> 'v option
    get s k
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      get (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) 2 =
    +                    
     
          get (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) 2 =
           Some "2";;
    -      get (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) 2 =
    +      get (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) 2 =
           None;;
         
    -
    val getUndefined : ('k, 'a, 'id) t -> 'k -> 'a Js.undefined
    +
    val getUndefined : ('k, 'v, 'id) t -> 'k -> 'v Js.undefined
    See Belt_Map.get
    Returns undefined when not found
    @@ -492,7 +476,7 @@

    Module Belt.Map

    -
    val getWithDefault : ('k, 'a, 'id) t -> 'k -> 'a -> 'a
    +
    val getWithDefault : ('k, 'v, 'id) t -> 'k -> 'v -> 'v
    getWithDefault s k default

    @@ -505,7 +489,7 @@

    Module Belt.Map

    -
    val getExn : ('k, 'a, 'id) t -> 'k -> 'a
    +
    val getExn : ('k, 'v, 'id) t -> 'k -> 'v
    getExn s k

    @@ -520,16 +504,13 @@

    Module Belt.Map

    -
    val remove : ('k, 'a, 'id) t -> 'k -> ('k, 'a, 'id) t
    +
    val remove : ('k, 'v, 'id) t -> 'k -> ('k, 'v, 'id) t
    remove m x when x is not in m, m is returned reference unchanged.
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      
    -      let s0 =  (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp));;
    +                    
     
          let s0 =  (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp));;
     
           let s1 = remove s0 1;;
           let s2 = remove s1 1;;
    @@ -540,7 +521,7 @@ 

    Module Belt.Map

    -
    val removeMany : ('k, 'a, 'id) t -> 'k array -> ('k, 'a, 'id) t
    +
    val removeMany : ('k, 'v, 'id) t -> 'k array -> ('k, 'v, 'id) t
    removeMany s xs

    @@ -554,7 +535,7 @@

    Module Belt.Map

    -
    val set : ('k, 'a, 'id) t -> 'k -> 'a -> ('k, 'a, 'id) t
    +
    val set : ('k, 'v, 'id) t -> 'k -> 'v -> ('k, 'v, 'id) t
    set m x y returns a map containing the same bindings as m, with a new binding of x to y. If x was already bound @@ -562,10 +543,7 @@

    Module Belt.Map

    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      
    -      let s0 =  (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp));;
    +                    
     
          let s0 =  (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp));;
     
           let s1 = set s0 2 "3";;
     
    @@ -575,8 +553,8 @@ 

    Module Belt.Map

    -
    val updateU : ('k, 'a, 'id) t ->
    'k -> ('a option -> 'a option [@bs]) -> ('k, 'a, 'id) t
    -
    val update : ('k, 'a, 'id) t ->
    'k -> ('a option -> 'a option) -> ('k, 'a, 'id) t
    +
    val updateU : ('k, 'v, 'id) t ->
    'k -> ('v option -> 'v option [@bs]) -> ('k, 'v, 'id) t
    +
    val update : ('k, 'v, 'id) t ->
    'k -> ('v option -> 'v option) -> ('k, 'v, 'id) t
    update m x f returns a map containing the same bindings as m, except for the binding of x. @@ -591,7 +569,7 @@

    Module Belt.Map

    -
    val mergeMany : ('k, 'a, 'id) t -> ('k * 'a) array -> ('k, 'a, 'id) t
    +
    val mergeMany : ('k, 'v, 'id) t -> ('k * 'v) array -> ('k, 'v, 'id) t
    mergeMany s xs

    @@ -605,8 +583,8 @@

    Module Belt.Map

    -
    val mergeU : ('k, 'a, 'id) t ->
    ('k, 'b, 'id) t ->
    ('k -> 'a option -> 'b option -> 'c option [@bs]) -> ('k, 'c, 'id) t
    -
    val merge : ('k, 'a, 'id) t ->
    ('k, 'b, 'id) t ->
    ('k -> 'a option -> 'b option -> 'c option) -> ('k, 'c, 'id) t
    +
    val mergeU : ('k, 'v, 'id) t ->
    ('k, 'v2, 'id) t ->
    ('k -> 'v option -> 'v2 option -> 'v3 option [@bs]) ->
    ('k, 'v3, 'id) t
    +
    val merge : ('k, 'v, 'id) t ->
    ('k, 'v2, 'id) t ->
    ('k -> 'v option -> 'v2 option -> 'v3 option) -> ('k, 'v3, 'id) t
    merge m1 m2 f computes a map whose keys is a subset of keys of m1 and of m2. The presence of each such binding, and the corresponding @@ -617,8 +595,8 @@

    Module Belt.Map

    -
    val keepU : ('k, 'a, 'id) t ->
    ('k -> 'a -> bool [@bs]) -> ('k, 'a, 'id) t
    -
    val keep : ('k, 'a, 'id) t -> ('k -> 'a -> bool) -> ('k, 'a, 'id) t
    +
    val keepU : ('k, 'v, 'id) t ->
    ('k -> 'v -> bool [@bs]) -> ('k, 'v, 'id) t
    +
    val keep : ('k, 'v, 'id) t -> ('k -> 'v -> bool) -> ('k, 'v, 'id) t
    keep m p returns the map with all the bindings in m that satisfy predicate p.
    @@ -628,8 +606,8 @@

    Module Belt.Map

    -
    val partitionU : ('k, 'a, 'id) t ->
    ('k -> 'a -> bool [@bs]) ->
    ('k, 'a, 'id) t * ('k, 'a, 'id) t
    -
    val partition : ('k, 'a, 'id) t ->
    ('k -> 'a -> bool) -> ('k, 'a, 'id) t * ('k, 'a, 'id) t
    +
    val partitionU : ('k, 'v, 'id) t ->
    ('k -> 'v -> bool [@bs]) ->
    ('k, 'v, 'id) t * ('k, 'v, 'id) t
    +
    val partition : ('k, 'v, 'id) t ->
    ('k -> 'v -> bool) -> ('k, 'v, 'id) t * ('k, 'v, 'id) t
    partition m p returns a pair of maps (m1, m2), where m1 contains all the bindings of s that satisfy the @@ -641,7 +619,7 @@

    Module Belt.Map

    -
    val split : ('k, 'a, 'id) t ->
    'k -> (('k, 'a, 'id) t * ('k, 'a, 'id) t) * 'a option
    +
    val split : ('k, 'v, 'id) t ->
    'k -> (('k, 'v, 'id) t * ('k, 'v, 'id) t) * 'v option
    split x m returns a tuple (l r), data, where l is the map with all the bindings of m whose 'k @@ -656,8 +634,8 @@

    Module Belt.Map

    -
    val mapU : ('k, 'a, 'id) t -> ('a -> 'b [@bs]) -> ('k, 'b, 'id) t
    -
    val map : ('k, 'a, 'id) t -> ('a -> 'b) -> ('k, 'b, 'id) t
    +
    val mapU : ('k, 'v, 'id) t -> ('v -> 'v2 [@bs]) -> ('k, 'v2, 'id) t
    +
    val map : ('k, 'v, 'id) t -> ('v -> 'v2) -> ('k, 'v2, 'id) t
    map m f returns a map with same domain as m, where the associated value a of all bindings of m has been @@ -670,8 +648,8 @@

    Module Belt.Map

    -
    val mapWithKeyU : ('k, 'a, 'id) t ->
    ('k -> 'a -> 'b [@bs]) -> ('k, 'b, 'id) t
    -
    val mapWithKey : ('k, 'a, 'id) t -> ('k -> 'a -> 'b) -> ('k, 'b, 'id) t
    +
    val mapWithKeyU : ('k, 'v, 'id) t ->
    ('k -> 'v -> 'v2 [@bs]) -> ('k, 'v2, 'id) t
    +
    val mapWithKey : ('k, 'v, 'id) t -> ('k -> 'v -> 'v2) -> ('k, 'v2, 'id) t
    mapWithKey m f

    @@ -683,7 +661,7 @@

    Module Belt.Map

    -
    val getData : ('a, 'b, 'c) t -> ('a, 'b, 'c) Belt_MapDict.t
    +
    val getData : ('k, 'v, 'id) t -> ('k, 'v, 'id) Belt_MapDict.t
    getData s0

    @@ -698,7 +676,7 @@

    Module Belt.Map

    -
    val getId : ('a, 'b, 'c) t -> ('a, 'c) id
    +
    val getId : ('k, 'v, 'id) t -> ('k, 'id) id
    getId s0

    @@ -711,7 +689,7 @@

    Module Belt.Map

    -
    val packIdData : id:('a, 'b) id ->
    data:('a, 'c, 'b) Belt_MapDict.t -> ('a, 'c, 'b) t
    +
    val packIdData : id:('k, 'id) id ->
    data:('k, 'v, 'id) Belt_MapDict.t -> ('k, 'v, 'id) t
    packIdData ~id ~data

    @@ -723,4 +701,4 @@

    Module Belt.Map

    - + \ No newline at end of file diff --git a/docs/api/Belt.MutableMap.html b/docs/api/Belt.MutableMap.html index 48fc3b652a..758a92bbb6 100644 --- a/docs/api/Belt.MutableMap.html +++ b/docs/api/Belt.MutableMap.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,7 +103,7 @@

    Module Belt.MutableMap

    Belt.MutableMap

    - The toplevel provides generic mutable map operations. + The top level provides generic mutable map operations.

    It also has two specialized inner modules @@ -219,7 +220,7 @@

    Module Belt.MutableMap

    val toArray : ('k, 'a, 'id) t -> ('k * 'a) array
    -
    val ofArray : ('k * 'a) array ->
    id:('k, 'id) id -> ('k, 'a, 'id) t
    +
    val fromArray : ('k * 'a) array ->
    id:('k, 'id) id -> ('k, 'a, 'id) t
    val keysToArray : ('k, 'a, 'b) t -> 'k array
    val valuesToArray : ('b, 'a, 'c) t -> 'a array
    val minKey : ('k, 'a, 'b) t -> 'k option
    @@ -236,13 +237,14 @@

    Module Belt.MutableMap

    val getExn : ('k, 'a, 'id) t -> 'k -> 'a
    val checkInvariantInternal : ('a, 'b, 'c) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    +
    val ofArray : ('k * 'a) array ->
    id:('k, 'id) id -> ('k, 'a, 'id) t
    val remove : ('k, 'a, 'id) t -> 'k -> unit
    remove m x do the in-place modification,
    diff --git a/docs/api/Belt.MutableQueue.html b/docs/api/Belt.MutableQueue.html index 79fb1587e5..055600c2a6 100644 --- a/docs/api/Belt.MutableQueue.html +++ b/docs/api/Belt.MutableQueue.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -149,9 +150,10 @@

    Module Belt.MutableQueue

    -
    val ofArray : 'a array -> 'a t
    +
    val ofArray : 'a array -> 'a t
    +
    val fromArray : 'a array -> 'a t
    - ofArray a is equivalent to Array.forEach a (add q a)
    + fromArray a is equivalent to Array.forEach a (add q a)
    diff --git a/docs/api/Belt.MutableSet.html b/docs/api/Belt.MutableSet.html index 33ada3a378..1a03a36807 100644 --- a/docs/api/Belt.MutableSet.html +++ b/docs/api/Belt.MutableSet.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,7 +103,7 @@

    Module Belt.MutableSet

    Belt.MutableSet

    - The toplevel provides generic mutable set operations. + The top level provides generic mutable set operations.

    It also has two specialized inner modules @@ -136,26 +137,26 @@

    Module Belt.MutableSet

    -
    val make : id:('elt, 'id) id -> ('elt, 'id) t
    -
    val ofArray : 'k array -> id:('k, 'id) id -> ('k, 'id) t
    -
    val ofSortedArrayUnsafe : 'elt array ->
    id:('elt, 'id) id -> ('elt, 'id) t
    +
    val make : id:('value, 'id) id -> ('value, 'id) t
    +
    val fromArray : 'k array -> id:('k, 'id) id -> ('k, 'id) t
    +
    val fromSortedArrayUnsafe : 'value array ->
    id:('value, 'id) id -> ('value, 'id) t
    val copy : ('k, 'id) t -> ('k, 'id) t
    val isEmpty : ('a, 'b) t -> bool
    -
    val has : ('elt, 'a) t -> 'elt -> bool
    -
    val add : ('elt, 'id) t -> 'elt -> unit
    -
    val addCheck : ('elt, 'id) t -> 'elt -> bool
    -
    val mergeMany : ('elt, 'id) t -> 'elt array -> unit
    -
    val remove : ('elt, 'id) t -> 'elt -> unit
    -
    val removeCheck : ('elt, 'id) t -> 'elt -> bool
    -
    val removeMany : ('elt, 'id) t -> 'elt array -> unit
    -
    val union : ('elt, 'id) t ->
    ('elt, 'id) t -> ('elt, 'id) t
    -
    val intersect : ('elt, 'id) t ->
    ('elt, 'id) t -> ('elt, 'id) t
    -
    val diff : ('elt, 'id) t ->
    ('elt, 'id) t -> ('elt, 'id) t
    -
    val subset : ('elt, 'id) t -> ('elt, 'id) t -> bool
    -
    val cmp : ('elt, 'id) t -> ('elt, 'id) t -> int
    -
    val eq : ('elt, 'id) t -> ('elt, 'id) t -> bool
    -
    val forEachU : ('elt, 'id) t -> ('elt -> unit [@bs]) -> unit
    -
    val forEach : ('elt, 'id) t -> ('elt -> unit) -> unit
    +
    val has : ('value, 'a) t -> 'value -> bool
    +
    val add : ('value, 'id) t -> 'value -> unit
    +
    val addCheck : ('value, 'id) t -> 'value -> bool
    +
    val mergeMany : ('value, 'id) t -> 'value array -> unit
    +
    val remove : ('value, 'id) t -> 'value -> unit
    +
    val removeCheck : ('value, 'id) t -> 'value -> bool
    +
    val removeMany : ('value, 'id) t -> 'value array -> unit
    +
    val union : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    +
    val intersect : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    +
    val diff : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    +
    val subset : ('value, 'id) t -> ('value, 'id) t -> bool
    +
    val cmp : ('value, 'id) t -> ('value, 'id) t -> int
    +
    val eq : ('value, 'id) t -> ('value, 'id) t -> bool
    +
    val forEachU : ('value, 'id) t -> ('value -> unit [@bs]) -> unit
    +
    val forEach : ('value, 'id) t -> ('value -> unit) -> unit
    forEach m f applies f in turn to all elements of m. In increasing order
    @@ -165,8 +166,8 @@

    Module Belt.MutableSet

    -
    val reduceU : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a [@bs]) -> 'a
    -
    val reduce : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a) -> 'a
    +
    val reduceU : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a [@bs]) -> 'a
    +
    val reduce : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a) -> 'a
    In increasing order.
    @@ -175,8 +176,8 @@

    Module Belt.MutableSet

    -
    val everyU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val every : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val everyU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val every : ('value, 'id) t -> ('value -> bool) -> bool
    every s p checks if all elements of the set satisfy the predicate p. Order unspecified
    @@ -186,8 +187,8 @@

    Module Belt.MutableSet

    -
    val someU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val some : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val someU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val some : ('value, 'id) t -> ('value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p.
    @@ -197,8 +198,8 @@

    Module Belt.MutableSet

    -
    val keepU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) -> ('elt, 'id) t
    -
    val keep : ('elt, 'id) t ->
    ('elt -> bool) -> ('elt, 'id) t
    +
    val keepU : ('value, 'id) t ->
    ('value -> bool [@bs]) -> ('value, 'id) t
    +
    val keep : ('value, 'id) t ->
    ('value -> bool) -> ('value, 'id) t
    keep s p returns the set of all elements in s that satisfy predicate p.
    @@ -208,8 +209,8 @@

    Module Belt.MutableSet

    -
    val partitionU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) ->
    ('elt, 'id) t * ('elt, 'id) t
    -
    val partition : ('elt, 'id) t ->
    ('elt -> bool) ->
    ('elt, 'id) t * ('elt, 'id) t
    +
    val partitionU : ('value, 'id) t ->
    ('value -> bool [@bs]) ->
    ('value, 'id) t * ('value, 'id) t
    +
    val partition : ('value, 'id) t ->
    ('value -> bool) ->
    ('value, 'id) t * ('value, 'id) t
    partition p s returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -221,8 +222,8 @@

    Module Belt.MutableSet

    -
    val size : ('elt, 'id) t -> int
    -
    val toList : ('elt, 'id) t -> 'elt list
    +
    val size : ('value, 'id) t -> int
    +
    val toList : ('value, 'id) t -> 'value list
    In increasing order
    @@ -231,15 +232,15 @@

    Module Belt.MutableSet

    -
    val toArray : ('elt, 'id) t -> 'elt array
    -
    val minimum : ('elt, 'id) t -> 'elt option
    -
    val minUndefined : ('elt, 'id) t -> 'elt Js.undefined
    -
    val maximum : ('elt, 'id) t -> 'elt option
    -
    val maxUndefined : ('elt, 'id) t -> 'elt Js.undefined
    -
    val get : ('elt, 'id) t -> 'elt -> 'elt option
    -
    val getUndefined : ('elt, 'id) t -> 'elt -> 'elt Js.undefined
    -
    val getExn : ('elt, 'id) t -> 'elt -> 'elt
    -
    val split : ('elt, 'id) t ->
    'elt ->
    (('elt, 'id) t * ('elt, 'id) t) * bool
    +
    val toArray : ('value, 'id) t -> 'value array
    +
    val minimum : ('value, 'id) t -> 'value option
    +
    val minUndefined : ('value, 'id) t -> 'value Js.undefined
    +
    val maximum : ('value, 'id) t -> 'value option
    +
    val maxUndefined : ('value, 'id) t -> 'value Js.undefined
    +
    val get : ('value, 'id) t -> 'value -> 'value option
    +
    val getUndefined : ('value, 'id) t -> 'value -> 'value Js.undefined
    +
    val getExn : ('value, 'id) t -> 'value -> 'value
    +
    val split : ('value, 'id) t ->
    'value ->
    (('value, 'id) t * ('value, 'id) t) * bool
    split s x returns a triple ((l, r), present), where l is the set of elements of s that are @@ -257,10 +258,12 @@

    Module Belt.MutableSet

    val checkInvariantInternal : ('a, 'b) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    - \ No newline at end of file + +
    val ofArray : 'k array -> id:('k, 'id) id -> ('k, 'id) t
    +
    val ofSortedArrayUnsafe : 'value array ->
    id:('value, 'id) id -> ('value, 'id) t
    \ No newline at end of file diff --git a/docs/api/Belt.MutableStack.html b/docs/api/Belt.MutableStack.html index df4cb91cd4..f0c1fda5a7 100644 --- a/docs/api/Belt.MutableStack.html +++ b/docs/api/Belt.MutableStack.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt.Option.html b/docs/api/Belt.Option.html new file mode 100644 index 0000000000..ec5edf0453 --- /dev/null +++ b/docs/api/Belt.Option.html @@ -0,0 +1,126 @@ + + + + + + + + + + + Belt.Option + + + +

    Module Belt.Option

    + +
    module Option: Belt_Option
    +
    + Belt.Option +

    + + Utilities for option data type
    + +

    + +
    + +
    + +
    val getExn : 'a option -> 'a
    +
    val mapWithDefaultU : 'a option -> 'b -> ('a -> 'b [@bs]) -> 'b
    +
    val mapWithDefault : 'a option -> 'b -> ('a -> 'b) -> 'b
    +
    val mapU : 'a option -> ('a -> 'b [@bs]) -> 'b option
    +
    val map : 'a option -> ('a -> 'b) -> 'b option
    +
    val flatMapU : 'a option -> ('a -> 'b option [@bs]) -> 'b option
    +
    val flatMap : 'a option -> ('a -> 'b option) -> 'b option
    +
    val getWithDefault : 'a option -> 'a -> 'a
    +
    val isSome : 'a option -> bool
    +
    val isNone : 'a option -> bool
    +
    val eqU : 'a option -> 'b option -> ('a -> 'b -> bool [@bs]) -> bool
    +
    val eq : 'a option -> 'b option -> ('a -> 'b -> bool) -> bool
    +
    val cmpU : 'a option -> 'b option -> ('a -> 'b -> int [@bs]) -> int
    +
    val cmp : 'a option -> 'b option -> ('a -> 'b -> int) -> int
    \ No newline at end of file diff --git a/docs/api/Belt.Range.html b/docs/api/Belt.Range.html index 6a0d2a7b17..84f8202eab 100644 --- a/docs/api/Belt.Range.html +++ b/docs/api/Belt.Range.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt.Set.html b/docs/api/Belt.Set.html index f10c1e688e..30abdae6a9 100644 --- a/docs/api/Belt.Set.html +++ b/docs/api/Belt.Set.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,7 +103,7 @@

    Module Belt.Set

    Belt.Set

    - The toplevel provides generic immutable set operations. + The top level provides generic immutable set operations.

    It also has three specialized inner modules @@ -110,7 +111,7 @@

    Module Belt.Set

    Belt.Set.Dict: This module separate date from function - which is more verbbose but slightly more efficient
    + which is more verbose but slightly more efficient

    @@ -120,14 +121,14 @@

    Module Belt.Set

    module Int: Belt_SetInt
    - Specalized when key type is int, more efficient + Specalized when value type is int, more efficient than the gerneic type, its compare behavior is fixed using the built-in comparison
    module String: Belt_SetString
    - Specalized when key type is string, more efficient + Specalized when value type is string, more efficient than the gerneic type, its compare behavior is fixed using the built-in comparison
    @@ -140,14 +141,14 @@

    Module Belt.Set

    -
    type ('key, 'identity) t 
    +
    type ('value, 'identity) t 
    - ('key, 'identity) t + ('value, 'identity) t

    - 'key is the element type + 'value is the element type

    'identity the identity of the collection
    @@ -158,7 +159,7 @@

    Module Belt.Set

    -
    type ('key, 'id) id = ('key, 'id) Belt_Id.comparable 
    +
    type ('value, 'id) id = ('value, 'id) Belt_Id.comparable 
    @@ -170,41 +171,38 @@

    Module Belt.Set

    -
    val make : id:('elt, 'id) id -> ('elt, 'id) t
    +
    val make : id:('value, 'id) id -> ('value, 'id) t
    - make ~id
    + make ~id creates a new set by taking in the comparator
    -
     
         module IntCmp = (val Belt.Id.comparable ~cmp:(fun (x:int) y -> Pervasives.compare x y))
    -     let s = make ~id:(module IntCmp)
    +                    
     
          let s = make ~id:(module IntCmp)
         
    -
    val ofArray : 'k array -> id:('k, 'id) id -> ('k, 'id) t
    +
    val ofArray : 'value array -> id:('value, 'id) id -> ('value, 'id) t
    +
    val fromArray : 'value array -> id:('value, 'id) id -> ('value, 'id) t
    - ofArray xs ~id
    + fromArray xs ~id
    -
     
         module IntCmp = (val Belt.Id.comparableU
    -                         ~cmp:(fun[@bs]
    -                                (x:int) y -> Pervasives.compare x y));;
    -     toArray (ofArray [1;3;2;4] (module IntCmp)) = [1;2;3;4]
    -      
    +                    
     
         toArray (fromArray [1;3;2;4] (module IntCmp)) = [1;2;3;4]
         
    -
    val ofSortedArrayUnsafe : 'elt array -> id:('elt, 'id) id -> ('elt, 'id) t
    +
    val ofSortedArrayUnsafe : 'value array -> id:('value, 'id) id -> ('value, 'id) t
    +
    val fromSortedArrayUnsafe : 'value array -> id:('value, 'id) id -> ('value, 'id) t
    - ofSortedArrayUnsafe xs ~id + fromSortedArrayUnsafe xs ~id

    - The same as Belt_Set.ofArray except it is after assuming the input array x is already sorted + The same as Belt_Set.fromArray except it is after assuming the input array x is already sorted

    Unsafe
    @@ -219,27 +217,19 @@

    Module Belt.Set

    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;     
    -     isEmpty (ofArray [||] ~id:(module IntCmp)) = true;;
    -     isEmpty (ofArray [|1|] ~id:(module IntCmp)) = true;;  
    +                    
     
         isEmpty (fromArray [||] ~id:(module IntCmp)) = true;;
    +     isEmpty (fromArray [|1|] ~id:(module IntCmp)) = true;;
        
    -
    val has : ('elt, 'id) t -> 'elt -> bool
    +
    val has : ('value, 'id) t -> 'value -> bool
    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -     let v = ofArray [|1;4;2;5|] ~id:(module IntCmp);;
    +                    
     
         let v = fromArray [|1;4;2;5|] ~id:(module IntCmp);;
          has v 3 = false;;
          has v 1 = true;;
        
    @@ -247,17 +237,13 @@

    Module Belt.Set

    -
    val add : ('elt, 'id) t -> 'elt -> ('elt, 'id) t
    +
    val add : ('value, 'id) t -> 'value -> ('value, 'id) t
    add s x If x was already in s, s is returned unchanged.
    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -     let s0 = make ~id:(module IntCmp);;
    +                    
     
         let s0 = make ~id:(module IntCmp);;
          let s1 = add s0 1 ;;
          let s2 = add s1 2;;
          let s3 = add s2 2;;
    @@ -271,7 +257,7 @@ 

    Module Belt.Set

    -
    val mergeMany : ('elt, 'id) t -> 'elt array -> ('elt, 'id) t
    +
    val mergeMany : ('value, 'id) t -> 'value array -> ('value, 'id) t
    mergeMany s xs

    @@ -285,30 +271,26 @@

    Module Belt.Set

    -
    val remove : ('elt, 'id) t -> 'elt -> ('elt, 'id) t
    +
    val remove : ('value, 'id) t -> 'value -> ('value, 'id) t
    remove m x If x was not in m, m is returned reference unchanged.
    -
     
          module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|2;3;1;4;5|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|2;3;1;4;5|];;
           let s1 = remove s0 1 ;;
           let s2 = remove s1 3 ;;
           let s3 = remove s2 3 ;;
     
           toArray s1 = [|2;3;4;5|];;
           toArray s2 = [|2;4;5|];;
    -      s2 == s3;; 
    +      s2 == s3;;
         
    -
    val removeMany : ('elt, 'id) t -> 'elt array -> ('elt, 'id) t
    +
    val removeMany : ('value, 'id) t -> 'value array -> ('value, 'id) t
    removeMany s xs

    @@ -322,54 +304,42 @@

    Module Belt.Set

    -
    val union : ('elt, 'id) t -> ('elt, 'id) t -> ('elt, 'id) t
    +
    val union : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    union s0 s1
    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -     let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    -     let s1 = ofArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
    +                    
     
         let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +     let s1 = fromArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
          toArray (union s0 s1) =  [|1;2;3;4;5;6|]
        
    -
    val intersect : ('elt, 'id) t -> ('elt, 'id) t -> ('elt, 'id) t
    +
    val intersect : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    intersect s0 s1
    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -     let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    -     let s1 = ofArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
    +                    
     
         let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +     let s1 = fromArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
          toArray (intersect s0 s1) =  [|2;3;5|]
        
    -
    val diff : ('elt, 'id) t -> ('elt, 'id) t -> ('elt, 'id) t
    +
    val diff : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    diff s0 s1
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    -      let s1 = ofArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +      let s1 = fromArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
           toArray (diff s0 s1) = [|6|];;
           toArray (diff s1 s0) = [|1;4|];;
         
    @@ -377,28 +347,24 @@

    Module Belt.Set

    -
    val subset : ('elt, 'id) t -> ('elt, 'id) t -> bool
    +
    val subset : ('value, 'id) t -> ('value, 'id) t -> bool
    subset s0 s1
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    -      let s1 = ofArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +      let s1 = fromArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
           let s2 = intersect s0 s1;;
           subset s2 s0 = true;;
    -      subset s1 s0 = true;;
    -      subset s1 s2 = false;;
    +      subset s2 s1 = true;;
    +      subset s1 s0 = false;;
         
    -
    val cmp : ('elt, 'id) t -> ('elt, 'id) t -> int
    +
    val cmp : ('value, 'id) t -> ('value, 'id) t -> int
    Total ordering between sets. Can be used as the ordering function for doing sets of sets. @@ -410,7 +376,7 @@

    Module Belt.Set

    -
    val eq : ('elt, 'id) t -> ('elt, 'id) t -> bool
    +
    val eq : ('value, 'id) t -> ('value, 'id) t -> bool
    eq s0 s1
    Returns true if toArray s0 = toArray s1
    @@ -420,19 +386,15 @@

    Module Belt.Set

    -
    val forEachU : ('elt, 'id) t -> ('elt -> unit [@bs]) -> unit
    -
    val forEach : ('elt, 'id) t -> ('elt -> unit) -> unit
    +
    val forEachU : ('value, 'id) t -> ('value -> unit [@bs]) -> unit
    +
    val forEach : ('value, 'id) t -> ('value -> unit) -> unit
    forEach s f applies f in turn to all elements of s. In increasing order
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
           let acc = ref [] ;;
           forEach s0 (fun x -> acc := x !acc);;
           !acc = [6;5;3;2];;
    @@ -441,26 +403,22 @@ 

    Module Belt.Set

    -
    val reduceU : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a [@bs]) -> 'a
    -
    val reduce : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a) -> 'a
    +
    val reduceU : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a [@bs]) -> 'a
    +
    val reduce : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a) -> 'a
    In increasing order.
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
           reduce s0 [] Bs.List.add = [6;5;3;2];;
         
    -
    val everyU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val every : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val everyU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val every : ('value, 'id) t -> ('value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -470,8 +428,8 @@

    Module Belt.Set

    -
    val someU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val some : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val someU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val some : ('value, 'id) t -> ('value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p.
    @@ -481,8 +439,8 @@

    Module Belt.Set

    -
    val keepU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> ('elt, 'id) t
    -
    val keep : ('elt, 'id) t -> ('elt -> bool) -> ('elt, 'id) t
    +
    val keepU : ('value, 'id) t ->
    ('value -> bool [@bs]) -> ('value, 'id) t
    +
    val keep : ('value, 'id) t -> ('value -> bool) -> ('value, 'id) t
    keep m p returns the set of all elements in s that satisfy predicate p.
    @@ -492,8 +450,8 @@

    Module Belt.Set

    -
    val partitionU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) -> ('elt, 'id) t * ('elt, 'id) t
    -
    val partition : ('elt, 'id) t ->
    ('elt -> bool) -> ('elt, 'id) t * ('elt, 'id) t
    +
    val partitionU : ('value, 'id) t ->
    ('value -> bool [@bs]) -> ('value, 'id) t * ('value, 'id) t
    +
    val partition : ('value, 'id) t ->
    ('value -> bool) -> ('value, 'id) t * ('value, 'id) t
    partition m p returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -505,41 +463,33 @@

    Module Belt.Set

    -
    val size : ('elt, 'id) t -> int
    +
    val size : ('value, 'id) t -> int
    size s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
           size s0 = 4;;
         
    -
    val toArray : ('elt, 'id) t -> 'elt array
    +
    val toArray : ('value, 'id) t -> 'value array
    toArray s0
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
           toArray s0 = [|2;3;5;6|];;
         
    -
    val toList : ('elt, 'id) t -> 'elt list
    +
    val toList : ('value, 'id) t -> 'value list
    In increasing order

    @@ -551,7 +501,7 @@

    Module Belt.Set

    -
    val minimum : ('elt, 'id) t -> 'elt option
    +
    val minimum : ('value, 'id) t -> 'value option
    minimum s0
    Returns the minimum element of the collection, None if it is empty
    @@ -561,7 +511,7 @@

    Module Belt.Set

    -
    val minUndefined : ('elt, 'id) t -> 'elt Js.undefined
    +
    val minUndefined : ('value, 'id) t -> 'value Js.undefined
    minUndefined s0
    Returns the minimum element of the collection, undefined if it is empty
    @@ -571,7 +521,7 @@

    Module Belt.Set

    -
    val maximum : ('elt, 'id) t -> 'elt option
    +
    val maximum : ('value, 'id) t -> 'value option
    maximum s0
    Returns the maximum element of the collection, None if it is empty
    @@ -581,7 +531,7 @@

    Module Belt.Set

    -
    val maxUndefined : ('elt, 'id) t -> 'elt Js.undefined
    +
    val maxUndefined : ('value, 'id) t -> 'value Js.undefined
    maxUndefined s0
    Returns the maximum element of the collection, undefined if it is empty
    @@ -591,7 +541,7 @@

    Module Belt.Set

    -
    val get : ('elt, 'id) t -> 'elt -> 'elt option
    +
    val get : ('value, 'id) t -> 'value -> 'value option
    get s0 k
    Returns the reference of the value k' which is equivalent to k @@ -603,7 +553,7 @@

    Module Belt.Set

    -
    val getUndefined : ('elt, 'id) t -> 'elt -> 'elt Js.undefined
    +
    val getUndefined : ('value, 'id) t -> 'value -> 'value Js.undefined
    See Belt_Set.get
    @@ -612,7 +562,7 @@

    Module Belt.Set

    -
    val getExn : ('elt, 'id) t -> 'elt -> 'elt
    +
    val getExn : ('value, 'id) t -> 'value -> 'value
    See Belt_Set.get

    @@ -624,7 +574,7 @@

    Module Belt.Set

    -
    val split : ('elt, 'id) t ->
    'elt -> (('elt, 'id) t * ('elt, 'id) t) * bool
    +
    val split : ('value, 'id) t ->
    'value -> (('value, 'id) t * ('value, 'id) t) * bool
    split set ele
    Returns a tuple ((smaller, larger), present), @@ -635,7 +585,7 @@

    Module Belt.Set

    -
    val getData : ('k, 'id) t -> ('k, 'id) Belt_SetDict.t
    +
    val getData : ('value, 'id) t -> ('value, 'id) Belt_SetDict.t
    getData s0

    @@ -650,7 +600,7 @@

    Module Belt.Set

    -
    val getId : ('k, 'id) t -> ('k, 'id) id
    +
    val getId : ('value, 'id) t -> ('value, 'id) id
    getId s0

    @@ -663,7 +613,7 @@

    Module Belt.Set

    -
    val packIdData : id:('k, 'id) id ->
    data:('k, 'id) Belt_SetDict.t -> ('k, 'id) t
    +
    val packIdData : id:('value, 'id) id ->
    data:('value, 'id) Belt_SetDict.t -> ('value, 'id) t
    packIdData ~id ~data

    @@ -675,4 +625,4 @@

    Module Belt.Set

    - + \ No newline at end of file diff --git a/docs/api/Belt.SortArray.html b/docs/api/Belt.SortArray.html index 6356d1b37e..9eebcdfb48 100644 --- a/docs/api/Belt.SortArray.html +++ b/docs/api/Belt.SortArray.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,7 +103,7 @@

    Module Belt.SortArray

    Belt.SortArray

    - The toplevel provides some generic sort related utililties. + The top level provides some generic sort related utilities.

    It also has two specialized inner modules diff --git a/docs/api/Belt.html b/docs/api/Belt.html index 3a729a5627..2da510abe8 100644 --- a/docs/api/Belt.html +++ b/docs/api/Belt.html @@ -32,6 +32,7 @@

  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -98,18 +99,18 @@

    Module Belt

    module Belt: sig .. end
    - A stdlib shipped with BuckleScript + A stdlib shipped with BuckleScript

    - This stdlib is still in beta status, but we encourage you to try it out and + This stdlib is still in beta status, but we encourage you to try it out and provide feedback.

    Motivation

    - The motivation of creating such library is to provide BuckleScript users a - better end-to-end user experience, since the original OCaml stdlib was not + The motivation of creating such library is to provide BuckleScript users a + better end-to-end user experience, since the original OCaml stdlib was not written with JS platform in mind, below are a list of areas this lib aims to improve:

    1. 1. Consistency in name convention: camlCase, and arguments order
    2. @@ -139,7 +140,7 @@

      Module Belt

      When we create a collection library for a custom data type, take Set for - example, suppose its element type is a pair of ints, + example, suppose its element type is a pair of ints, it needs a custom compare function. However, the Set could not just be typed as Set.t (int * int) , its customized compare function needs to be @@ -153,34 +154,38 @@

      Module Belt

      We introduced a phantom type to solve the problem

      -

            type t = int * int 
      -      module I0 =
      -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
      -             match compare a0 b0 with
      -             | 0 -> compare a1 b1
      -             | c -> c 
      -           ))
      -    let s0 = Belt.Set.make ~id:(module I0)
      -    module I1 =
      -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
      -           match compare a1 b1 with
      -           | 0 -> compare a0 b0
      -           | c -> c 
      -         ))
      -    let s1 = Belt.Set.make ~id:(module I1)
      +    
            module Comparable1 = Belt.Id.MakeComparable(struct
      +        type t = int * int
      +        let cmp (a0, a1) (b0, b1) =
      +          match Pervasives.compare a0 b0 with
      +          | 0 -> Pervasives.compare a1 b1
      +          | c -> c
      +      end)
      +
      +    let mySet1 = Belt.Set.make ~id:(module Comparable1)
      +
      +    module Comparable2 = Belt.Id.MakeComparable(struct
      +      type t = int * int
      +      let cmp (a0, a1) (b0, b1) =
      +        match Pervasives.compare a0 b0 with
      +        | 0 -> Pervasives.compare a1 b1
      +        | c -> c
      +    end)
      +
      +    let mySet2 = Belt.Set.make ~id:(module Comparable2)
           

      - Here the compiler would infer s0 and s1 having different type so that - it would not mix. + Here, the compiler would infer mySet1 and mySet2 having different type, so + e.g. a `merge` operation that tries to merge these two sets will correctly fail.

      -

            val s0 : ((int * int), I0.identity) t
      -      val s1 : ((int * int), I1.identity) t
      +    
            val mySet1 : ((int * int), Comparable1.identity) t
      +      val mySet2 : ((int * int), Comparable2.identity) t
           

      - I0.identity and I1.identity are not the same using our encoding scheme. + Comparable1.identity and Comparable2.identity are not the same using our encoding scheme.

      Collection Hierarchy @@ -217,11 +222,11 @@

      Module Belt

      Provide utilities to create identified comparators or hashes for - data structures used below. + data structures used below.

      It create a unique identifier per module of - functions so that different data structures with slightly different + functions so that different data structures with slightly different comparison functions won't mix

    @@ -368,5 +373,14 @@

    Module Belt

    It also has two specialized inner modules Belt.HashMap.Int and Belt.HashMap.String
    +
    +
    +
    module Option: Belt_Option
    +
    + Belt.Option +

    + + Utilities for option data type
    +

    \ No newline at end of file diff --git a/docs/api/Belt_Array.html b/docs/api/Belt_Array.html index fa7eb4aee6..59d690e0b4 100644 --- a/docs/api/Belt_Array.html +++ b/docs/api/Belt_Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_HashMap.Int.html b/docs/api/Belt_HashMap.Int.html index ad8d4ef9e0..ba6ab3b6cd 100644 --- a/docs/api/Belt_HashMap.Int.html +++ b/docs/api/Belt_HashMap.Int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -143,7 +144,8 @@

    Module Belt_HashMap.Int

    val toArray : 'a t -> (key * 'a) array
    val keysToArray : 'a t -> key array
    val valuesToArray : 'a t -> 'a array
    -
    val ofArray : (key * 'a) array -> 'a t
    +
    val fromArray : (key * 'a) array -> 'a t
    val mergeMany : 'a t -> (key * 'a) array -> unit
    val getBucketHistogram : 'a t -> int array
    -
    val logStats : 'a t -> unit
    \ No newline at end of file +
    val logStats : 'a t -> unit
    +
    val ofArray : (key * 'a) array -> 'a t
    \ No newline at end of file diff --git a/docs/api/Belt_HashMap.String.html b/docs/api/Belt_HashMap.String.html index a85726f409..1d6a15e0be 100644 --- a/docs/api/Belt_HashMap.String.html +++ b/docs/api/Belt_HashMap.String.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -143,7 +144,8 @@

    Module Belt_HashMap.String

    val toArray : 'a t -> (key * 'a) array
    val keysToArray : 'a t -> key array
    val valuesToArray : 'a t -> 'a array
    -
    val ofArray : (key * 'a) array -> 'a t
    +
    val fromArray : (key * 'a) array -> 'a t
    val mergeMany : 'a t -> (key * 'a) array -> unit
    val getBucketHistogram : 'a t -> int array
    -
    val logStats : 'a t -> unit
    \ No newline at end of file +
    val logStats : 'a t -> unit
    +
    val ofArray : (key * 'a) array -> 'a t
    \ No newline at end of file diff --git a/docs/api/Belt_HashMap.html b/docs/api/Belt_HashMap.html index 45dd727eaa..6422125775 100644 --- a/docs/api/Belt_HashMap.html +++ b/docs/api/Belt_HashMap.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -265,7 +266,8 @@

    Module Belt_HashMap

    val toArray : ('key, 'value, 'id) t -> ('key * 'value) array
    val keysToArray : ('key, 'a, 'b) t -> 'key array
    val valuesToArray : ('a, 'value, 'b) t -> 'value array
    -
    val ofArray : ('key * 'value) array ->
    id:('key, 'id) id -> ('key, 'value, 'id) t
    +
    val fromArray : ('key * 'value) array ->
    id:('key, 'id) id -> ('key, 'value, 'id) t
    val mergeMany : ('key, 'value, 'id) t -> ('key * 'value) array -> unit
    val getBucketHistogram : ('a, 'b, 'c) t -> int array
    -
    val logStats : ('a, 'b, 'c) t -> unit
    \ No newline at end of file +
    val logStats : ('a, 'b, 'c) t -> unit
    +
    val ofArray : ('key * 'value) array ->
    id:('key, 'id) id -> ('key, 'value, 'id) t
    \ No newline at end of file diff --git a/docs/api/Belt_HashMapInt.html b/docs/api/Belt_HashMapInt.html index 55242ce5f0..b86f3f2f29 100644 --- a/docs/api/Belt_HashMapInt.html +++ b/docs/api/Belt_HashMapInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -145,7 +146,8 @@

    Module Belt_HashMapInt

    val toArray : 'a t -> (key * 'a) array
    val keysToArray : 'a t -> key array
    val valuesToArray : 'a t -> 'a array
    -
    val ofArray : (key * 'a) array -> 'a t
    +
    val fromArray : (key * 'a) array -> 'a t
    val mergeMany : 'a t -> (key * 'a) array -> unit
    val getBucketHistogram : 'a t -> int array
    -
    val logStats : 'a t -> unit
    \ No newline at end of file +
    val logStats : 'a t -> unit
    +
    val ofArray : (key * 'a) array -> 'a t
    \ No newline at end of file diff --git a/docs/api/Belt_HashMapString.html b/docs/api/Belt_HashMapString.html index 2b4628950c..12821e4bf5 100644 --- a/docs/api/Belt_HashMapString.html +++ b/docs/api/Belt_HashMapString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -145,7 +146,8 @@

    Module Belt_HashMapString

    val toArray : 'a t -> (key * 'a) array
    val keysToArray : 'a t -> key array
    val valuesToArray : 'a t -> 'a array
    -
    val ofArray : (key * 'a) array -> 'a t
    +
    val fromArray : (key * 'a) array -> 'a t
    val mergeMany : 'a t -> (key * 'a) array -> unit
    val getBucketHistogram : 'a t -> int array
    -
    val logStats : 'a t -> unit
    \ No newline at end of file +
    val logStats : 'a t -> unit
    +
    val ofArray : (key * 'a) array -> 'a t
    \ No newline at end of file diff --git a/docs/api/Belt_HashSet.Int.html b/docs/api/Belt_HashSet.Int.html index 259bc89ac7..68d576d10d 100644 --- a/docs/api/Belt_HashSet.Int.html +++ b/docs/api/Belt_HashSet.Int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -130,5 +131,6 @@

    Module Belt_HashSet.Int

    val logStats : t -> unit
    val toArray : t -> key array
    val ofArray : key array -> t
    +
    val fromArray : key array -> t
    val mergeMany : t -> key array -> unit
    val getBucketHistogram : t -> int array
    \ No newline at end of file diff --git a/docs/api/Belt_HashSet.String.html b/docs/api/Belt_HashSet.String.html index 749e00bf4f..a08ed50138 100644 --- a/docs/api/Belt_HashSet.String.html +++ b/docs/api/Belt_HashSet.String.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -130,5 +131,6 @@

    Module Belt_HashSet.String

    val logStats : t -> unit
    val toArray : t -> key array
    val ofArray : key array -> t
    +
    val fromArray : key array -> t
    val mergeMany : t -> key array -> unit
    val getBucketHistogram : t -> int array
    \ No newline at end of file diff --git a/docs/api/Belt_HashSet.html b/docs/api/Belt_HashSet.html index ac71ac461e..040316412e 100644 --- a/docs/api/Belt_HashSet.html +++ b/docs/api/Belt_HashSet.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -207,5 +208,6 @@

    Module Belt_HashSet

    val logStats : ('a, 'b) t -> unit
    val toArray : ('a, 'id) t -> 'a array
    val ofArray : 'a array -> id:('a, 'id) id -> ('a, 'id) t
    +
    val fromArray : 'a array -> id:('a, 'id) id -> ('a, 'id) t
    val mergeMany : ('a, 'id) t -> 'a array -> unit
    val getBucketHistogram : ('a, 'b) t -> int array
    \ No newline at end of file diff --git a/docs/api/Belt_HashSetInt.html b/docs/api/Belt_HashSetInt.html index cd9ee80382..a936eb16d6 100644 --- a/docs/api/Belt_HashSetInt.html +++ b/docs/api/Belt_HashSetInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -137,5 +138,6 @@

    Module Belt_HashSetInt

    val logStats : t -> unit
    val toArray : t -> key array
    val ofArray : key array -> t
    +
    val fromArray : key array -> t
    val mergeMany : t -> key array -> unit
    val getBucketHistogram : t -> int array
    \ No newline at end of file diff --git a/docs/api/Belt_HashSetString.html b/docs/api/Belt_HashSetString.html index 004a8f96e6..bc9b89abf9 100644 --- a/docs/api/Belt_HashSetString.html +++ b/docs/api/Belt_HashSetString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -137,5 +138,6 @@

    Module Belt_HashSetString

    val logStats : t -> unit
    val toArray : t -> key array
    val ofArray : key array -> t
    +
    val fromArray : key array -> t
    val mergeMany : t -> key array -> unit
    val getBucketHistogram : t -> int array
    \ No newline at end of file diff --git a/docs/api/Belt_Id.Comparable.html b/docs/api/Belt_Id.Comparable.html index 7ba7f7f4d5..d7419edfa8 100644 --- a/docs/api/Belt_Id.Comparable.html +++ b/docs/api/Belt_Id.Comparable.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_Id.Hashable.html b/docs/api/Belt_Id.Hashable.html index cfd6c0137a..93b8f98ad6 100644 --- a/docs/api/Belt_Id.Hashable.html +++ b/docs/api/Belt_Id.Hashable.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_Id.MakeComparable.html b/docs/api/Belt_Id.MakeComparable.html new file mode 100644 index 0000000000..b8d319646b --- /dev/null +++ b/docs/api/Belt_Id.MakeComparable.html @@ -0,0 +1,133 @@ + + + + + + + + + + + Belt_Id.MakeComparable + + + +

    Functor Belt_Id.MakeComparable

    + +
    module MakeComparable: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val cmp : t -> t -> int
    end) -> Comparable with type t = M.t
    + + + + +
    Parameters: + + + + +
    +M:sig + type t + val cmp : t -> t -> int + end +
    +
    +
    +
    +
    type identity 
    +
    + +
    +
    type t 
    +
    + + +
    val cmp : (t, identity) Belt_Id.cmp
    \ No newline at end of file diff --git a/docs/api/Belt_Id.MakeComparableU.html b/docs/api/Belt_Id.MakeComparableU.html new file mode 100644 index 0000000000..1047252be2 --- /dev/null +++ b/docs/api/Belt_Id.MakeComparableU.html @@ -0,0 +1,132 @@ + + + + + + + + + + + Belt_Id.MakeComparableU + + + +

    Functor Belt_Id.MakeComparableU

    + +
    module MakeComparableU: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val cmp : (t -> t -> int [@bs])
    end) -> Comparable with type t = M.t
    + + + + +
    Parameters: + + + + +
    +M:sig + type t + val cmp : t -> t -> int [@bs] + end +
    +
    +
    +
    +
    type identity 
    +
    + +
    +
    type t 
    +
    + + +
    val cmp : (t, identity) Belt_Id.cmp
    \ No newline at end of file diff --git a/docs/api/Belt_Id.MakeHashable.html b/docs/api/Belt_Id.MakeHashable.html new file mode 100644 index 0000000000..745ff927ae --- /dev/null +++ b/docs/api/Belt_Id.MakeHashable.html @@ -0,0 +1,135 @@ + + + + + + + + + + + Belt_Id.MakeHashable + + + +

    Functor Belt_Id.MakeHashable

    + +
    module MakeHashable: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val hash : t -> int
    +
    val eq : t -> t -> bool
    end) -> Hashable with type t = M.t
    + + + + +
    Parameters: + + + + +
    +M:sig + type t + val hash : t -> int + val eq : t -> t -> bool + end +
    +
    +
    +
    +
    type identity 
    +
    + +
    +
    type t 
    +
    + + +
    val hash : (t, identity) Belt_Id.hash
    +
    val eq : (t, identity) Belt_Id.eq
    \ No newline at end of file diff --git a/docs/api/Belt_Id.MakeHashableU.html b/docs/api/Belt_Id.MakeHashableU.html new file mode 100644 index 0000000000..60015dbab9 --- /dev/null +++ b/docs/api/Belt_Id.MakeHashableU.html @@ -0,0 +1,136 @@ + + + + + + + + + + + Belt_Id.MakeHashableU + + + +

    Functor Belt_Id.MakeHashableU

    + +
    module MakeHashableU: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val hash : (t -> int [@bs])
    +
    val eq : (t -> t -> bool [@bs])
    end) -> Hashable with type t = M.t
    + + + + +
    Parameters: + + + + +
    +M:sig + type t + val hash : t -> int [@bs] + val eq : t -> t -> bool [@bs] + end +
    +
    +
    +
    +
    type identity 
    +
    + +
    +
    type t 
    +
    + + +
    val hash : (t, identity) Belt_Id.hash
    +
    val eq : (t, identity) Belt_Id.eq
    \ No newline at end of file diff --git a/docs/api/Belt_Id.html b/docs/api/Belt_Id.html index aa06a9661b..513f9e9b78 100644 --- a/docs/api/Belt_Id.html +++ b/docs/api/Belt_Id.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,11 +103,11 @@

    Module Belt_Id

    Belt.Id

    - Provide utiliites to create identified comparators or hashes for - data structures used below. + Provide utiliites to create identified comparators or hashes for + data structures used below.

    - It create a unique identifer per module of functions so that different data structures with slightly different + It create a unique identifer per module of functions so that different data structures with slightly different comparison functions won't mix.

    @@ -122,7 +123,7 @@

    Module Belt_Id

    ('a, 'id) hash

    - Its runtime represenation is a hash function, but signed with a + Its runtime represenation is a hash function, but signed with a type parameter, so that different hash functions type mismatch

    @@ -138,7 +139,7 @@

    Module Belt_Id

    ('a, 'id) eq

    - Its runtime represenation is an eq function, but signed with a + Its runtime represenation is an eq function, but signed with a type parameter, so that different hash functions type mismatch

    @@ -154,7 +155,7 @@

    Module Belt_Id

    ('a,'id) cmp

    - Its runtime representation is a cmp function, but signed with a + Its runtime representation is a cmp function, but signed with a type parameter, so that different hash functions type mismatch

    @@ -176,13 +177,13 @@

    Module Belt_Id

    Unlike normal functions, when created, it comes with a unique identity (guaranteed - by the type system). + by the type system).

    - It can be created using function Belt_Id.comparableU orBelt_Id.comparable. + It can be created using function Belt_Id.comparableU orBelt_Id.comparable.

    - The idea of a unique identity when created is that it makes sure two sets would type + The idea of a unique identity when created is that it makes sure two sets would type mismatch if they use different comparison function

    @@ -191,6 +192,26 @@

    Module Belt_Id

    +
    module MakeComparableU: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val cmp : (t -> t -> int [@bs])
    end) -> Comparable with type t = M.t
    +
    + +
    +
    +
    module MakeComparable: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val cmp : t -> t -> int
    end) -> Comparable with type t = M.t
    +
    + +
    +
    val comparableU : cmp:('a -> 'a -> int [@bs]) -> (module Belt_Id.Comparable with type t = 'a)
    val comparable : cmp:('a -> 'a -> int) -> (module Belt_Id.Comparable with type t = 'a)
    module type Hashable = sig .. end
    @@ -206,13 +227,13 @@

    Module Belt_Id

    Unlike normal functions, when created, it comes with a unique identity (guaranteed - by the type system). + by the type system).

    It can be created using function Belt_Id.hashableU or Belt_Id.hashable.

    - The idea of a unique identity when created is that it makes sure two hash sets would type + The idea of a unique identity when created is that it makes sure two hash sets would type mismatch if they use different comparison function

    @@ -221,5 +242,27 @@

    Module Belt_Id

    +
    module MakeHashableU: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val hash : (t -> int [@bs])
    +
    val eq : (t -> t -> bool [@bs])
    end) -> Hashable with type t = M.t
    +
    + +
    +
    +
    module MakeHashable: 
    functor (M : sig
    +
    type t 
    +
    + + +
    val hash : t -> int
    +
    val eq : t -> t -> bool
    end) -> Hashable with type t = M.t
    +
    + +
    +
    val hashableU : hash:('a -> int [@bs]) ->
    eq:('a -> 'a -> bool [@bs]) -> (module Belt_Id.Hashable with type t = 'a)
    val hashable : hash:('a -> int) ->
    eq:('a -> 'a -> bool) -> (module Belt_Id.Hashable with type t = 'a)
    \ No newline at end of file diff --git a/docs/api/Belt_List.html b/docs/api/Belt_List.html index f24d102d4a..b65b5a2644 100644 --- a/docs/api/Belt_List.html +++ b/docs/api/Belt_List.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -281,6 +282,16 @@

    Module Belt_List

    +
    val shuffle : 'a t -> 'a t
    +
    + shuffle xs
    +
    Returns a new list in random order
    +
    +
    + +
    + +
    val drop : 'a t -> int -> 'a t option
    drop xs n @@ -441,12 +452,13 @@

    Module Belt_List

    -
    val ofArray : 'a array -> 'a t
    +
    val ofArray : 'a array -> 'a t
    +
    val fromArray : 'a array -> 'a t
    -
     
          ofArray [|1;2;3|]  = [1;2;3]
    +                    
     
          fromArray [|1;2;3|]  = [1;2;3]
         
    diff --git a/docs/api/Belt_Map.Dict.html b/docs/api/Belt_Map.Dict.html index 190ef3b346..36e7ba497c 100644 --- a/docs/api/Belt_Map.Dict.html +++ b/docs/api/Belt_Map.Dict.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -196,6 +197,7 @@

    Module Belt_Map.Dict

    val toArray : ('k, 'a, 'id) t -> ('k * 'a) array
    val ofArray : ('k * 'a) array ->
    cmp:('k, 'id) cmp -> ('k, 'a, 'id) t
    +
    val fromArray : ('k * 'a) array ->
    cmp:('k, 'id) cmp -> ('k, 'a, 'id) t
    val keysToArray : ('k, 'a, 'id) t -> 'k array
    val valuesToArray : ('k, 'a, 'id) t -> 'a array
    val minKey : ('k, 'a, 'b) t -> 'k option
    @@ -212,7 +214,7 @@

    Module Belt_Map.Dict

    val getExn : ('k, 'a, 'id) t -> 'k -> cmp:('k, 'id) cmp -> 'a
    val checkInvariantInternal : ('a, 'b, 'c) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_Map.Int.html b/docs/api/Belt_Map.Int.html index c9a4298d2b..8b14fc5fc8 100644 --- a/docs/api/Belt_Map.Int.html +++ b/docs/api/Belt_Map.Int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -111,11 +112,11 @@

    Module Belt_Map.Int

    -
    type 'a t 
    +
    type 'value t 
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    @@ -123,13 +124,13 @@

    Module Belt_Map.Int

    -
    val empty : 'a t
    -
    val isEmpty : 'a t -> bool
    -
    val has : 'a t -> key -> bool
    -
    val cmpU : 'a t -> 'a t -> ('a -> 'a -> int [@bs]) -> int
    -
    val cmp : 'a t -> 'a t -> ('a -> 'a -> int) -> int
    -
    val eqU : 'a t -> 'a t -> ('a -> 'a -> bool [@bs]) -> bool
    -
    val eq : 'a t -> 'a t -> ('a -> 'a -> bool) -> bool
    +
    val empty : 'v t
    +
    val isEmpty : 'v t -> bool
    +
    val has : 'v t -> key -> bool
    +
    val cmpU : 'v t -> 'v t -> ('v -> 'v -> int [@bs]) -> int
    +
    val cmp : 'v t -> 'v t -> ('v -> 'v -> int) -> int
    +
    val eqU : 'v t -> 'v t -> ('v -> 'v -> bool [@bs]) -> bool
    +
    val eq : 'v t -> 'v t -> ('v -> 'v -> bool) -> bool
    equal m1 m2 cmp tests whether the maps m1 and m2 are equal, that is, contain equal keys and associate them with @@ -141,8 +142,8 @@

    Module Belt_Map.Int

    -
    val forEachU : 'a t -> (key -> 'a -> unit [@bs]) -> unit
    -
    val forEach : 'a t -> (key -> 'a -> unit) -> unit
    +
    val forEachU : 'v t -> (key -> 'v -> unit [@bs]) -> unit
    +
    val forEach : 'v t -> (key -> 'v -> unit) -> unit
    forEach m f applies f to all bindings in map m. f receives the key as first argument, and the associated value @@ -154,8 +155,8 @@

    Module Belt_Map.Int

    -
    val reduceU : 'a t -> 'b -> ('b -> key -> 'a -> 'b [@bs]) -> 'b
    -
    val reduce : 'a t -> 'b -> ('b -> key -> 'a -> 'b) -> 'b
    +
    val reduceU : 'v t -> 'v2 -> ('v2 -> key -> 'v -> 'v2 [@bs]) -> 'v2
    +
    val reduce : 'v t -> 'v2 -> ('v2 -> key -> 'v -> 'v2) -> 'v2
    reduce m a f computes (f kN dN ... (f k1 d1 a)...), where k1 ... kN are the keys of all bindings in m @@ -166,8 +167,8 @@

    Module Belt_Map.Int

    -
    val everyU : 'a t -> (key -> 'a -> bool [@bs]) -> bool
    -
    val every : 'a t -> (key -> 'a -> bool) -> bool
    +
    val everyU : 'v t -> (key -> 'v -> bool [@bs]) -> bool
    +
    val every : 'v t -> (key -> 'v -> bool) -> bool
    every m p checks if all the bindings of the map satisfy the predicate p.
    @@ -177,8 +178,8 @@

    Module Belt_Map.Int

    -
    val someU : 'a t -> (key -> 'a -> bool [@bs]) -> bool
    -
    val some : 'a t -> (key -> 'a -> bool) -> bool
    +
    val someU : 'v t -> (key -> 'v -> bool [@bs]) -> bool
    +
    val some : 'v t -> (key -> 'v -> bool) -> bool
    some m p checks if at least one binding of the map satisfy the predicate p.
    @@ -188,8 +189,8 @@

    Module Belt_Map.Int

    -
    val size : 'a t -> int
    -
    val toList : 'a t -> (key * 'a) list
    +
    val size : 'v t -> int
    +
    val toList : 'v t -> (key * 'v) list
    In increasing order with respect
    @@ -198,32 +199,33 @@

    Module Belt_Map.Int

    -
    val toArray : 'a t -> (key * 'a) array
    -
    val ofArray : (key * 'a) array -> 'a t
    -
    val keysToArray : 'a t -> key array
    -
    val valuesToArray : 'a t -> 'a array
    +
    val toArray : 'v t -> (key * 'v) array
    +
    val ofArray : (key * 'v) array -> 'v t
    +
    val fromArray : (key * 'v) array -> 'v t
    +
    val keysToArray : 'v t -> key array
    +
    val valuesToArray : 'v t -> 'v array
    val minKey : 'a t -> key option
    val minKeyUndefined : 'a t -> key Js.undefined
    val maxKey : 'a t -> key option
    val maxKeyUndefined : 'a t -> key Js.undefined
    -
    val minimum : 'a t -> (key * 'a) option
    -
    val minUndefined : 'a t -> (key * 'a) Js.undefined
    -
    val maximum : 'a t -> (key * 'a) option
    -
    val maxUndefined : 'a t -> (key * 'a) Js.undefined
    -
    val get : 'a t -> key -> 'a option
    -
    val getUndefined : 'a t -> key -> 'a Js.undefined
    -
    val getWithDefault : 'a t -> key -> 'a -> 'a
    -
    val getExn : 'a t -> key -> 'a
    +
    val minimum : 'v t -> (key * 'v) option
    +
    val minUndefined : 'v t -> (key * 'v) Js.undefined
    +
    val maximum : 'v t -> (key * 'v) option
    +
    val maxUndefined : 'v t -> (key * 'v) Js.undefined
    +
    val get : 'v t -> key -> 'v option
    +
    val getUndefined : 'v t -> key -> 'v Js.undefined
    +
    val getWithDefault : 'v t -> key -> 'v -> 'v
    +
    val getExn : 'v t -> key -> 'v
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    -
    val remove : 'a t -> key -> 'a t
    +
    val remove : 'v t -> key -> 'v t
    remove m x returns a map containing the same bindings as m, except for x which is unbound in the returned map.
    @@ -233,8 +235,8 @@

    Module Belt_Map.Int

    -
    val removeMany : 'a t -> key array -> 'a t
    -
    val set : 'a t -> key -> 'a -> 'a t
    +
    val removeMany : 'v t -> key array -> 'v t
    +
    val set : 'v t -> key -> 'v -> 'v t
    add m x y returns a map containing the same bindings as m, plus a binding of x to y. If x was already bound @@ -245,11 +247,11 @@

    Module Belt_Map.Int

    -
    val updateU : 'a t ->
    key -> ('a option -> 'a option [@bs]) -> 'a t
    -
    val update : 'a t ->
    key -> ('a option -> 'a option) -> 'a t
    -
    val mergeArray : 'a t -> (key * 'a) array -> 'a t
    -
    val mergeU : 'a t ->
    'b t ->
    (key -> 'a option -> 'b option -> 'c option [@bs]) ->
    'c t
    -
    val merge : 'a t ->
    'b t ->
    (key -> 'a option -> 'b option -> 'c option) -> 'c t
    +
    val updateU : 'v t ->
    key -> ('v option -> 'v option [@bs]) -> 'v t
    +
    val update : 'v t ->
    key -> ('v option -> 'v option) -> 'v t
    +
    val mergeArray : 'v t -> (key * 'v) array -> 'v t
    +
    val mergeU : 'v t ->
    'v2 t ->
    (key -> 'v option -> 'v2 option -> 'c option [@bs]) ->
    'c t
    +
    val merge : 'v t ->
    'v2 t ->
    (key -> 'v option -> 'v2 option -> 'c option) -> 'c t
    merge m1 m2 f computes a map whose keys is a subset of keys of m1 and of m2. The presence of each such binding, and the corresponding @@ -260,8 +262,8 @@

    Module Belt_Map.Int

    -
    val keepU : 'a t -> (key -> 'a -> bool [@bs]) -> 'a t
    -
    val keep : 'a t -> (key -> 'a -> bool) -> 'a t
    +
    val keepU : 'v t -> (key -> 'v -> bool [@bs]) -> 'v t
    +
    val keep : 'v t -> (key -> 'v -> bool) -> 'v t
    keep m p returns the map with all the bindings in m that satisfy predicate p.
    @@ -271,8 +273,8 @@

    Module Belt_Map.Int

    -
    val partitionU : 'a t ->
    (key -> 'a -> bool [@bs]) -> 'a t * 'a t
    -
    val partition : 'a t ->
    (key -> 'a -> bool) -> 'a t * 'a t
    +
    val partitionU : 'v t ->
    (key -> 'v -> bool [@bs]) -> 'v t * 'v t
    +
    val partition : 'v t ->
    (key -> 'v -> bool) -> 'v t * 'v t
    partition m p returns a pair of maps (m1, m2), where m1 contains all the bindings of s that satisfy the @@ -284,7 +286,7 @@

    Module Belt_Map.Int

    -
    val split : key ->
    'a t -> 'a t * 'a option * 'a t
    +
    val split : key ->
    'v t -> 'v t * 'v option * 'v t
    split x m returns a triple (l, data, r), where l is the map with all the bindings of m whose key @@ -299,8 +301,8 @@

    Module Belt_Map.Int

    -
    val mapU : 'a t -> ('a -> 'b [@bs]) -> 'b t
    -
    val map : 'a t -> ('a -> 'b) -> 'b t
    +
    val mapU : 'v t -> ('v -> 'v2 [@bs]) -> 'v2 t
    +
    val map : 'v t -> ('v -> 'v2) -> 'v2 t
    map m f returns a map with same domain as m, where the associated value a of all bindings of m has been @@ -313,5 +315,5 @@

    Module Belt_Map.Int

    -
    val mapWithKeyU : 'a t -> (key -> 'a -> 'b [@bs]) -> 'b t
    -
    val mapWithKey : 'a t -> (key -> 'a -> 'b) -> 'b t
    \ No newline at end of file +
    val mapWithKeyU : 'v t -> (key -> 'v -> 'v2 [@bs]) -> 'v2 t
    +
    val mapWithKey : 'v t -> (key -> 'v -> 'v2) -> 'v2 t
    \ No newline at end of file diff --git a/docs/api/Belt_Map.String.html b/docs/api/Belt_Map.String.html index 3785c25d0f..ed3ac76e95 100644 --- a/docs/api/Belt_Map.String.html +++ b/docs/api/Belt_Map.String.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -112,11 +113,11 @@

    Module Belt_Map.String

    -
    type 'a t 
    +
    type 'value t 
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    @@ -124,13 +125,13 @@

    Module Belt_Map.String

    -
    val empty : 'a t
    -
    val isEmpty : 'a t -> bool
    -
    val has : 'a t -> key -> bool
    -
    val cmpU : 'a t -> 'a t -> ('a -> 'a -> int [@bs]) -> int
    -
    val cmp : 'a t -> 'a t -> ('a -> 'a -> int) -> int
    -
    val eqU : 'a t ->
    'a t -> ('a -> 'a -> bool [@bs]) -> bool
    -
    val eq : 'a t -> 'a t -> ('a -> 'a -> bool) -> bool
    +
    val empty : 'v t
    +
    val isEmpty : 'v t -> bool
    +
    val has : 'v t -> key -> bool
    +
    val cmpU : 'v t -> 'v t -> ('v -> 'v -> int [@bs]) -> int
    +
    val cmp : 'v t -> 'v t -> ('v -> 'v -> int) -> int
    +
    val eqU : 'v t ->
    'v t -> ('v -> 'v -> bool [@bs]) -> bool
    +
    val eq : 'v t -> 'v t -> ('v -> 'v -> bool) -> bool
    equal m1 m2 cmp tests whether the maps m1 and m2 are equal, that is, contain equal keys and associate them with @@ -142,8 +143,8 @@

    Module Belt_Map.String

    -
    val forEachU : 'a t -> (key -> 'a -> unit [@bs]) -> unit
    -
    val forEach : 'a t -> (key -> 'a -> unit) -> unit
    +
    val forEachU : 'v t -> (key -> 'v -> unit [@bs]) -> unit
    +
    val forEach : 'v t -> (key -> 'v -> unit) -> unit
    forEach m f applies f to all bindings in map m. f receives the key as first argument, and the associated value @@ -155,8 +156,8 @@

    Module Belt_Map.String

    -
    val reduceU : 'a t ->
    'b -> ('b -> key -> 'a -> 'b [@bs]) -> 'b
    -
    val reduce : 'a t -> 'b -> ('b -> key -> 'a -> 'b) -> 'b
    +
    val reduceU : 'v t ->
    'v2 -> ('v2 -> key -> 'v -> 'v2 [@bs]) -> 'v2
    +
    val reduce : 'v t -> 'v2 -> ('v2 -> key -> 'v -> 'v2) -> 'v2
    reduce m a f computes (f kN dN ... (f k1 d1 a)...), where k1 ... kN are the keys of all bindings in m @@ -167,8 +168,8 @@

    Module Belt_Map.String

    -
    val everyU : 'a t -> (key -> 'a -> bool [@bs]) -> bool
    -
    val every : 'a t -> (key -> 'a -> bool) -> bool
    +
    val everyU : 'v t -> (key -> 'v -> bool [@bs]) -> bool
    +
    val every : 'v t -> (key -> 'v -> bool) -> bool
    every m p checks if all the bindings of the map satisfy the predicate p.
    @@ -178,8 +179,8 @@

    Module Belt_Map.String

    -
    val someU : 'a t -> (key -> 'a -> bool [@bs]) -> bool
    -
    val some : 'a t -> (key -> 'a -> bool) -> bool
    +
    val someU : 'v t -> (key -> 'v -> bool [@bs]) -> bool
    +
    val some : 'v t -> (key -> 'v -> bool) -> bool
    some m p checks if at least one binding of the map satisfy the predicate p.
    @@ -189,8 +190,8 @@

    Module Belt_Map.String

    -
    val size : 'a t -> int
    -
    val toList : 'a t -> (key * 'a) list
    +
    val size : 'v t -> int
    +
    val toList : 'v t -> (key * 'v) list
    In increasing order with respect
    @@ -199,32 +200,33 @@

    Module Belt_Map.String

    -
    val toArray : 'a t -> (key * 'a) array
    -
    val ofArray : (key * 'a) array -> 'a t
    -
    val keysToArray : 'a t -> key array
    -
    val valuesToArray : 'a t -> 'a array
    +
    val toArray : 'v t -> (key * 'v) array
    +
    val ofArray : (key * 'v) array -> 'v t
    +
    val fromArray : (key * 'v) array -> 'v t
    +
    val keysToArray : 'v t -> key array
    +
    val valuesToArray : 'v t -> 'v array
    val minKey : 'a t -> key option
    val minKeyUndefined : 'a t -> key Js.undefined
    val maxKey : 'a t -> key option
    val maxKeyUndefined : 'a t -> key Js.undefined
    -
    val minimum : 'a t -> (key * 'a) option
    -
    val minUndefined : 'a t -> (key * 'a) Js.undefined
    -
    val maximum : 'a t -> (key * 'a) option
    -
    val maxUndefined : 'a t -> (key * 'a) Js.undefined
    -
    val get : 'a t -> key -> 'a option
    -
    val getUndefined : 'a t -> key -> 'a Js.undefined
    -
    val getWithDefault : 'a t -> key -> 'a -> 'a
    -
    val getExn : 'a t -> key -> 'a
    +
    val minimum : 'v t -> (key * 'v) option
    +
    val minUndefined : 'v t -> (key * 'v) Js.undefined
    +
    val maximum : 'v t -> (key * 'v) option
    +
    val maxUndefined : 'v t -> (key * 'v) Js.undefined
    +
    val get : 'v t -> key -> 'v option
    +
    val getUndefined : 'v t -> key -> 'v Js.undefined
    +
    val getWithDefault : 'v t -> key -> 'v -> 'v
    +
    val getExn : 'v t -> key -> 'v
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    -
    val remove : 'a t -> key -> 'a t
    +
    val remove : 'v t -> key -> 'v t
    remove m x returns a map containing the same bindings as m, except for x which is unbound in the returned map.
    @@ -234,8 +236,8 @@

    Module Belt_Map.String

    -
    val removeMany : 'a t -> key array -> 'a t
    -
    val set : 'a t -> key -> 'a -> 'a t
    +
    val removeMany : 'v t -> key array -> 'v t
    +
    val set : 'v t -> key -> 'v -> 'v t
    add m x y returns a map containing the same bindings as m, plus a binding of x to y. If x was already bound @@ -246,11 +248,11 @@

    Module Belt_Map.String

    -
    val updateU : 'a t ->
    key -> ('a option -> 'a option [@bs]) -> 'a t
    -
    val update : 'a t ->
    key -> ('a option -> 'a option) -> 'a t
    -
    val mergeArray : 'a t -> (key * 'a) array -> 'a t
    -
    val mergeU : 'a t ->
    'b t ->
    (key -> 'a option -> 'b option -> 'c option [@bs]) ->
    'c t
    -
    val merge : 'a t ->
    'b t ->
    (key -> 'a option -> 'b option -> 'c option) ->
    'c t
    +
    val updateU : 'v t ->
    key -> ('v option -> 'v option [@bs]) -> 'v t
    +
    val update : 'v t ->
    key -> ('v option -> 'v option) -> 'v t
    +
    val mergeArray : 'v t -> (key * 'v) array -> 'v t
    +
    val mergeU : 'v t ->
    'v2 t ->
    (key -> 'v option -> 'v2 option -> 'c option [@bs]) ->
    'c t
    +
    val merge : 'v t ->
    'v2 t ->
    (key -> 'v option -> 'v2 option -> 'c option) ->
    'c t
    merge m1 m2 f computes a map whose keys is a subset of keys of m1 and of m2. The presence of each such binding, and the corresponding @@ -261,8 +263,8 @@

    Module Belt_Map.String

    -
    val keepU : 'a t ->
    (key -> 'a -> bool [@bs]) -> 'a t
    -
    val keep : 'a t ->
    (key -> 'a -> bool) -> 'a t
    +
    val keepU : 'v t ->
    (key -> 'v -> bool [@bs]) -> 'v t
    +
    val keep : 'v t ->
    (key -> 'v -> bool) -> 'v t
    keep m p returns the map with all the bindings in m that satisfy predicate p.
    @@ -272,8 +274,8 @@

    Module Belt_Map.String

    -
    val partitionU : 'a t ->
    (key -> 'a -> bool [@bs]) ->
    'a t * 'a t
    -
    val partition : 'a t ->
    (key -> 'a -> bool) ->
    'a t * 'a t
    +
    val partitionU : 'v t ->
    (key -> 'v -> bool [@bs]) ->
    'v t * 'v t
    +
    val partition : 'v t ->
    (key -> 'v -> bool) ->
    'v t * 'v t
    partition m p returns a pair of maps (m1, m2), where m1 contains all the bindings of s that satisfy the @@ -285,7 +287,7 @@

    Module Belt_Map.String

    -
    val split : key ->
    'a t -> 'a t * 'a option * 'a t
    +
    val split : key ->
    'v t -> 'v t * 'v option * 'v t
    split x m returns a triple (l, data, r), where l is the map with all the bindings of m whose key @@ -300,8 +302,8 @@

    Module Belt_Map.String

    -
    val mapU : 'a t -> ('a -> 'b [@bs]) -> 'b t
    -
    val map : 'a t -> ('a -> 'b) -> 'b t
    +
    val mapU : 'v t -> ('v -> 'v2 [@bs]) -> 'v2 t
    +
    val map : 'v t -> ('v -> 'v2) -> 'v2 t
    map m f returns a map with same domain as m, where the associated value a of all bindings of m has been @@ -314,5 +316,5 @@

    Module Belt_Map.String

    -
    val mapWithKeyU : 'a t ->
    (key -> 'a -> 'b [@bs]) -> 'b t
    -
    val mapWithKey : 'a t ->
    (key -> 'a -> 'b) -> 'b t
    \ No newline at end of file +
    val mapWithKeyU : 'v t ->
    (key -> 'v -> 'v2 [@bs]) -> 'v2 t
    +
    val mapWithKey : 'v t ->
    (key -> 'v -> 'v2) -> 'v2 t
    \ No newline at end of file diff --git a/docs/api/Belt_Map.html b/docs/api/Belt_Map.html index b5ad96c506..cf289ea3b3 100644 --- a/docs/api/Belt_Map.html +++ b/docs/api/Belt_Map.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -106,55 +107,29 @@

    Module Belt_Map

    and insertion take time logarithmic in the size of the map.

    - All data are parameterized by not its only type but also a unique identity in - the time of initialization, so that two Map of int keys initialized with different - compare functions will have different type. + For more info on this module's usage of identity, `make` and others, please see + the top level documentation of Belt, A special encoding for collection safety.

    - For example: -

         type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match Pervasives.compare a0 b0 with
    -             | 0 -> Pervasives.compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 : (_, string, _) t = make ~id:(module I0) (* value is of type string *)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 : (_, string, _) t = make ~id:(module I1)
    -   
    -

    - - Here the compiler would infer s0 and s1 having different type so that - it would not mix. -

    - -

         val s0 : ((int * int), string,  I0.identity) t 
    -     val s1 : ((int * int), string,  I1.identity) t
    -   
    -

    - - We can add elements to the collection: -

    - -

         let s2 = add s1 (0,0) "a"
    -     let s3 = add s2 (1,1) "b"
    -   
    -

    - - Since this is an immutable data strucure, s1 will be an empty map - while s2 will contain one pair, s3 will contain two. + Example usage:
    + +

    +
    +
     
        module PairComparator = Belt.Id.MakeComparable(struct
    +      type t = int * int
    +      let cmp (a0, a1) (b0, b1) =
    +        match Pervasives.compare a0 b0 with
    +        | 0 -> Pervasives.compare a1 b1
    +        | c -> c
    +    end)
    +
    +    let myMap = Belt.Map.make ~id:(module PairComparator)
    +    let myMap2 = Belt.Map.set myMap (1, 2) "myValue"
    +  

    - The merge s0 s3 callback will result in a type error, since their identity mismatch
    - + The API documentation below will assume a predeclared comparator module for integers, IntCmp

    -

    @@ -191,7 +166,10 @@

    Module Belt_Map

    ('key, 'identity) t

    - 'key is the element type + 'key is the field type +

    + + 'value is the element type

    'identity the identity of the collection
    @@ -214,14 +192,13 @@

    Module Belt_Map

    -
    val make : id:('k, 'id) id -> ('k, 'a, 'id) t
    +
    val make : id:('k, 'id) id -> ('k, 'v, 'id) t
    - make ~id
    + make ~id creates a new map by taking in the comparator
    -
     
         module IntCmp = (val Belt.Id.comparable ~cmp:(fun (x:int) y -> Pervasives.compare x y));;
    -     let s = make ~id:(module IntCmp)
    +                    
     
          let m = Belt.Map.make ~id:(module IntCmp)
         
    @@ -229,25 +206,23 @@

    Module Belt_Map

    val isEmpty : ('a, 'b, 'c) t -> bool
    - isEmpty s0
    + isEmpty m checks whether a map m is empty
    -
     
          module IntCmp = (val Belt.Id.comparable ~cmp:(fun (x:int) y -> Pervasives.compare x y));;
    -      isEmpty (ofArray [|1,"1"|] ~id:(module IntCmp)) = false;;
    +                    
     
          isEmpty (fromArray [|1,"1"|] ~id:(module IntCmp)) = false
         
    -
    val has : ('k, 'a, 'id) t -> 'k -> bool
    +
    val has : ('k, 'v, 'id) t -> 'k -> bool
    - has s k
    + has m k checks whether m has the key k
    -
     
          module IntCmp = (val Belt.Id.comparable ~cmp:(fun (x:int) y -> Pervasives.compare x y));;
    -      has (ofArray [|1,"1"|] ~id:(module IntCmp)) 1 = true;;
    +                    
     
          has (fromArray [|1,"1"|] ~id:(module IntCmp)) 1 = true
         
    @@ -256,10 +231,10 @@

    Module Belt_Map

    val cmpU : ('k, 'v, 'id) t ->
    ('k, 'v, 'id) t -> ('v -> 'v -> int [@bs]) -> int
    val cmp : ('k, 'v, 'id) t ->
    ('k, 'v, 'id) t -> ('v -> 'v -> int) -> int
    - cmp s0 s1 vcmp + cmp m0 m1 vcmp

    - Totoal ordering of map given total ordering of value function. + Total ordering of map given total ordering of value function.

    It will compare size first and each element following the order one by one.
    @@ -269,8 +244,8 @@

    Module Belt_Map

    -
    val eqU : ('k, 'a, 'id) t ->
    ('k, 'a, 'id) t -> ('a -> 'a -> bool [@bs]) -> bool
    -
    val eq : ('k, 'a, 'id) t ->
    ('k, 'a, 'id) t -> ('a -> 'a -> bool) -> bool
    +
    val eqU : ('k, 'v, 'id) t ->
    ('k, 'v, 'id) t -> ('v -> 'v -> bool [@bs]) -> bool
    +
    val eq : ('k, 'v, 'id) t ->
    ('k, 'v, 'id) t -> ('v -> 'v -> bool) -> bool
    eq m1 m2 veq tests whether the maps m1 and m2 are equal, that is, contain equal keys and associate them with @@ -282,8 +257,8 @@

    Module Belt_Map

    -
    val forEachU : ('k, 'a, 'id) t -> ('k -> 'a -> unit [@bs]) -> unit
    -
    val forEach : ('k, 'a, 'id) t -> ('k -> 'a -> unit) -> unit
    +
    val forEachU : ('k, 'v, 'id) t -> ('k -> 'v -> unit [@bs]) -> unit
    +
    val forEach : ('k, 'v, 'id) t -> ('k -> 'v -> unit) -> unit
    forEach m f applies f to all bindings in map m. f receives the 'k as first argument, and the associated value @@ -292,10 +267,7 @@

    Module Belt_Map

    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -
    -      let s0 = ofArray ~id:(module IntCmp) [|4,"4";1,"1";2,"2,"3""|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|4,"4";1,"1";2,"2,"3""|];;
           let acc = ref [] ;;
           forEach s0 (fun k v -> acc := (k,v) :: !acc);;
     
    @@ -305,8 +277,8 @@ 

    Module Belt_Map

    -
    val reduceU : ('k, 'a, 'id) t -> 'b -> ('b -> 'k -> 'a -> 'b [@bs]) -> 'b
    -
    val reduce : ('k, 'a, 'id) t -> 'acc -> ('acc -> 'k -> 'a -> 'acc) -> 'acc
    +
    val reduceU : ('k, 'v, 'id) t -> 'acc -> ('acc -> 'k -> 'v -> 'acc [@bs]) -> 'acc
    +
    val reduce : ('k, 'v, 'id) t -> 'acc -> ('acc -> 'k -> 'v -> 'acc) -> 'acc
    reduce m a f computes (f kN dN ... (f k1 d1 a)...), where k1 ... kN are the keys of all bindings in m @@ -314,18 +286,15 @@

    Module Belt_Map

    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -
    -      let s0 = ofArray ~id:(module IntCmp) [|4,"4";1,"1";2,"2,"3""|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|4,"4";1,"1";2,"2,"3""|];;
           reduce s0 [] (fun acc k v -> (k,v) acc ) = [4,"4";3,"3";2,"2";1,"1"];;
         
    -
    val everyU : ('k, 'a, 'id) t -> ('k -> 'a -> bool [@bs]) -> bool
    -
    val every : ('k, 'a, 'id) t -> ('k -> 'a -> bool) -> bool
    +
    val everyU : ('k, 'v, 'id) t -> ('k -> 'v -> bool [@bs]) -> bool
    +
    val every : ('k, 'v, 'id) t -> ('k -> 'v -> bool) -> bool
    every m p checks if all the bindings of the map satisfy the predicate p. Order unspecified
    @@ -335,8 +304,8 @@

    Module Belt_Map

    -
    val someU : ('k, 'a, 'id) t -> ('k -> 'a -> bool [@bs]) -> bool
    -
    val some : ('k, 'a, 'id) t -> ('k -> 'a -> bool) -> bool
    +
    val someU : ('k, 'v, 'id) t -> ('k -> 'v -> bool [@bs]) -> bool
    +
    val some : ('k, 'v, 'id) t -> ('k -> 'v -> bool) -> bool
    some m p checks if at least one binding of the map satisfy the predicate p. Order unspecified
    @@ -346,35 +315,31 @@

    Module Belt_Map

    -
    val size : ('k, 'a, 'id) t -> int
    +
    val size : ('k, 'v, 'id) t -> int
    size s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      size (ofArray [2,"2"; 2,"1"; 3,"3"] ~id:(module IntCmp)) = 2 ;;
    +                    
     
          size (fromArray [2,"2"; 2,"1"; 3,"3"] ~id:(module IntCmp)) = 2 ;;
         
    -
    val toArray : ('k, 'a, 'id) t -> ('k * 'a) array
    +
    val toArray : ('k, 'v, 'id) t -> ('k * 'v) array
    toArray s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      toArray (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) = [1,"1";2,"2";3,"3"]
    +                    
     
          toArray (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) = [1,"1";2,"2";3,"3"]
         
    -
    val toList : ('k, 'a, 'id) t -> ('k * 'a) list
    +
    val toList : ('k, 'v, 'id) t -> ('k * 'v) list
    In increasing order

    @@ -386,44 +351,39 @@

    Module Belt_Map

    -
    val ofArray : ('k * 'a) array -> id:('k, 'id) id -> ('k, 'a, 'id) t
    +
    val ofArray : ('k * 'v) array -> id:('k, 'id) id -> ('k, 'v, 'id) t
    +
    val fromArray : ('k * 'v) array -> id:('k, 'id) id -> ('k, 'v, 'id) t
    - ofArray kvs ~id
    + fromArray kvs ~id
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      toArray (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) = [1,"1";2,"2";3,"3"]
    +                    
     
          toArray (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) = [1,"1";2,"2";3,"3"]
         
    -
    val keysToArray : ('k, 'a, 'id) t -> 'k array
    +
    val keysToArray : ('k, 'v, 'id) t -> 'k array
    keysToArray s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      keysToArray (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) =
    +                    
     
          keysToArray (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) =
           [|1;2;3|];;
         
    -
    val valuesToArray : ('k, 'a, 'id) t -> 'a array
    +
    val valuesToArray : ('k, 'v, 'id) t -> 'v array
    valuesToArray s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      valuesToArray (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) =
    +                    
     
          valuesToArray (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) =
           [|"1";"2";"3"|];;
         
    @@ -433,7 +393,7 @@

    Module Belt_Map

    val minKey : ('k, 'a, 'b) t -> 'k option
    minKey s
    -
    Returns thte minimum key, None if not exist
    +
    Returns the minimum key, None if not exist
    @@ -452,7 +412,7 @@

    Module Belt_Map

    val maxKey : ('k, 'a, 'b) t -> 'k option
    maxKey s
    -
    Returns thte maximum key, None if not exist
    +
    Returns the maximum key, None if not exist
    @@ -468,17 +428,17 @@

    Module Belt_Map

    -
    val minimum : ('k, 'a, 'b) t -> ('k * 'a) option
    +
    val minimum : ('k, 'v, 'a) t -> ('k * 'v) option
    minimum s
    -
    Returns thte minimum key value pair, None if not exist
    +
    Returns the minimum key value pair, None if not exist
    -
    val minUndefined : ('k, 'a, 'b) t -> ('k * 'a) Js.undefined
    +
    val minUndefined : ('k, 'v, 'a) t -> ('k * 'v) Js.undefined
    See Belt_Map.minimum
    @@ -487,17 +447,17 @@

    Module Belt_Map

    -
    val maximum : ('k, 'a, 'b) t -> ('k * 'a) option
    +
    val maximum : ('k, 'v, 'a) t -> ('k * 'v) option
    maximum s
    -
    Returns thte maximum key value pair, None if not exist
    +
    Returns the maximum key value pair, None if not exist
    -
    val maxUndefined : ('k, 'a, 'b) t -> ('k * 'a) Js.undefined
    +
    val maxUndefined : ('k, 'v, 'a) t -> ('k * 'v) Js.undefined
    See Belt_Map.maximum
    @@ -506,24 +466,22 @@

    Module Belt_Map

    -
    val get : ('k, 'a, 'id) t -> 'k -> 'a option
    +
    val get : ('k, 'v, 'id) t -> 'k -> 'v option
    get s k
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      get (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) 2 =
    +                    
     
          get (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) 2 =
           Some "2";;
    -      get (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) 2 =
    +      get (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp)) 2 =
           None;;
         
    -
    val getUndefined : ('k, 'a, 'id) t -> 'k -> 'a Js.undefined
    +
    val getUndefined : ('k, 'v, 'id) t -> 'k -> 'v Js.undefined
    See Belt_Map.get
    Returns undefined when not found
    @@ -533,7 +491,7 @@

    Module Belt_Map

    -
    val getWithDefault : ('k, 'a, 'id) t -> 'k -> 'a -> 'a
    +
    val getWithDefault : ('k, 'v, 'id) t -> 'k -> 'v -> 'v
    getWithDefault s k default

    @@ -546,7 +504,7 @@

    Module Belt_Map

    -
    val getExn : ('k, 'a, 'id) t -> 'k -> 'a
    +
    val getExn : ('k, 'v, 'id) t -> 'k -> 'v
    getExn s k

    @@ -561,16 +519,13 @@

    Module Belt_Map

    -
    val remove : ('k, 'a, 'id) t -> 'k -> ('k, 'a, 'id) t
    +
    val remove : ('k, 'v, 'id) t -> 'k -> ('k, 'v, 'id) t
    remove m x when x is not in m, m is returned reference unchanged.
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      
    -      let s0 =  (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp));;
    +                    
     
          let s0 =  (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp));;
     
           let s1 = remove s0 1;;
           let s2 = remove s1 1;;
    @@ -581,7 +536,7 @@ 

    Module Belt_Map

    -
    val removeMany : ('k, 'a, 'id) t -> 'k array -> ('k, 'a, 'id) t
    +
    val removeMany : ('k, 'v, 'id) t -> 'k array -> ('k, 'v, 'id) t
    removeMany s xs

    @@ -595,7 +550,7 @@

    Module Belt_Map

    -
    val set : ('k, 'a, 'id) t -> 'k -> 'a -> ('k, 'a, 'id) t
    +
    val set : ('k, 'v, 'id) t -> 'k -> 'v -> ('k, 'v, 'id) t
    set m x y returns a map containing the same bindings as m, with a new binding of x to y. If x was already bound @@ -603,10 +558,7 @@

    Module Belt_Map

    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] (x:int) y -> Pervasives.compare x y));;
    -      
    -      let s0 =  (ofArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp));;
    +                    
     
          let s0 =  (fromArray [2,"2"; 1,"1"; 3,"3"] ~id:(module IntCmp));;
     
           let s1 = set s0 2 "3";;
     
    @@ -616,8 +568,8 @@ 

    Module Belt_Map

    -
    val updateU : ('k, 'a, 'id) t ->
    'k -> ('a option -> 'a option [@bs]) -> ('k, 'a, 'id) t
    -
    val update : ('k, 'a, 'id) t ->
    'k -> ('a option -> 'a option) -> ('k, 'a, 'id) t
    +
    val updateU : ('k, 'v, 'id) t ->
    'k -> ('v option -> 'v option [@bs]) -> ('k, 'v, 'id) t
    +
    val update : ('k, 'v, 'id) t ->
    'k -> ('v option -> 'v option) -> ('k, 'v, 'id) t
    update m x f returns a map containing the same bindings as m, except for the binding of x. @@ -632,7 +584,7 @@

    Module Belt_Map

    -
    val mergeMany : ('k, 'a, 'id) t -> ('k * 'a) array -> ('k, 'a, 'id) t
    +
    val mergeMany : ('k, 'v, 'id) t -> ('k * 'v) array -> ('k, 'v, 'id) t
    mergeMany s xs

    @@ -646,8 +598,8 @@

    Module Belt_Map

    -
    val mergeU : ('k, 'a, 'id) t ->
    ('k, 'b, 'id) t ->
    ('k -> 'a option -> 'b option -> 'c option [@bs]) -> ('k, 'c, 'id) t
    -
    val merge : ('k, 'a, 'id) t ->
    ('k, 'b, 'id) t ->
    ('k -> 'a option -> 'b option -> 'c option) -> ('k, 'c, 'id) t
    +
    val mergeU : ('k, 'v, 'id) t ->
    ('k, 'v2, 'id) t ->
    ('k -> 'v option -> 'v2 option -> 'v3 option [@bs]) ->
    ('k, 'v3, 'id) t
    +
    val merge : ('k, 'v, 'id) t ->
    ('k, 'v2, 'id) t ->
    ('k -> 'v option -> 'v2 option -> 'v3 option) -> ('k, 'v3, 'id) t
    merge m1 m2 f computes a map whose keys is a subset of keys of m1 and of m2. The presence of each such binding, and the corresponding @@ -658,8 +610,8 @@

    Module Belt_Map

    -
    val keepU : ('k, 'a, 'id) t ->
    ('k -> 'a -> bool [@bs]) -> ('k, 'a, 'id) t
    -
    val keep : ('k, 'a, 'id) t -> ('k -> 'a -> bool) -> ('k, 'a, 'id) t
    +
    val keepU : ('k, 'v, 'id) t ->
    ('k -> 'v -> bool [@bs]) -> ('k, 'v, 'id) t
    +
    val keep : ('k, 'v, 'id) t -> ('k -> 'v -> bool) -> ('k, 'v, 'id) t
    keep m p returns the map with all the bindings in m that satisfy predicate p.
    @@ -669,8 +621,8 @@

    Module Belt_Map

    -
    val partitionU : ('k, 'a, 'id) t ->
    ('k -> 'a -> bool [@bs]) ->
    ('k, 'a, 'id) t * ('k, 'a, 'id) t
    -
    val partition : ('k, 'a, 'id) t ->
    ('k -> 'a -> bool) -> ('k, 'a, 'id) t * ('k, 'a, 'id) t
    +
    val partitionU : ('k, 'v, 'id) t ->
    ('k -> 'v -> bool [@bs]) ->
    ('k, 'v, 'id) t * ('k, 'v, 'id) t
    +
    val partition : ('k, 'v, 'id) t ->
    ('k -> 'v -> bool) -> ('k, 'v, 'id) t * ('k, 'v, 'id) t
    partition m p returns a pair of maps (m1, m2), where m1 contains all the bindings of s that satisfy the @@ -682,7 +634,7 @@

    Module Belt_Map

    -
    val split : ('k, 'a, 'id) t ->
    'k -> (('k, 'a, 'id) t * ('k, 'a, 'id) t) * 'a option
    +
    val split : ('k, 'v, 'id) t ->
    'k -> (('k, 'v, 'id) t * ('k, 'v, 'id) t) * 'v option
    split x m returns a tuple (l r), data, where l is the map with all the bindings of m whose 'k @@ -697,8 +649,8 @@

    Module Belt_Map

    -
    val mapU : ('k, 'a, 'id) t -> ('a -> 'b [@bs]) -> ('k, 'b, 'id) t
    -
    val map : ('k, 'a, 'id) t -> ('a -> 'b) -> ('k, 'b, 'id) t
    +
    val mapU : ('k, 'v, 'id) t -> ('v -> 'v2 [@bs]) -> ('k, 'v2, 'id) t
    +
    val map : ('k, 'v, 'id) t -> ('v -> 'v2) -> ('k, 'v2, 'id) t
    map m f returns a map with same domain as m, where the associated value a of all bindings of m has been @@ -711,8 +663,8 @@

    Module Belt_Map

    -
    val mapWithKeyU : ('k, 'a, 'id) t ->
    ('k -> 'a -> 'b [@bs]) -> ('k, 'b, 'id) t
    -
    val mapWithKey : ('k, 'a, 'id) t -> ('k -> 'a -> 'b) -> ('k, 'b, 'id) t
    +
    val mapWithKeyU : ('k, 'v, 'id) t ->
    ('k -> 'v -> 'v2 [@bs]) -> ('k, 'v2, 'id) t
    +
    val mapWithKey : ('k, 'v, 'id) t -> ('k -> 'v -> 'v2) -> ('k, 'v2, 'id) t
    mapWithKey m f

    @@ -724,7 +676,7 @@

    Module Belt_Map

    -
    val getData : ('a, 'b, 'c) t -> ('a, 'b, 'c) Belt_MapDict.t
    +
    val getData : ('k, 'v, 'id) t -> ('k, 'v, 'id) Belt_MapDict.t
    getData s0

    @@ -739,7 +691,7 @@

    Module Belt_Map

    -
    val getId : ('a, 'b, 'c) t -> ('a, 'c) id
    +
    val getId : ('k, 'v, 'id) t -> ('k, 'id) id
    getId s0

    @@ -752,7 +704,7 @@

    Module Belt_Map

    -
    val packIdData : id:('a, 'b) id ->
    data:('a, 'c, 'b) Belt_MapDict.t -> ('a, 'c, 'b) t
    +
    val packIdData : id:('k, 'id) id ->
    data:('k, 'v, 'id) Belt_MapDict.t -> ('k, 'v, 'id) t
    packIdData ~id ~data

    @@ -764,4 +716,4 @@

    Module Belt_Map

    - + \ No newline at end of file diff --git a/docs/api/Belt_MapDict.html b/docs/api/Belt_MapDict.html index 91fc0f00c7..2bf9415633 100644 --- a/docs/api/Belt_MapDict.html +++ b/docs/api/Belt_MapDict.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -195,6 +196,7 @@

    Module Belt_MapDict

    val toArray : ('k, 'a, 'id) t -> ('k * 'a) array
    val ofArray : ('k * 'a) array ->
    cmp:('k, 'id) cmp -> ('k, 'a, 'id) t
    +
    val fromArray : ('k * 'a) array ->
    cmp:('k, 'id) cmp -> ('k, 'a, 'id) t
    val keysToArray : ('k, 'a, 'id) t -> 'k array
    val valuesToArray : ('k, 'a, 'id) t -> 'a array
    val minKey : ('k, 'a, 'b) t -> 'k option
    @@ -211,7 +213,7 @@

    Module Belt_MapDict

    val getExn : ('k, 'a, 'id) t -> 'k -> cmp:('k, 'id) cmp -> 'a
    val checkInvariantInternal : ('a, 'b, 'c) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MapInt.html b/docs/api/Belt_MapInt.html index 219bee9014..98e73d4182 100644 --- a/docs/api/Belt_MapInt.html +++ b/docs/api/Belt_MapInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,7 +100,7 @@

    Module Belt_MapInt

    module Belt_MapInt: sig .. end
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    @@ -111,11 +112,11 @@

    Module Belt_MapInt

    -
    type 'a t 
    +
    type 'value t 
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    @@ -123,13 +124,13 @@

    Module Belt_MapInt

    -
    val empty : 'a t
    -
    val isEmpty : 'a t -> bool
    -
    val has : 'a t -> key -> bool
    -
    val cmpU : 'a t -> 'a t -> ('a -> 'a -> int [@bs]) -> int
    -
    val cmp : 'a t -> 'a t -> ('a -> 'a -> int) -> int
    -
    val eqU : 'a t -> 'a t -> ('a -> 'a -> bool [@bs]) -> bool
    -
    val eq : 'a t -> 'a t -> ('a -> 'a -> bool) -> bool
    +
    val empty : 'v t
    +
    val isEmpty : 'v t -> bool
    +
    val has : 'v t -> key -> bool
    +
    val cmpU : 'v t -> 'v t -> ('v -> 'v -> int [@bs]) -> int
    +
    val cmp : 'v t -> 'v t -> ('v -> 'v -> int) -> int
    +
    val eqU : 'v t -> 'v t -> ('v -> 'v -> bool [@bs]) -> bool
    +
    val eq : 'v t -> 'v t -> ('v -> 'v -> bool) -> bool
    equal m1 m2 cmp tests whether the maps m1 and m2 are equal, that is, contain equal keys and associate them with @@ -141,8 +142,8 @@

    Module Belt_MapInt

    -
    val forEachU : 'a t -> (key -> 'a -> unit [@bs]) -> unit
    -
    val forEach : 'a t -> (key -> 'a -> unit) -> unit
    +
    val forEachU : 'v t -> (key -> 'v -> unit [@bs]) -> unit
    +
    val forEach : 'v t -> (key -> 'v -> unit) -> unit
    forEach m f applies f to all bindings in map m. f receives the key as first argument, and the associated value @@ -154,8 +155,8 @@

    Module Belt_MapInt

    -
    val reduceU : 'a t -> 'b -> ('b -> key -> 'a -> 'b [@bs]) -> 'b
    -
    val reduce : 'a t -> 'b -> ('b -> key -> 'a -> 'b) -> 'b
    +
    val reduceU : 'v t -> 'v2 -> ('v2 -> key -> 'v -> 'v2 [@bs]) -> 'v2
    +
    val reduce : 'v t -> 'v2 -> ('v2 -> key -> 'v -> 'v2) -> 'v2
    reduce m a f computes (f kN dN ... (f k1 d1 a)...), where k1 ... kN are the keys of all bindings in m @@ -166,8 +167,8 @@

    Module Belt_MapInt

    -
    val everyU : 'a t -> (key -> 'a -> bool [@bs]) -> bool
    -
    val every : 'a t -> (key -> 'a -> bool) -> bool
    +
    val everyU : 'v t -> (key -> 'v -> bool [@bs]) -> bool
    +
    val every : 'v t -> (key -> 'v -> bool) -> bool
    every m p checks if all the bindings of the map satisfy the predicate p.
    @@ -177,8 +178,8 @@

    Module Belt_MapInt

    -
    val someU : 'a t -> (key -> 'a -> bool [@bs]) -> bool
    -
    val some : 'a t -> (key -> 'a -> bool) -> bool
    +
    val someU : 'v t -> (key -> 'v -> bool [@bs]) -> bool
    +
    val some : 'v t -> (key -> 'v -> bool) -> bool
    some m p checks if at least one binding of the map satisfy the predicate p.
    @@ -188,8 +189,8 @@

    Module Belt_MapInt

    -
    val size : 'a t -> int
    -
    val toList : 'a t -> (key * 'a) list
    +
    val size : 'v t -> int
    +
    val toList : 'v t -> (key * 'v) list
    In increasing order with respect
    @@ -198,32 +199,33 @@

    Module Belt_MapInt

    -
    val toArray : 'a t -> (key * 'a) array
    -
    val ofArray : (key * 'a) array -> 'a t
    -
    val keysToArray : 'a t -> key array
    -
    val valuesToArray : 'a t -> 'a array
    +
    val toArray : 'v t -> (key * 'v) array
    +
    val ofArray : (key * 'v) array -> 'v t
    +
    val fromArray : (key * 'v) array -> 'v t
    +
    val keysToArray : 'v t -> key array
    +
    val valuesToArray : 'v t -> 'v array
    val minKey : 'a t -> key option
    val minKeyUndefined : 'a t -> key Js.undefined
    val maxKey : 'a t -> key option
    val maxKeyUndefined : 'a t -> key Js.undefined
    -
    val minimum : 'a t -> (key * 'a) option
    -
    val minUndefined : 'a t -> (key * 'a) Js.undefined
    -
    val maximum : 'a t -> (key * 'a) option
    -
    val maxUndefined : 'a t -> (key * 'a) Js.undefined
    -
    val get : 'a t -> key -> 'a option
    -
    val getUndefined : 'a t -> key -> 'a Js.undefined
    -
    val getWithDefault : 'a t -> key -> 'a -> 'a
    -
    val getExn : 'a t -> key -> 'a
    +
    val minimum : 'v t -> (key * 'v) option
    +
    val minUndefined : 'v t -> (key * 'v) Js.undefined
    +
    val maximum : 'v t -> (key * 'v) option
    +
    val maxUndefined : 'v t -> (key * 'v) Js.undefined
    +
    val get : 'v t -> key -> 'v option
    +
    val getUndefined : 'v t -> key -> 'v Js.undefined
    +
    val getWithDefault : 'v t -> key -> 'v -> 'v
    +
    val getExn : 'v t -> key -> 'v
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    -
    val remove : 'a t -> key -> 'a t
    +
    val remove : 'v t -> key -> 'v t
    remove m x returns a map containing the same bindings as m, except for x which is unbound in the returned map.
    @@ -233,8 +235,8 @@

    Module Belt_MapInt

    -
    val removeMany : 'a t -> key array -> 'a t
    -
    val set : 'a t -> key -> 'a -> 'a t
    +
    val removeMany : 'v t -> key array -> 'v t
    +
    val set : 'v t -> key -> 'v -> 'v t
    add m x y returns a map containing the same bindings as m, plus a binding of x to y. If x was already bound @@ -245,11 +247,11 @@

    Module Belt_MapInt

    -
    val updateU : 'a t ->
    key -> ('a option -> 'a option [@bs]) -> 'a t
    -
    val update : 'a t ->
    key -> ('a option -> 'a option) -> 'a t
    -
    val mergeArray : 'a t -> (key * 'a) array -> 'a t
    -
    val mergeU : 'a t ->
    'b t ->
    (key -> 'a option -> 'b option -> 'c option [@bs]) ->
    'c t
    -
    val merge : 'a t ->
    'b t ->
    (key -> 'a option -> 'b option -> 'c option) -> 'c t
    +
    val updateU : 'v t ->
    key -> ('v option -> 'v option [@bs]) -> 'v t
    +
    val update : 'v t ->
    key -> ('v option -> 'v option) -> 'v t
    +
    val mergeArray : 'v t -> (key * 'v) array -> 'v t
    +
    val mergeU : 'v t ->
    'v2 t ->
    (key -> 'v option -> 'v2 option -> 'c option [@bs]) ->
    'c t
    +
    val merge : 'v t ->
    'v2 t ->
    (key -> 'v option -> 'v2 option -> 'c option) -> 'c t
    merge m1 m2 f computes a map whose keys is a subset of keys of m1 and of m2. The presence of each such binding, and the corresponding @@ -260,8 +262,8 @@

    Module Belt_MapInt

    -
    val keepU : 'a t -> (key -> 'a -> bool [@bs]) -> 'a t
    -
    val keep : 'a t -> (key -> 'a -> bool) -> 'a t
    +
    val keepU : 'v t -> (key -> 'v -> bool [@bs]) -> 'v t
    +
    val keep : 'v t -> (key -> 'v -> bool) -> 'v t
    keep m p returns the map with all the bindings in m that satisfy predicate p.
    @@ -271,8 +273,8 @@

    Module Belt_MapInt

    -
    val partitionU : 'a t ->
    (key -> 'a -> bool [@bs]) -> 'a t * 'a t
    -
    val partition : 'a t ->
    (key -> 'a -> bool) -> 'a t * 'a t
    +
    val partitionU : 'v t ->
    (key -> 'v -> bool [@bs]) -> 'v t * 'v t
    +
    val partition : 'v t ->
    (key -> 'v -> bool) -> 'v t * 'v t
    partition m p returns a pair of maps (m1, m2), where m1 contains all the bindings of s that satisfy the @@ -284,7 +286,7 @@

    Module Belt_MapInt

    -
    val split : key ->
    'a t -> 'a t * 'a option * 'a t
    +
    val split : key ->
    'v t -> 'v t * 'v option * 'v t
    split x m returns a triple (l, data, r), where l is the map with all the bindings of m whose key @@ -299,8 +301,8 @@

    Module Belt_MapInt

    -
    val mapU : 'a t -> ('a -> 'b [@bs]) -> 'b t
    -
    val map : 'a t -> ('a -> 'b) -> 'b t
    +
    val mapU : 'v t -> ('v -> 'v2 [@bs]) -> 'v2 t
    +
    val map : 'v t -> ('v -> 'v2) -> 'v2 t
    map m f returns a map with same domain as m, where the associated value a of all bindings of m has been @@ -313,5 +315,5 @@

    Module Belt_MapInt

    -
    val mapWithKeyU : 'a t -> (key -> 'a -> 'b [@bs]) -> 'b t
    -
    val mapWithKey : 'a t -> (key -> 'a -> 'b) -> 'b t
    \ No newline at end of file +
    val mapWithKeyU : 'v t -> (key -> 'v -> 'v2 [@bs]) -> 'v2 t
    +
    val mapWithKey : 'v t -> (key -> 'v -> 'v2) -> 'v2 t
    \ No newline at end of file diff --git a/docs/api/Belt_MapString.html b/docs/api/Belt_MapString.html index f0f5fe73a0..aa2fe6da1e 100644 --- a/docs/api/Belt_MapString.html +++ b/docs/api/Belt_MapString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,7 +100,7 @@

    Module Belt_MapString

    module Belt_MapString: sig .. end
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    @@ -111,11 +112,11 @@

    Module Belt_MapString

    -
    type 'a t 
    +
    type 'value t 
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    @@ -123,13 +124,13 @@

    Module Belt_MapString

    -
    val empty : 'a t
    -
    val isEmpty : 'a t -> bool
    -
    val has : 'a t -> key -> bool
    -
    val cmpU : 'a t -> 'a t -> ('a -> 'a -> int [@bs]) -> int
    -
    val cmp : 'a t -> 'a t -> ('a -> 'a -> int) -> int
    -
    val eqU : 'a t ->
    'a t -> ('a -> 'a -> bool [@bs]) -> bool
    -
    val eq : 'a t -> 'a t -> ('a -> 'a -> bool) -> bool
    +
    val empty : 'v t
    +
    val isEmpty : 'v t -> bool
    +
    val has : 'v t -> key -> bool
    +
    val cmpU : 'v t -> 'v t -> ('v -> 'v -> int [@bs]) -> int
    +
    val cmp : 'v t -> 'v t -> ('v -> 'v -> int) -> int
    +
    val eqU : 'v t ->
    'v t -> ('v -> 'v -> bool [@bs]) -> bool
    +
    val eq : 'v t -> 'v t -> ('v -> 'v -> bool) -> bool
    equal m1 m2 cmp tests whether the maps m1 and m2 are equal, that is, contain equal keys and associate them with @@ -141,8 +142,8 @@

    Module Belt_MapString

    -
    val forEachU : 'a t -> (key -> 'a -> unit [@bs]) -> unit
    -
    val forEach : 'a t -> (key -> 'a -> unit) -> unit
    +
    val forEachU : 'v t -> (key -> 'v -> unit [@bs]) -> unit
    +
    val forEach : 'v t -> (key -> 'v -> unit) -> unit
    forEach m f applies f to all bindings in map m. f receives the key as first argument, and the associated value @@ -154,8 +155,8 @@

    Module Belt_MapString

    -
    val reduceU : 'a t ->
    'b -> ('b -> key -> 'a -> 'b [@bs]) -> 'b
    -
    val reduce : 'a t -> 'b -> ('b -> key -> 'a -> 'b) -> 'b
    +
    val reduceU : 'v t ->
    'v2 -> ('v2 -> key -> 'v -> 'v2 [@bs]) -> 'v2
    +
    val reduce : 'v t -> 'v2 -> ('v2 -> key -> 'v -> 'v2) -> 'v2
    reduce m a f computes (f kN dN ... (f k1 d1 a)...), where k1 ... kN are the keys of all bindings in m @@ -166,8 +167,8 @@

    Module Belt_MapString

    -
    val everyU : 'a t -> (key -> 'a -> bool [@bs]) -> bool
    -
    val every : 'a t -> (key -> 'a -> bool) -> bool
    +
    val everyU : 'v t -> (key -> 'v -> bool [@bs]) -> bool
    +
    val every : 'v t -> (key -> 'v -> bool) -> bool
    every m p checks if all the bindings of the map satisfy the predicate p.
    @@ -177,8 +178,8 @@

    Module Belt_MapString

    -
    val someU : 'a t -> (key -> 'a -> bool [@bs]) -> bool
    -
    val some : 'a t -> (key -> 'a -> bool) -> bool
    +
    val someU : 'v t -> (key -> 'v -> bool [@bs]) -> bool
    +
    val some : 'v t -> (key -> 'v -> bool) -> bool
    some m p checks if at least one binding of the map satisfy the predicate p.
    @@ -188,8 +189,8 @@

    Module Belt_MapString

    -
    val size : 'a t -> int
    -
    val toList : 'a t -> (key * 'a) list
    +
    val size : 'v t -> int
    +
    val toList : 'v t -> (key * 'v) list
    In increasing order with respect
    @@ -198,32 +199,33 @@

    Module Belt_MapString

    -
    val toArray : 'a t -> (key * 'a) array
    -
    val ofArray : (key * 'a) array -> 'a t
    -
    val keysToArray : 'a t -> key array
    -
    val valuesToArray : 'a t -> 'a array
    +
    val toArray : 'v t -> (key * 'v) array
    +
    val ofArray : (key * 'v) array -> 'v t
    +
    val fromArray : (key * 'v) array -> 'v t
    +
    val keysToArray : 'v t -> key array
    +
    val valuesToArray : 'v t -> 'v array
    val minKey : 'a t -> key option
    val minKeyUndefined : 'a t -> key Js.undefined
    val maxKey : 'a t -> key option
    val maxKeyUndefined : 'a t -> key Js.undefined
    -
    val minimum : 'a t -> (key * 'a) option
    -
    val minUndefined : 'a t -> (key * 'a) Js.undefined
    -
    val maximum : 'a t -> (key * 'a) option
    -
    val maxUndefined : 'a t -> (key * 'a) Js.undefined
    -
    val get : 'a t -> key -> 'a option
    -
    val getUndefined : 'a t -> key -> 'a Js.undefined
    -
    val getWithDefault : 'a t -> key -> 'a -> 'a
    -
    val getExn : 'a t -> key -> 'a
    +
    val minimum : 'v t -> (key * 'v) option
    +
    val minUndefined : 'v t -> (key * 'v) Js.undefined
    +
    val maximum : 'v t -> (key * 'v) option
    +
    val maxUndefined : 'v t -> (key * 'v) Js.undefined
    +
    val get : 'v t -> key -> 'v option
    +
    val getUndefined : 'v t -> key -> 'v Js.undefined
    +
    val getWithDefault : 'v t -> key -> 'v -> 'v
    +
    val getExn : 'v t -> key -> 'v
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    -
    val remove : 'a t -> key -> 'a t
    +
    val remove : 'v t -> key -> 'v t
    remove m x returns a map containing the same bindings as m, except for x which is unbound in the returned map.
    @@ -233,8 +235,8 @@

    Module Belt_MapString

    -
    val removeMany : 'a t -> key array -> 'a t
    -
    val set : 'a t -> key -> 'a -> 'a t
    +
    val removeMany : 'v t -> key array -> 'v t
    +
    val set : 'v t -> key -> 'v -> 'v t
    add m x y returns a map containing the same bindings as m, plus a binding of x to y. If x was already bound @@ -245,11 +247,11 @@

    Module Belt_MapString

    -
    val updateU : 'a t ->
    key -> ('a option -> 'a option [@bs]) -> 'a t
    -
    val update : 'a t ->
    key -> ('a option -> 'a option) -> 'a t
    -
    val mergeArray : 'a t -> (key * 'a) array -> 'a t
    -
    val mergeU : 'a t ->
    'b t ->
    (key -> 'a option -> 'b option -> 'c option [@bs]) ->
    'c t
    -
    val merge : 'a t ->
    'b t ->
    (key -> 'a option -> 'b option -> 'c option) ->
    'c t
    +
    val updateU : 'v t ->
    key -> ('v option -> 'v option [@bs]) -> 'v t
    +
    val update : 'v t ->
    key -> ('v option -> 'v option) -> 'v t
    +
    val mergeArray : 'v t -> (key * 'v) array -> 'v t
    +
    val mergeU : 'v t ->
    'v2 t ->
    (key -> 'v option -> 'v2 option -> 'c option [@bs]) ->
    'c t
    +
    val merge : 'v t ->
    'v2 t ->
    (key -> 'v option -> 'v2 option -> 'c option) ->
    'c t
    merge m1 m2 f computes a map whose keys is a subset of keys of m1 and of m2. The presence of each such binding, and the corresponding @@ -260,8 +262,8 @@

    Module Belt_MapString

    -
    val keepU : 'a t ->
    (key -> 'a -> bool [@bs]) -> 'a t
    -
    val keep : 'a t ->
    (key -> 'a -> bool) -> 'a t
    +
    val keepU : 'v t ->
    (key -> 'v -> bool [@bs]) -> 'v t
    +
    val keep : 'v t ->
    (key -> 'v -> bool) -> 'v t
    keep m p returns the map with all the bindings in m that satisfy predicate p.
    @@ -271,8 +273,8 @@

    Module Belt_MapString

    -
    val partitionU : 'a t ->
    (key -> 'a -> bool [@bs]) ->
    'a t * 'a t
    -
    val partition : 'a t ->
    (key -> 'a -> bool) ->
    'a t * 'a t
    +
    val partitionU : 'v t ->
    (key -> 'v -> bool [@bs]) ->
    'v t * 'v t
    +
    val partition : 'v t ->
    (key -> 'v -> bool) ->
    'v t * 'v t
    partition m p returns a pair of maps (m1, m2), where m1 contains all the bindings of s that satisfy the @@ -284,7 +286,7 @@

    Module Belt_MapString

    -
    val split : key ->
    'a t -> 'a t * 'a option * 'a t
    +
    val split : key ->
    'v t -> 'v t * 'v option * 'v t
    split x m returns a triple (l, data, r), where l is the map with all the bindings of m whose key @@ -299,8 +301,8 @@

    Module Belt_MapString

    -
    val mapU : 'a t -> ('a -> 'b [@bs]) -> 'b t
    -
    val map : 'a t -> ('a -> 'b) -> 'b t
    +
    val mapU : 'v t -> ('v -> 'v2 [@bs]) -> 'v2 t
    +
    val map : 'v t -> ('v -> 'v2) -> 'v2 t
    map m f returns a map with same domain as m, where the associated value a of all bindings of m has been @@ -313,5 +315,5 @@

    Module Belt_MapString

    -
    val mapWithKeyU : 'a t ->
    (key -> 'a -> 'b [@bs]) -> 'b t
    -
    val mapWithKey : 'a t ->
    (key -> 'a -> 'b) -> 'b t
    \ No newline at end of file +
    val mapWithKeyU : 'v t ->
    (key -> 'v -> 'v2 [@bs]) -> 'v2 t
    +
    val mapWithKey : 'v t ->
    (key -> 'v -> 'v2) -> 'v2 t
    \ No newline at end of file diff --git a/docs/api/Belt_MutableMap.Int.html b/docs/api/Belt_MutableMap.Int.html index ce95a6d95a..d2b125bca7 100644 --- a/docs/api/Belt_MutableMap.Int.html +++ b/docs/api/Belt_MutableMap.Int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -193,6 +194,7 @@

    Module Belt_MutableMap.Int

    val toArray : 'a t -> (key * 'a) array
    val ofArray : (key * 'a) array -> 'a t
    +
    val fromArray : (key * 'a) array -> 'a t
    val keysToArray : 'a t -> key array
    val valuesToArray : 'a t -> 'a array
    val minKey : 'a t -> key option
    @@ -209,7 +211,7 @@

    Module Belt_MutableMap.Int

    val getExn : 'a t -> key -> 'a
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MutableMap.String.html b/docs/api/Belt_MutableMap.String.html index 0b01bbbceb..d555caac02 100644 --- a/docs/api/Belt_MutableMap.String.html +++ b/docs/api/Belt_MutableMap.String.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -193,6 +194,7 @@

    Module Belt_MutableMap.String
    val toArray : 'a t -> (key * 'a) array
    val ofArray : (key * 'a) array -> 'a t
    +
    val fromArray : (key * 'a) array -> 'a t
    val keysToArray : 'a t -> key array
    val valuesToArray : 'a t -> 'a array
    val minKey : 'a t -> key option
    @@ -209,7 +211,7 @@

    Module Belt_MutableMap.String
    val getExn : 'a t -> key -> 'a
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MutableMap.html b/docs/api/Belt_MutableMap.html index 6e9a97f063..d2b5f220e5 100644 --- a/docs/api/Belt_MutableMap.html +++ b/docs/api/Belt_MutableMap.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,53 +103,7 @@

    Module Belt_MutableMap

    A mutable sorted map module which allows customize compare behavior.

    - The implementation uses balanced binary trees, and therefore searching - and insertion take time logarithmic in the size of the map. -

    - - All data are parameterized by not its only type but also a unique identity in - the time of initialization, so that two Sets of ints initialized with different - compare functions will have different type. -

    - - For example: -

         type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match Pervasives.compare a0 b0 with
    -             | 0 -> Pervasives.compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 : (_, string,_) t = make ~id:(module I0)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 : (_, string, _) t = make ~id:(module I1)
    -   
    -

    - - Here the compiler would infer s0 and s1 having different type so that - it would not mix. -

    - -

         val s0 : ((int * int), string, I0.identity) t 
    -     val s1 : ((int * int), string, I1.identity) t 
    -   
    -

    - - We can add elements to the collection: -

    - -

         let () =
    -       add s1 (0,0) "a";
    -       add s1 (1,1) "b"
    -   
    -

    - - Since this is an mutable data strucure, s1 will contain two pairs.
    + Same as Belt.Map, but mutable.

    @@ -261,7 +216,7 @@

    Module Belt_MutableMap

    val toArray : ('k, 'a, 'id) t -> ('k * 'a) array
    -
    val ofArray : ('k * 'a) array ->
    id:('k, 'id) id -> ('k, 'a, 'id) t
    +
    val fromArray : ('k * 'a) array ->
    id:('k, 'id) id -> ('k, 'a, 'id) t
    val keysToArray : ('k, 'a, 'b) t -> 'k array
    val valuesToArray : ('b, 'a, 'c) t -> 'a array
    val minKey : ('k, 'a, 'b) t -> 'k option
    @@ -278,13 +233,14 @@

    Module Belt_MutableMap

    val getExn : ('k, 'a, 'id) t -> 'k -> 'a
    val checkInvariantInternal : ('a, 'b, 'c) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    +
    val ofArray : ('k * 'a) array ->
    id:('k, 'id) id -> ('k, 'a, 'id) t
    val remove : ('k, 'a, 'id) t -> 'k -> unit
    remove m x do the in-place modification,
    diff --git a/docs/api/Belt_MutableMapInt.html b/docs/api/Belt_MutableMapInt.html index 1d4503fffd..85bfd62177 100644 --- a/docs/api/Belt_MutableMapInt.html +++ b/docs/api/Belt_MutableMapInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -204,6 +205,7 @@

    Module Belt_MutableMapInt

    val toArray : 'a t -> (key * 'a) array
    val ofArray : (key * 'a) array -> 'a t
    +
    val fromArray : (key * 'a) array -> 'a t
    val keysToArray : 'a t -> key array
    val valuesToArray : 'a t -> 'a array
    val minKey : 'a t -> key option
    @@ -220,7 +222,7 @@

    Module Belt_MutableMapInt

    val getExn : 'a t -> key -> 'a
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MutableMapString.html b/docs/api/Belt_MutableMapString.html index 8386747210..3502dfb72f 100644 --- a/docs/api/Belt_MutableMapString.html +++ b/docs/api/Belt_MutableMapString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -204,6 +205,7 @@

    Module Belt_MutableMapStringval toArray : 'a t -> (key * 'a) array
    val ofArray : (key * 'a) array -> 'a t
    +
    val fromArray : (key * 'a) array -> 'a t
    val keysToArray : 'a t -> key array
    val valuesToArray : 'a t -> 'a array
    val minKey : 'a t -> key option
    @@ -220,7 +222,7 @@

    Module Belt_MutableMapStringval getExn : 'a t -> key -> 'a
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MutableQueue.html b/docs/api/Belt_MutableQueue.html index 0304587632..26deea8596 100644 --- a/docs/api/Belt_MutableQueue.html +++ b/docs/api/Belt_MutableQueue.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -149,9 +150,10 @@

    Module Belt_MutableQueue

    -
    val ofArray : 'a array -> 'a t
    +
    val ofArray : 'a array -> 'a t
    +
    val fromArray : 'a array -> 'a t
    - ofArray a is equivalent to Array.forEach a (add q a)
    + fromArray a is equivalent to Array.forEach a (add q a)
    diff --git a/docs/api/Belt_MutableSet.Int.html b/docs/api/Belt_MutableSet.Int.html index 02c6b2504f..bc32469e05 100644 --- a/docs/api/Belt_MutableSet.Int.html +++ b/docs/api/Belt_MutableSet.Int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -107,7 +108,7 @@

    Module Belt_MutableSet.Int


    -
    type elt = int 
    +
    type value = int 
    @@ -132,25 +133,27 @@

    Module Belt_MutableSet.Int

    val make : unit -> t
    -
    val ofArray : elt array -> t
    -
    val ofSortedArrayUnsafe : elt array -> t
    +
    val fromArray : value array -> t
    +
    val fromSortedArrayUnsafe : value array -> t
    +
    val ofArray : value array -> t
    +
    val ofSortedArrayUnsafe : value array -> t
    val copy : t -> t
    val isEmpty : t -> bool
    -
    val has : t -> elt -> bool
    -
    val add : t -> elt -> unit
    -
    val addCheck : t -> elt -> bool
    -
    val mergeMany : t -> elt array -> unit
    -
    val remove : t -> elt -> unit
    -
    val removeCheck : t -> elt -> bool
    -
    val removeMany : t -> elt array -> unit
    +
    val has : t -> value -> bool
    +
    val add : t -> value -> unit
    +
    val addCheck : t -> value -> bool
    +
    val mergeMany : t -> value array -> unit
    +
    val remove : t -> value -> unit
    +
    val removeCheck : t -> value -> bool
    +
    val removeMany : t -> value array -> unit
    val union : t -> t -> t
    val intersect : t -> t -> t
    val diff : t -> t -> t
    val subset : t -> t -> bool
    val cmp : t -> t -> int
    val eq : t -> t -> bool
    -
    val forEachU : t -> (elt -> unit [@bs]) -> unit
    -
    val forEach : t -> (elt -> unit) -> unit
    +
    val forEachU : t -> (value -> unit [@bs]) -> unit
    +
    val forEach : t -> (value -> unit) -> unit
    In increasing order
    @@ -159,8 +162,8 @@

    Module Belt_MutableSet.Int

    -
    val reduceU : t ->
    'a -> ('a -> elt -> 'a [@bs]) -> 'a
    -
    val reduce : t -> 'a -> ('a -> elt -> 'a) -> 'a
    +
    val reduceU : t ->
    'a -> ('a -> value -> 'a [@bs]) -> 'a
    +
    val reduce : t -> 'a -> ('a -> value -> 'a) -> 'a
    Iterate in increasing order.
    @@ -169,8 +172,8 @@

    Module Belt_MutableSet.Int

    -
    val everyU : t -> (elt -> bool [@bs]) -> bool
    -
    val every : t -> (elt -> bool) -> bool
    +
    val everyU : t -> (value -> bool [@bs]) -> bool
    +
    val every : t -> (value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -180,8 +183,8 @@

    Module Belt_MutableSet.Int

    -
    val someU : t -> (elt -> bool [@bs]) -> bool
    -
    val some : t -> (elt -> bool) -> bool
    +
    val someU : t -> (value -> bool [@bs]) -> bool
    +
    val some : t -> (value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p. Oder unspecified.
    @@ -191,8 +194,8 @@

    Module Belt_MutableSet.Int

    -
    val keepU : t ->
    (elt -> bool [@bs]) -> t
    -
    val keep : t ->
    (elt -> bool) -> t
    +
    val keepU : t ->
    (value -> bool [@bs]) -> t
    +
    val keep : t ->
    (value -> bool) -> t
    keep s p returns a fresh copy of the set of all elements in s that satisfy predicate p.
    @@ -202,8 +205,8 @@

    Module Belt_MutableSet.Int

    -
    val partitionU : t ->
    (elt -> bool [@bs]) ->
    t * t
    -
    val partition : t ->
    (elt -> bool) ->
    t * t
    +
    val partitionU : t ->
    (value -> bool [@bs]) ->
    t * t
    +
    val partition : t ->
    (value -> bool) ->
    t * t
    partition s p returns a fresh copy pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -216,7 +219,7 @@

    Module Belt_MutableSet.Int

    val size : t -> int
    -
    val toList : t -> elt list
    +
    val toList : t -> value list
    In increasing order with respect
    @@ -225,15 +228,15 @@

    Module Belt_MutableSet.Int

    -
    val toArray : t -> elt array
    -
    val minimum : t -> elt option
    -
    val minUndefined : t -> elt Js.undefined
    -
    val maximum : t -> elt option
    -
    val maxUndefined : t -> elt Js.undefined
    -
    val get : t ->
    elt -> elt option
    -
    val getUndefined : t ->
    elt -> elt Js.undefined
    -
    val getExn : t -> elt -> elt
    -
    val split : t ->
    elt ->
    (t * t) * bool
    +
    val toArray : t -> value array
    +
    val minimum : t -> value option
    +
    val minUndefined : t -> value Js.undefined
    +
    val maximum : t -> value option
    +
    val maxUndefined : t -> value Js.undefined
    +
    val get : t ->
    value -> value option
    +
    val getUndefined : t ->
    value -> value Js.undefined
    +
    val getExn : t -> value -> value
    +
    val split : t ->
    value ->
    (t * t) * bool
    split s key return a fresh copy of each
    @@ -244,7 +247,7 @@

    Module Belt_MutableSet.Int

    val checkInvariantInternal : t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MutableSet.String.html b/docs/api/Belt_MutableSet.String.html index 7d0dc46166..22455634be 100644 --- a/docs/api/Belt_MutableSet.String.html +++ b/docs/api/Belt_MutableSet.String.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -107,7 +108,7 @@

    Module Belt_MutableSet.String
    -
    type elt = string 
    +
    type value = string 
    @@ -132,25 +133,27 @@

    Module Belt_MutableSet.String
    val make : unit -> t
    -
    val ofArray : elt array -> t
    -
    val ofSortedArrayUnsafe : elt array -> t
    +
    val fromArray : value array -> t
    +
    val fromSortedArrayUnsafe : value array -> t
    +
    val ofArray : value array -> t
    +
    val ofSortedArrayUnsafe : value array -> t
    val copy : t -> t
    val isEmpty : t -> bool
    -
    val has : t -> elt -> bool
    -
    val add : t -> elt -> unit
    -
    val addCheck : t -> elt -> bool
    -
    val mergeMany : t -> elt array -> unit
    -
    val remove : t -> elt -> unit
    -
    val removeCheck : t -> elt -> bool
    -
    val removeMany : t -> elt array -> unit
    +
    val has : t -> value -> bool
    +
    val add : t -> value -> unit
    +
    val addCheck : t -> value -> bool
    +
    val mergeMany : t -> value array -> unit
    +
    val remove : t -> value -> unit
    +
    val removeCheck : t -> value -> bool
    +
    val removeMany : t -> value array -> unit
    val union : t -> t -> t
    val intersect : t -> t -> t
    val diff : t -> t -> t
    val subset : t -> t -> bool
    val cmp : t -> t -> int
    val eq : t -> t -> bool
    -
    val forEachU : t -> (elt -> unit [@bs]) -> unit
    -
    val forEach : t -> (elt -> unit) -> unit
    +
    val forEachU : t ->
    (value -> unit [@bs]) -> unit
    +
    val forEach : t -> (value -> unit) -> unit
    In increasing order
    @@ -159,8 +162,8 @@

    Module Belt_MutableSet.String

    -
    val reduceU : t ->
    'a -> ('a -> elt -> 'a [@bs]) -> 'a
    -
    val reduce : t ->
    'a -> ('a -> elt -> 'a) -> 'a
    +
    val reduceU : t ->
    'a -> ('a -> value -> 'a [@bs]) -> 'a
    +
    val reduce : t ->
    'a -> ('a -> value -> 'a) -> 'a
    Iterate in increasing order.
    @@ -169,8 +172,8 @@

    Module Belt_MutableSet.String

    -
    val everyU : t -> (elt -> bool [@bs]) -> bool
    -
    val every : t -> (elt -> bool) -> bool
    +
    val everyU : t ->
    (value -> bool [@bs]) -> bool
    +
    val every : t -> (value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -180,8 +183,8 @@

    Module Belt_MutableSet.String

    -
    val someU : t -> (elt -> bool [@bs]) -> bool
    -
    val some : t -> (elt -> bool) -> bool
    +
    val someU : t ->
    (value -> bool [@bs]) -> bool
    +
    val some : t -> (value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p. Oder unspecified.
    @@ -191,8 +194,8 @@

    Module Belt_MutableSet.String

    -
    val keepU : t ->
    (elt -> bool [@bs]) -> t
    -
    val keep : t ->
    (elt -> bool) -> t
    +
    val keepU : t ->
    (value -> bool [@bs]) -> t
    +
    val keep : t ->
    (value -> bool) -> t
    keep s p returns a fresh copy of the set of all elements in s that satisfy predicate p.
    @@ -202,8 +205,8 @@

    Module Belt_MutableSet.String

    -
    val partitionU : t ->
    (elt -> bool [@bs]) ->
    t * t
    -
    val partition : t ->
    (elt -> bool) ->
    t * t
    +
    val partitionU : t ->
    (value -> bool [@bs]) ->
    t * t
    +
    val partition : t ->
    (value -> bool) ->
    t * t
    partition s p returns a fresh copy pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -216,7 +219,7 @@

    Module Belt_MutableSet.String
    val size : t -> int
    -
    val toList : t -> elt list
    +
    val toList : t -> value list
    In increasing order with respect
    @@ -225,15 +228,15 @@

    Module Belt_MutableSet.String

    -
    val toArray : t -> elt array
    -
    val minimum : t -> elt option
    -
    val minUndefined : t -> elt Js.undefined
    -
    val maximum : t -> elt option
    -
    val maxUndefined : t -> elt Js.undefined
    -
    val get : t ->
    elt -> elt option
    -
    val getUndefined : t ->
    elt -> elt Js.undefined
    -
    val getExn : t ->
    elt -> elt
    -
    val split : t ->
    elt ->
    (t * t) * bool
    +
    val toArray : t -> value array
    +
    val minimum : t -> value option
    +
    val minUndefined : t -> value Js.undefined
    +
    val maximum : t -> value option
    +
    val maxUndefined : t -> value Js.undefined
    +
    val get : t ->
    value -> value option
    +
    val getUndefined : t ->
    value -> value Js.undefined
    +
    val getExn : t ->
    value -> value
    +
    val split : t ->
    value ->
    (t * t) * bool
    split s key return a fresh copy of each
    @@ -244,7 +247,7 @@

    Module Belt_MutableSet.String
    val checkInvariantInternal : t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MutableSet.html b/docs/api/Belt_MutableSet.html index 0ce36841a3..7486b72aa1 100644 --- a/docs/api/Belt_MutableSet.html +++ b/docs/api/Belt_MutableSet.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -102,53 +103,7 @@

    Module Belt_MutableSet

    A mutable sorted set module which allows customize compare behavior.

    - The implementation uses balanced binary trees, and therefore searching - and insertion take time logarithmic in the size of the map. -

    - - All data are parameterized by not its only type but also a unique identity in - the time of initialization, so that two Sets of ints initialized with different - compare functions will have different type. -

    - - For example: -

         type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match Pervasives.compare a0 b0 with
    -             | 0 -> Pervasives.compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 = make ~id:(module I0)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 = make ~id:(module I1)
    -   
    -

    - - Here the compiler would infer s0 and s1 having different type so that - it would not mix. -

    - -

         val s0 : ((int * int), I0.identity) t 
    -     val s1 : ((int * int), I1.identity) t 
    -   
    -

    - - We can add elements to the collection: -

    - -

         let () =
    -       add s1 (0,0);
    -       add s1 (1,1)
    -   
    -

    - - Since this is an mutable data strucure, s1 will contain two pairs.
    + Same as Belt.Set, but mutable.

    @@ -178,26 +133,26 @@

    Module Belt_MutableSet

    -
    val make : id:('elt, 'id) id -> ('elt, 'id) t
    -
    val ofArray : 'k array -> id:('k, 'id) id -> ('k, 'id) t
    -
    val ofSortedArrayUnsafe : 'elt array ->
    id:('elt, 'id) id -> ('elt, 'id) t
    +
    val make : id:('value, 'id) id -> ('value, 'id) t
    +
    val fromArray : 'k array -> id:('k, 'id) id -> ('k, 'id) t
    +
    val fromSortedArrayUnsafe : 'value array ->
    id:('value, 'id) id -> ('value, 'id) t
    val copy : ('k, 'id) t -> ('k, 'id) t
    val isEmpty : ('a, 'b) t -> bool
    -
    val has : ('elt, 'a) t -> 'elt -> bool
    -
    val add : ('elt, 'id) t -> 'elt -> unit
    -
    val addCheck : ('elt, 'id) t -> 'elt -> bool
    -
    val mergeMany : ('elt, 'id) t -> 'elt array -> unit
    -
    val remove : ('elt, 'id) t -> 'elt -> unit
    -
    val removeCheck : ('elt, 'id) t -> 'elt -> bool
    -
    val removeMany : ('elt, 'id) t -> 'elt array -> unit
    -
    val union : ('elt, 'id) t ->
    ('elt, 'id) t -> ('elt, 'id) t
    -
    val intersect : ('elt, 'id) t ->
    ('elt, 'id) t -> ('elt, 'id) t
    -
    val diff : ('elt, 'id) t ->
    ('elt, 'id) t -> ('elt, 'id) t
    -
    val subset : ('elt, 'id) t -> ('elt, 'id) t -> bool
    -
    val cmp : ('elt, 'id) t -> ('elt, 'id) t -> int
    -
    val eq : ('elt, 'id) t -> ('elt, 'id) t -> bool
    -
    val forEachU : ('elt, 'id) t -> ('elt -> unit [@bs]) -> unit
    -
    val forEach : ('elt, 'id) t -> ('elt -> unit) -> unit
    +
    val has : ('value, 'a) t -> 'value -> bool
    +
    val add : ('value, 'id) t -> 'value -> unit
    +
    val addCheck : ('value, 'id) t -> 'value -> bool
    +
    val mergeMany : ('value, 'id) t -> 'value array -> unit
    +
    val remove : ('value, 'id) t -> 'value -> unit
    +
    val removeCheck : ('value, 'id) t -> 'value -> bool
    +
    val removeMany : ('value, 'id) t -> 'value array -> unit
    +
    val union : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    +
    val intersect : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    +
    val diff : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    +
    val subset : ('value, 'id) t -> ('value, 'id) t -> bool
    +
    val cmp : ('value, 'id) t -> ('value, 'id) t -> int
    +
    val eq : ('value, 'id) t -> ('value, 'id) t -> bool
    +
    val forEachU : ('value, 'id) t -> ('value -> unit [@bs]) -> unit
    +
    val forEach : ('value, 'id) t -> ('value -> unit) -> unit
    forEach m f applies f in turn to all elements of m. In increasing order
    @@ -207,8 +162,8 @@

    Module Belt_MutableSet

    -
    val reduceU : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a [@bs]) -> 'a
    -
    val reduce : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a) -> 'a
    +
    val reduceU : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a [@bs]) -> 'a
    +
    val reduce : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a) -> 'a
    In increasing order.
    @@ -217,8 +172,8 @@

    Module Belt_MutableSet

    -
    val everyU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val every : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val everyU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val every : ('value, 'id) t -> ('value -> bool) -> bool
    every s p checks if all elements of the set satisfy the predicate p. Order unspecified
    @@ -228,8 +183,8 @@

    Module Belt_MutableSet

    -
    val someU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val some : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val someU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val some : ('value, 'id) t -> ('value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p.
    @@ -239,8 +194,8 @@

    Module Belt_MutableSet

    -
    val keepU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) -> ('elt, 'id) t
    -
    val keep : ('elt, 'id) t ->
    ('elt -> bool) -> ('elt, 'id) t
    +
    val keepU : ('value, 'id) t ->
    ('value -> bool [@bs]) -> ('value, 'id) t
    +
    val keep : ('value, 'id) t ->
    ('value -> bool) -> ('value, 'id) t
    keep s p returns the set of all elements in s that satisfy predicate p.
    @@ -250,8 +205,8 @@

    Module Belt_MutableSet

    -
    val partitionU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) ->
    ('elt, 'id) t * ('elt, 'id) t
    -
    val partition : ('elt, 'id) t ->
    ('elt -> bool) ->
    ('elt, 'id) t * ('elt, 'id) t
    +
    val partitionU : ('value, 'id) t ->
    ('value -> bool [@bs]) ->
    ('value, 'id) t * ('value, 'id) t
    +
    val partition : ('value, 'id) t ->
    ('value -> bool) ->
    ('value, 'id) t * ('value, 'id) t
    partition p s returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -263,8 +218,8 @@

    Module Belt_MutableSet

    -
    val size : ('elt, 'id) t -> int
    -
    val toList : ('elt, 'id) t -> 'elt list
    +
    val size : ('value, 'id) t -> int
    +
    val toList : ('value, 'id) t -> 'value list
    In increasing order
    @@ -273,15 +228,15 @@

    Module Belt_MutableSet

    -
    val toArray : ('elt, 'id) t -> 'elt array
    -
    val minimum : ('elt, 'id) t -> 'elt option
    -
    val minUndefined : ('elt, 'id) t -> 'elt Js.undefined
    -
    val maximum : ('elt, 'id) t -> 'elt option
    -
    val maxUndefined : ('elt, 'id) t -> 'elt Js.undefined
    -
    val get : ('elt, 'id) t -> 'elt -> 'elt option
    -
    val getUndefined : ('elt, 'id) t -> 'elt -> 'elt Js.undefined
    -
    val getExn : ('elt, 'id) t -> 'elt -> 'elt
    -
    val split : ('elt, 'id) t ->
    'elt ->
    (('elt, 'id) t * ('elt, 'id) t) * bool
    +
    val toArray : ('value, 'id) t -> 'value array
    +
    val minimum : ('value, 'id) t -> 'value option
    +
    val minUndefined : ('value, 'id) t -> 'value Js.undefined
    +
    val maximum : ('value, 'id) t -> 'value option
    +
    val maxUndefined : ('value, 'id) t -> 'value Js.undefined
    +
    val get : ('value, 'id) t -> 'value -> 'value option
    +
    val getUndefined : ('value, 'id) t -> 'value -> 'value Js.undefined
    +
    val getExn : ('value, 'id) t -> 'value -> 'value
    +
    val split : ('value, 'id) t ->
    'value ->
    (('value, 'id) t * ('value, 'id) t) * bool
    split s x returns a triple ((l, r), present), where l is the set of elements of s that are @@ -299,10 +254,12 @@

    Module Belt_MutableSet

    val checkInvariantInternal : ('a, 'b) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    - \ No newline at end of file + +
    val ofArray : 'k array -> id:('k, 'id) id -> ('k, 'id) t
    +
    val ofSortedArrayUnsafe : 'value array ->
    id:('value, 'id) id -> ('value, 'id) t
    \ No newline at end of file diff --git a/docs/api/Belt_MutableSetInt.html b/docs/api/Belt_MutableSetInt.html index d9ebed1326..3bd26f780a 100644 --- a/docs/api/Belt_MutableSetInt.html +++ b/docs/api/Belt_MutableSetInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -114,7 +115,7 @@

    Module Belt_MutableSetInt


    -
    type elt = int 
    +
    type value = int 
    @@ -139,25 +140,27 @@

    Module Belt_MutableSetInt

    val make : unit -> t
    -
    val ofArray : elt array -> t
    -
    val ofSortedArrayUnsafe : elt array -> t
    +
    val fromArray : value array -> t
    +
    val fromSortedArrayUnsafe : value array -> t
    +
    val ofArray : value array -> t
    +
    val ofSortedArrayUnsafe : value array -> t
    val copy : t -> t
    val isEmpty : t -> bool
    -
    val has : t -> elt -> bool
    -
    val add : t -> elt -> unit
    -
    val addCheck : t -> elt -> bool
    -
    val mergeMany : t -> elt array -> unit
    -
    val remove : t -> elt -> unit
    -
    val removeCheck : t -> elt -> bool
    -
    val removeMany : t -> elt array -> unit
    +
    val has : t -> value -> bool
    +
    val add : t -> value -> unit
    +
    val addCheck : t -> value -> bool
    +
    val mergeMany : t -> value array -> unit
    +
    val remove : t -> value -> unit
    +
    val removeCheck : t -> value -> bool
    +
    val removeMany : t -> value array -> unit
    val union : t -> t -> t
    val intersect : t -> t -> t
    val diff : t -> t -> t
    val subset : t -> t -> bool
    val cmp : t -> t -> int
    val eq : t -> t -> bool
    -
    val forEachU : t -> (elt -> unit [@bs]) -> unit
    -
    val forEach : t -> (elt -> unit) -> unit
    +
    val forEachU : t -> (value -> unit [@bs]) -> unit
    +
    val forEach : t -> (value -> unit) -> unit
    In increasing order
    @@ -166,8 +169,8 @@

    Module Belt_MutableSetInt

    -
    val reduceU : t ->
    'a -> ('a -> elt -> 'a [@bs]) -> 'a
    -
    val reduce : t -> 'a -> ('a -> elt -> 'a) -> 'a
    +
    val reduceU : t ->
    'a -> ('a -> value -> 'a [@bs]) -> 'a
    +
    val reduce : t -> 'a -> ('a -> value -> 'a) -> 'a
    Iterate in increasing order.
    @@ -176,8 +179,8 @@

    Module Belt_MutableSetInt

    -
    val everyU : t -> (elt -> bool [@bs]) -> bool
    -
    val every : t -> (elt -> bool) -> bool
    +
    val everyU : t -> (value -> bool [@bs]) -> bool
    +
    val every : t -> (value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -187,8 +190,8 @@

    Module Belt_MutableSetInt

    -
    val someU : t -> (elt -> bool [@bs]) -> bool
    -
    val some : t -> (elt -> bool) -> bool
    +
    val someU : t -> (value -> bool [@bs]) -> bool
    +
    val some : t -> (value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p. Oder unspecified.
    @@ -198,8 +201,8 @@

    Module Belt_MutableSetInt

    -
    val keepU : t ->
    (elt -> bool [@bs]) -> t
    -
    val keep : t ->
    (elt -> bool) -> t
    +
    val keepU : t ->
    (value -> bool [@bs]) -> t
    +
    val keep : t ->
    (value -> bool) -> t
    keep s p returns a fresh copy of the set of all elements in s that satisfy predicate p.
    @@ -209,8 +212,8 @@

    Module Belt_MutableSetInt

    -
    val partitionU : t ->
    (elt -> bool [@bs]) ->
    t * t
    -
    val partition : t ->
    (elt -> bool) ->
    t * t
    +
    val partitionU : t ->
    (value -> bool [@bs]) ->
    t * t
    +
    val partition : t ->
    (value -> bool) ->
    t * t
    partition s p returns a fresh copy pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -223,7 +226,7 @@

    Module Belt_MutableSetInt

    val size : t -> int
    -
    val toList : t -> elt list
    +
    val toList : t -> value list
    In increasing order with respect
    @@ -232,15 +235,15 @@

    Module Belt_MutableSetInt

    -
    val toArray : t -> elt array
    -
    val minimum : t -> elt option
    -
    val minUndefined : t -> elt Js.undefined
    -
    val maximum : t -> elt option
    -
    val maxUndefined : t -> elt Js.undefined
    -
    val get : t ->
    elt -> elt option
    -
    val getUndefined : t ->
    elt -> elt Js.undefined
    -
    val getExn : t -> elt -> elt
    -
    val split : t ->
    elt ->
    (t * t) * bool
    +
    val toArray : t -> value array
    +
    val minimum : t -> value option
    +
    val minUndefined : t -> value Js.undefined
    +
    val maximum : t -> value option
    +
    val maxUndefined : t -> value Js.undefined
    +
    val get : t ->
    value -> value option
    +
    val getUndefined : t ->
    value -> value Js.undefined
    +
    val getExn : t -> value -> value
    +
    val split : t ->
    value ->
    (t * t) * bool
    split s key return a fresh copy of each
    @@ -251,7 +254,7 @@

    Module Belt_MutableSetInt

    val checkInvariantInternal : t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MutableSetString.html b/docs/api/Belt_MutableSetString.html index 651445a256..f3f298cc5d 100644 --- a/docs/api/Belt_MutableSetString.html +++ b/docs/api/Belt_MutableSetString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -114,7 +115,7 @@

    Module Belt_MutableSetString
    -
    type elt = string 
    +
    type value = string 
    @@ -139,25 +140,27 @@

    Module Belt_MutableSetStringval make : unit -> t -
    val ofArray : elt array -> t
    -
    val ofSortedArrayUnsafe : elt array -> t
    +
    val fromArray : value array -> t
    +
    val fromSortedArrayUnsafe : value array -> t
    +
    val ofArray : value array -> t
    +
    val ofSortedArrayUnsafe : value array -> t
    val copy : t -> t
    val isEmpty : t -> bool
    -
    val has : t -> elt -> bool
    -
    val add : t -> elt -> unit
    -
    val addCheck : t -> elt -> bool
    -
    val mergeMany : t -> elt array -> unit
    -
    val remove : t -> elt -> unit
    -
    val removeCheck : t -> elt -> bool
    -
    val removeMany : t -> elt array -> unit
    +
    val has : t -> value -> bool
    +
    val add : t -> value -> unit
    +
    val addCheck : t -> value -> bool
    +
    val mergeMany : t -> value array -> unit
    +
    val remove : t -> value -> unit
    +
    val removeCheck : t -> value -> bool
    +
    val removeMany : t -> value array -> unit
    val union : t -> t -> t
    val intersect : t -> t -> t
    val diff : t -> t -> t
    val subset : t -> t -> bool
    val cmp : t -> t -> int
    val eq : t -> t -> bool
    -
    val forEachU : t -> (elt -> unit [@bs]) -> unit
    -
    val forEach : t -> (elt -> unit) -> unit
    +
    val forEachU : t ->
    (value -> unit [@bs]) -> unit
    +
    val forEach : t -> (value -> unit) -> unit
    In increasing order
    @@ -166,8 +169,8 @@

    Module Belt_MutableSetString -
    val reduceU : t ->
    'a -> ('a -> elt -> 'a [@bs]) -> 'a
    -
    val reduce : t ->
    'a -> ('a -> elt -> 'a) -> 'a
    +
    val reduceU : t ->
    'a -> ('a -> value -> 'a [@bs]) -> 'a
    +
    val reduce : t ->
    'a -> ('a -> value -> 'a) -> 'a
    Iterate in increasing order.
    @@ -176,8 +179,8 @@

    Module Belt_MutableSetString -
    val everyU : t -> (elt -> bool [@bs]) -> bool
    -
    val every : t -> (elt -> bool) -> bool
    +
    val everyU : t ->
    (value -> bool [@bs]) -> bool
    +
    val every : t -> (value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -187,8 +190,8 @@

    Module Belt_MutableSetString -
    val someU : t -> (elt -> bool [@bs]) -> bool
    -
    val some : t -> (elt -> bool) -> bool
    +
    val someU : t ->
    (value -> bool [@bs]) -> bool
    +
    val some : t -> (value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p. Oder unspecified.
    @@ -198,8 +201,8 @@

    Module Belt_MutableSetString -
    val keepU : t ->
    (elt -> bool [@bs]) -> t
    -
    val keep : t ->
    (elt -> bool) -> t
    +
    val keepU : t ->
    (value -> bool [@bs]) -> t
    +
    val keep : t ->
    (value -> bool) -> t
    keep s p returns a fresh copy of the set of all elements in s that satisfy predicate p.
    @@ -209,8 +212,8 @@

    Module Belt_MutableSetString -
    val partitionU : t ->
    (elt -> bool [@bs]) ->
    t * t
    -
    val partition : t ->
    (elt -> bool) ->
    t * t
    +
    val partitionU : t ->
    (value -> bool [@bs]) ->
    t * t
    +
    val partition : t ->
    (value -> bool) ->
    t * t
    partition s p returns a fresh copy pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -223,7 +226,7 @@

    Module Belt_MutableSetStringval size : t -> int -
    val toList : t -> elt list
    +
    val toList : t -> value list
    In increasing order with respect
    @@ -232,15 +235,15 @@

    Module Belt_MutableSetString -
    val toArray : t -> elt array
    -
    val minimum : t -> elt option
    -
    val minUndefined : t -> elt Js.undefined
    -
    val maximum : t -> elt option
    -
    val maxUndefined : t -> elt Js.undefined
    -
    val get : t ->
    elt -> elt option
    -
    val getUndefined : t ->
    elt -> elt Js.undefined
    -
    val getExn : t ->
    elt -> elt
    -
    val split : t ->
    elt ->
    (t * t) * bool
    +
    val toArray : t -> value array
    +
    val minimum : t -> value option
    +
    val minUndefined : t -> value Js.undefined
    +
    val maximum : t -> value option
    +
    val maxUndefined : t -> value Js.undefined
    +
    val get : t ->
    value -> value option
    +
    val getUndefined : t ->
    value -> value Js.undefined
    +
    val getExn : t ->
    value -> value
    +
    val split : t ->
    value ->
    (t * t) * bool
    split s key return a fresh copy of each
    @@ -251,7 +254,7 @@

    Module Belt_MutableSetStringval checkInvariantInternal : t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_MutableStack.html b/docs/api/Belt_MutableStack.html index 641ce3a2aa..1ea4501ff6 100644 --- a/docs/api/Belt_MutableStack.html +++ b/docs/api/Belt_MutableStack.html @@ -7,7 +7,7 @@ - + Belt_MutableStack

    Module Belt_MutableStack

    diff --git a/docs/api/Belt_Option.html b/docs/api/Belt_Option.html new file mode 100644 index 0000000000..2c5fd46f44 --- /dev/null +++ b/docs/api/Belt_Option.html @@ -0,0 +1,127 @@ + + + + + + + + + + + Belt_Option + + + +

    Module Belt_Option

    + +
    module Belt_Option: sig .. end
    +
    + Belt.Option +

    + + Utilities for option data type
    + +

    + +
    + +
    + +
    val getExn : 'a option -> 'a
    +
    val mapWithDefaultU : 'a option -> 'b -> ('a -> 'b [@bs]) -> 'b
    +
    val mapWithDefault : 'a option -> 'b -> ('a -> 'b) -> 'b
    +
    val mapU : 'a option -> ('a -> 'b [@bs]) -> 'b option
    +
    val map : 'a option -> ('a -> 'b) -> 'b option
    +
    val flatMapU : 'a option -> ('a -> 'b option [@bs]) -> 'b option
    +
    val flatMap : 'a option -> ('a -> 'b option) -> 'b option
    +
    val getWithDefault : 'a option -> 'a -> 'a
    +
    val isSome : 'a option -> bool
    +
    val isNone : 'a option -> bool
    +
    val eqU : 'a option -> 'b option -> ('a -> 'b -> bool [@bs]) -> bool
    +
    val eq : 'a option -> 'b option -> ('a -> 'b -> bool) -> bool
    +
    val cmpU : 'a option -> 'b option -> ('a -> 'b -> int [@bs]) -> int
    +
    val cmp : 'a option -> 'b option -> ('a -> 'b -> int) -> int
    \ No newline at end of file diff --git a/docs/api/Belt_Range.html b/docs/api/Belt_Range.html index b41689ce46..c02afb60d9 100644 --- a/docs/api/Belt_Range.html +++ b/docs/api/Belt_Range.html @@ -7,7 +7,7 @@ - + Belt_Range - -
    val empty : ('elt, 'id) t
    +
    val empty : ('value, 'id) t
    val ofArray : 'k array -> cmp:('k, 'id) cmp -> ('k, 'id) t
    -
    val ofSortedArrayUnsafe : 'elt array -> ('elt, 'id) t
    +
    val ofSortedArrayUnsafe : 'value array -> ('value, 'id) t
    +
    val fromArray : 'k array -> cmp:('k, 'id) cmp -> ('k, 'id) t
    +
    val fromSortedArrayUnsafe : 'value array -> ('value, 'id) t
    val isEmpty : ('a, 'b) t -> bool
    val has : ('k, 'id) t -> 'k -> cmp:('k, 'id) cmp -> bool
    val add : ('k, 'id) t ->
    'k -> cmp:('k, 'id) cmp -> ('k, 'id) t
    @@ -130,8 +133,8 @@

    Module Belt_Set.Dict

    -
    val mergeMany : ('elt, 'id) t ->
    'elt array -> cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val remove : ('elt, 'id) t ->
    'elt -> cmp:('elt, 'id) cmp -> ('elt, 'id) t
    +
    val mergeMany : ('value, 'id) t ->
    'value array ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val remove : ('value, 'id) t ->
    'value -> cmp:('value, 'id) cmp -> ('value, 'id) t
    remove m x If x was not in m, m is returned reference unchanged.
    @@ -140,12 +143,12 @@

    Module Belt_Set.Dict

    -
    val removeMany : ('elt, 'id) t ->
    'elt array -> cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val union : ('elt, 'id) t ->
    ('elt, 'id) t ->
    cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val intersect : ('elt, 'id) t ->
    ('elt, 'id) t ->
    cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val diff : ('elt, 'id) t ->
    ('elt, 'id) t ->
    cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val subset : ('elt, 'id) t ->
    ('elt, 'id) t -> cmp:('elt, 'id) cmp -> bool
    -
    val cmp : ('elt, 'id) t ->
    ('elt, 'id) t -> cmp:('elt, 'id) cmp -> int
    +
    val removeMany : ('value, 'id) t ->
    'value array ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val union : ('value, 'id) t ->
    ('value, 'id) t ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val intersect : ('value, 'id) t ->
    ('value, 'id) t ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val diff : ('value, 'id) t ->
    ('value, 'id) t ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val subset : ('value, 'id) t ->
    ('value, 'id) t -> cmp:('value, 'id) cmp -> bool
    +
    val cmp : ('value, 'id) t ->
    ('value, 'id) t -> cmp:('value, 'id) cmp -> int
    Total ordering between sets. Can be used as the ordering function for doing sets of sets.
    @@ -155,9 +158,9 @@

    Module Belt_Set.Dict

    -
    val eq : ('elt, 'id) t ->
    ('elt, 'id) t -> cmp:('elt, 'id) cmp -> bool
    -
    val forEachU : ('elt, 'id) t -> ('elt -> unit [@bs]) -> unit
    -
    val forEach : ('elt, 'id) t -> ('elt -> unit) -> unit
    +
    val eq : ('value, 'id) t ->
    ('value, 'id) t -> cmp:('value, 'id) cmp -> bool
    +
    val forEachU : ('value, 'id) t -> ('value -> unit [@bs]) -> unit
    +
    val forEach : ('value, 'id) t -> ('value -> unit) -> unit
    forEach s f applies f in turn to all elements of s. In increasing order
    @@ -167,8 +170,8 @@

    Module Belt_Set.Dict

    -
    val reduceU : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a [@bs]) -> 'a
    -
    val reduce : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a) -> 'a
    +
    val reduceU : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a [@bs]) -> 'a
    +
    val reduce : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a) -> 'a
    In increasing order.
    @@ -177,8 +180,8 @@

    Module Belt_Set.Dict

    -
    val everyU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val every : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val everyU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val every : ('value, 'id) t -> ('value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified
    @@ -188,8 +191,8 @@

    Module Belt_Set.Dict

    -
    val someU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val some : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val someU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val some : ('value, 'id) t -> ('value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p.
    @@ -199,8 +202,8 @@

    Module Belt_Set.Dict

    -
    val keepU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) -> ('elt, 'id) t
    -
    val keep : ('elt, 'id) t -> ('elt -> bool) -> ('elt, 'id) t
    +
    val keepU : ('value, 'id) t ->
    ('value -> bool [@bs]) -> ('value, 'id) t
    +
    val keep : ('value, 'id) t ->
    ('value -> bool) -> ('value, 'id) t
    keep m p returns the set of all elements in s that satisfy predicate p.
    @@ -210,8 +213,8 @@

    Module Belt_Set.Dict

    -
    val partitionU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) ->
    ('elt, 'id) t * ('elt, 'id) t
    -
    val partition : ('elt, 'id) t ->
    ('elt -> bool) -> ('elt, 'id) t * ('elt, 'id) t
    +
    val partitionU : ('value, 'id) t ->
    ('value -> bool [@bs]) ->
    ('value, 'id) t * ('value, 'id) t
    +
    val partition : ('value, 'id) t ->
    ('value -> bool) ->
    ('value, 'id) t * ('value, 'id) t
    partition m p returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -223,8 +226,8 @@

    Module Belt_Set.Dict

    -
    val size : ('elt, 'id) t -> int
    -
    val toList : ('elt, 'id) t -> 'elt list
    +
    val size : ('value, 'id) t -> int
    +
    val toList : ('value, 'id) t -> 'value list
    In increasing order
    @@ -233,18 +236,18 @@

    Module Belt_Set.Dict

    -
    val toArray : ('elt, 'id) t -> 'elt array
    -
    val minimum : ('elt, 'id) t -> 'elt option
    -
    val minUndefined : ('elt, 'id) t -> 'elt Js.undefined
    -
    val maximum : ('elt, 'id) t -> 'elt option
    -
    val maxUndefined : ('elt, 'id) t -> 'elt Js.undefined
    -
    val get : ('elt, 'id) t ->
    'elt -> cmp:('elt, 'id) cmp -> 'elt option
    -
    val getUndefined : ('elt, 'id) t ->
    'elt -> cmp:('elt, 'id) cmp -> 'elt Js.undefined
    -
    val getExn : ('elt, 'id) t ->
    'elt -> cmp:('elt, 'id) cmp -> 'elt
    -
    val split : ('elt, 'id) t ->
    'elt ->
    cmp:('elt, 'id) cmp ->
    (('elt, 'id) t * ('elt, 'id) t) * bool
    +
    val toArray : ('value, 'id) t -> 'value array
    +
    val minimum : ('value, 'id) t -> 'value option
    +
    val minUndefined : ('value, 'id) t -> 'value Js.undefined
    +
    val maximum : ('value, 'id) t -> 'value option
    +
    val maxUndefined : ('value, 'id) t -> 'value Js.undefined
    +
    val get : ('value, 'id) t ->
    'value -> cmp:('value, 'id) cmp -> 'value option
    +
    val getUndefined : ('value, 'id) t ->
    'value -> cmp:('value, 'id) cmp -> 'value Js.undefined
    +
    val getExn : ('value, 'id) t ->
    'value -> cmp:('value, 'id) cmp -> 'value
    +
    val split : ('value, 'id) t ->
    'value ->
    cmp:('value, 'id) cmp ->
    (('value, 'id) t * ('value, 'id) t) * bool
    val checkInvariantInternal : ('a, 'b) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_Set.Int.html b/docs/api/Belt_Set.Int.html index e97764dd4c..431b69b122 100644 --- a/docs/api/Belt_Set.Int.html +++ b/docs/api/Belt_Set.Int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -98,7 +99,7 @@

    Module Belt_Set.Int

    module Int: Belt_SetInt
    - Specalized when key type is int, more efficient + Specalized when value type is int, more efficient than the gerneic type, its compare behavior is fixed using the built-in comparison
    @@ -107,7 +108,7 @@

    Module Belt_Set.Int


    -
    type elt = int 
    +
    type value = int 
    @@ -132,11 +133,13 @@

    Module Belt_Set.Int

    val empty : t
    -
    val ofArray : elt array -> t
    -
    val ofSortedArrayUnsafe : elt array -> t
    +
    val ofArray : value array -> t
    +
    val ofSortedArrayUnsafe : value array -> t
    +
    val fromArray : value array -> t
    +
    val fromSortedArrayUnsafe : value array -> t
    val isEmpty : t -> bool
    -
    val has : t -> elt -> bool
    -
    val add : t -> elt -> t
    +
    val has : t -> value -> bool
    +
    val add : t -> value -> t
    If x was already in s, s is returned unchanged.
    @@ -145,8 +148,8 @@

    Module Belt_Set.Int

    -
    val mergeMany : t -> elt array -> t
    -
    val remove : t -> elt -> t
    +
    val mergeMany : t -> value array -> t
    +
    val remove : t -> value -> t
    If x was not in s, s is returned unchanged.
    @@ -155,7 +158,7 @@

    Module Belt_Set.Int

    -
    val removeMany : t -> elt array -> t
    +
    val removeMany : t -> value array -> t
    val union : t -> t -> t
    val intersect : t -> t -> t
    val diff : t -> t -> t
    @@ -189,8 +192,8 @@

    Module Belt_Set.Int

    -
    val forEachU : t -> (elt -> unit [@bs]) -> unit
    -
    val forEach : t -> (elt -> unit) -> unit
    +
    val forEachU : t -> (value -> unit [@bs]) -> unit
    +
    val forEach : t -> (value -> unit) -> unit
    In increasing order
    @@ -199,8 +202,8 @@

    Module Belt_Set.Int

    -
    val reduceU : t -> 'a -> ('a -> elt -> 'a [@bs]) -> 'a
    -
    val reduce : t -> 'a -> ('a -> elt -> 'a) -> 'a
    +
    val reduceU : t -> 'a -> ('a -> value -> 'a [@bs]) -> 'a
    +
    val reduce : t -> 'a -> ('a -> value -> 'a) -> 'a
    Iterate in increasing order.
    @@ -209,8 +212,8 @@

    Module Belt_Set.Int

    -
    val everyU : t -> (elt -> bool [@bs]) -> bool
    -
    val every : t -> (elt -> bool) -> bool
    +
    val everyU : t -> (value -> bool [@bs]) -> bool
    +
    val every : t -> (value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -220,8 +223,8 @@

    Module Belt_Set.Int

    -
    val someU : t -> (elt -> bool [@bs]) -> bool
    -
    val some : t -> (elt -> bool) -> bool
    +
    val someU : t -> (value -> bool [@bs]) -> bool
    +
    val some : t -> (value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p. Oder unspecified.
    @@ -231,8 +234,8 @@

    Module Belt_Set.Int

    -
    val keepU : t -> (elt -> bool [@bs]) -> t
    -
    val keep : t -> (elt -> bool) -> t
    +
    val keepU : t -> (value -> bool [@bs]) -> t
    +
    val keep : t -> (value -> bool) -> t
    keep p s returns the set of all elements in s that satisfy predicate p.
    @@ -242,8 +245,8 @@

    Module Belt_Set.Int

    -
    val partitionU : t ->
    (elt -> bool [@bs]) -> t * t
    -
    val partition : t -> (elt -> bool) -> t * t
    +
    val partitionU : t ->
    (value -> bool [@bs]) -> t * t
    +
    val partition : t -> (value -> bool) -> t * t
    partition p s returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -256,7 +259,7 @@

    Module Belt_Set.Int

    val size : t -> int
    -
    val toList : t -> elt list
    +
    val toList : t -> value list
    In increasing order with respect
    @@ -265,15 +268,15 @@

    Module Belt_Set.Int

    -
    val toArray : t -> elt array
    -
    val minimum : t -> elt option
    -
    val minUndefined : t -> elt Js.undefined
    -
    val maximum : t -> elt option
    -
    val maxUndefined : t -> elt Js.undefined
    -
    val get : t -> elt -> elt option
    -
    val getUndefined : t -> elt -> elt Js.undefined
    -
    val getExn : t -> elt -> elt
    -
    val split : t -> elt -> (t * t) * bool
    +
    val toArray : t -> value array
    +
    val minimum : t -> value option
    +
    val minUndefined : t -> value Js.undefined
    +
    val maximum : t -> value option
    +
    val maxUndefined : t -> value Js.undefined
    +
    val get : t -> value -> value option
    +
    val getUndefined : t -> value -> value Js.undefined
    +
    val getExn : t -> value -> value
    +
    val split : t -> value -> (t * t) * bool
    split x s returns a triple (l, present, r), where l is the set of elements of s that are @@ -290,7 +293,7 @@

    Module Belt_Set.Int

    val checkInvariantInternal : t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_Set.String.html b/docs/api/Belt_Set.String.html index d37b3e8c36..7336a23e7e 100644 --- a/docs/api/Belt_Set.String.html +++ b/docs/api/Belt_Set.String.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,7 +100,7 @@

    Module Belt_Set.String

    module String: Belt_SetString
    - Specalized when key type is string, more efficient + Specalized when value type is string, more efficient than the gerneic type, its compare behavior is fixed using the built-in comparison
    @@ -108,7 +109,7 @@

    Module Belt_Set.String


    -
    type elt = string 
    +
    type value = string 
    @@ -133,11 +134,13 @@

    Module Belt_Set.String

    val empty : t
    -
    val ofArray : elt array -> t
    -
    val ofSortedArrayUnsafe : elt array -> t
    +
    val ofArray : value array -> t
    +
    val ofSortedArrayUnsafe : value array -> t
    +
    val fromArray : value array -> t
    +
    val fromSortedArrayUnsafe : value array -> t
    val isEmpty : t -> bool
    -
    val has : t -> elt -> bool
    -
    val add : t -> elt -> t
    +
    val has : t -> value -> bool
    +
    val add : t -> value -> t
    If x was already in s, s is returned unchanged.
    @@ -146,8 +149,8 @@

    Module Belt_Set.String

    -
    val mergeMany : t -> elt array -> t
    -
    val remove : t -> elt -> t
    +
    val mergeMany : t -> value array -> t
    +
    val remove : t -> value -> t
    If x was not in s, s is returned unchanged.
    @@ -156,7 +159,7 @@

    Module Belt_Set.String

    -
    val removeMany : t -> elt array -> t
    +
    val removeMany : t -> value array -> t
    val union : t -> t -> t
    val intersect : t -> t -> t
    val diff : t -> t -> t
    @@ -190,8 +193,8 @@

    Module Belt_Set.String

    -
    val forEachU : t -> (elt -> unit [@bs]) -> unit
    -
    val forEach : t -> (elt -> unit) -> unit
    +
    val forEachU : t -> (value -> unit [@bs]) -> unit
    +
    val forEach : t -> (value -> unit) -> unit
    In increasing order
    @@ -200,8 +203,8 @@

    Module Belt_Set.String

    -
    val reduceU : t -> 'a -> ('a -> elt -> 'a [@bs]) -> 'a
    -
    val reduce : t -> 'a -> ('a -> elt -> 'a) -> 'a
    +
    val reduceU : t -> 'a -> ('a -> value -> 'a [@bs]) -> 'a
    +
    val reduce : t -> 'a -> ('a -> value -> 'a) -> 'a
    Iterate in increasing order.
    @@ -210,8 +213,8 @@

    Module Belt_Set.String

    -
    val everyU : t -> (elt -> bool [@bs]) -> bool
    -
    val every : t -> (elt -> bool) -> bool
    +
    val everyU : t -> (value -> bool [@bs]) -> bool
    +
    val every : t -> (value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -221,8 +224,8 @@

    Module Belt_Set.String

    -
    val someU : t -> (elt -> bool [@bs]) -> bool
    -
    val some : t -> (elt -> bool) -> bool
    +
    val someU : t -> (value -> bool [@bs]) -> bool
    +
    val some : t -> (value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p. Oder unspecified.
    @@ -232,8 +235,8 @@

    Module Belt_Set.String

    -
    val keepU : t -> (elt -> bool [@bs]) -> t
    -
    val keep : t -> (elt -> bool) -> t
    +
    val keepU : t -> (value -> bool [@bs]) -> t
    +
    val keep : t -> (value -> bool) -> t
    keep p s returns the set of all elements in s that satisfy predicate p.
    @@ -243,8 +246,8 @@

    Module Belt_Set.String

    -
    val partitionU : t ->
    (elt -> bool [@bs]) -> t * t
    -
    val partition : t ->
    (elt -> bool) -> t * t
    +
    val partitionU : t ->
    (value -> bool [@bs]) -> t * t
    +
    val partition : t ->
    (value -> bool) -> t * t
    partition p s returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -257,7 +260,7 @@

    Module Belt_Set.String

    val size : t -> int
    -
    val toList : t -> elt list
    +
    val toList : t -> value list
    In increasing order with respect
    @@ -266,15 +269,15 @@

    Module Belt_Set.String

    -
    val toArray : t -> elt array
    -
    val minimum : t -> elt option
    -
    val minUndefined : t -> elt Js.undefined
    -
    val maximum : t -> elt option
    -
    val maxUndefined : t -> elt Js.undefined
    -
    val get : t -> elt -> elt option
    -
    val getUndefined : t -> elt -> elt Js.undefined
    -
    val getExn : t -> elt -> elt
    -
    val split : t ->
    elt -> (t * t) * bool
    +
    val toArray : t -> value array
    +
    val minimum : t -> value option
    +
    val minUndefined : t -> value Js.undefined
    +
    val maximum : t -> value option
    +
    val maxUndefined : t -> value Js.undefined
    +
    val get : t -> value -> value option
    +
    val getUndefined : t -> value -> value Js.undefined
    +
    val getExn : t -> value -> value
    +
    val split : t ->
    value -> (t * t) * bool
    split x s returns a triple (l, present, r), where l is the set of elements of s that are @@ -291,7 +294,7 @@

    Module Belt_Set.String

    val checkInvariantInternal : t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_Set.html b/docs/api/Belt_Set.html index c7b578bd73..0c9562d68f 100644 --- a/docs/api/Belt_Set.html +++ b/docs/api/Belt_Set.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -106,69 +107,43 @@

    Module Belt_Set

    and insertion take time logarithmic in the size of the map.

    - All data are parameterized by not its only type but also a unique identity in - the time of initialization, so that two Sets of ints initialized with different - compare functions will have different type. + For more info on this module's usage of identity, `make` and others, please see + the top level documentation of Belt, A special encoding for collection safety.

    - For example: -

         type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match Pervasives.compare a0 b0 with
    -             | 0 -> Pervasives.compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 = make ~id:(module I0)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 = make ~id:(module I1)
    -   
    -

    - - Here the compiler would infer s0 and s1 having different type so that - it would not mix. -

    - -

         val s0 :  ((int * int), I0.identity) t
    -     val s1 :  ((int * int), I1.identity) t
    -   
    -

    - - We can add elements to the collection: -

    - -

         let s2 = add s1 (0,0)
    -     let s3 = add s2 (1,1)
    -   
    -

    - - Since this is an immutable data strucure, s1 will be an empty set - while s2 will contain one element, s3 will contain two. + Example usage:
    + +

    +
    +
     
        module PairComparator = Belt.Id.MakeComparable(struct
    +      type t = int * int
    +      let cmp (a0, a1) (b0, b1) =
    +        match Pervasives.compare a0 b0 with
    +        | 0 -> Pervasives.compare a1 b1
    +        | c -> c
    +    end)
    +
    +    let mySet = Belt.Set.make ~id:(module PairComparator)
    +    let mySet2 = Belt.Set.add mySet (1, 2)
    +  

    - The union s0 s3 will result in a type error, since their identity mismatch
    - + The API documentation below will assume a predeclared comparator module for integers, IntCmp

    -

    module Int: Belt_SetInt
    - Specalized when key type is int, more efficient + Specalized when value type is int, more efficient than the gerneic type, its compare behavior is fixed using the built-in comparison
    module String: Belt_SetString
    - Specalized when key type is string, more efficient + Specalized when value type is string, more efficient than the gerneic type, its compare behavior is fixed using the built-in comparison
    @@ -181,14 +156,14 @@

    Module Belt_Set

    -
    type ('key, 'identity) t 
    +
    type ('value, 'identity) t 
    - ('key, 'identity) t + ('value, 'identity) t

    - 'key is the element type + 'value is the element type

    'identity the identity of the collection
    @@ -199,7 +174,7 @@

    Module Belt_Set

    -
    type ('key, 'id) id = ('key, 'id) Belt_Id.comparable 
    +
    type ('value, 'id) id = ('value, 'id) Belt_Id.comparable 
    @@ -211,41 +186,38 @@

    Module Belt_Set

    -
    val make : id:('elt, 'id) id -> ('elt, 'id) t
    +
    val make : id:('value, 'id) id -> ('value, 'id) t
    - make ~id
    + make ~id creates a new set by taking in the comparator
    -
     
         module IntCmp = (val Belt.Id.comparable ~cmp:(fun (x:int) y -> Pervasives.compare x y))
    -     let s = make ~id:(module IntCmp)
    +                    
     
          let s = make ~id:(module IntCmp)
         
    -
    val ofArray : 'k array -> id:('k, 'id) id -> ('k, 'id) t
    +
    val ofArray : 'value array -> id:('value, 'id) id -> ('value, 'id) t
    +
    val fromArray : 'value array -> id:('value, 'id) id -> ('value, 'id) t
    - ofArray xs ~id
    + fromArray xs ~id
    -
     
         module IntCmp = (val Belt.Id.comparableU
    -                         ~cmp:(fun[@bs]
    -                                (x:int) y -> Pervasives.compare x y));;
    -     toArray (ofArray [1;3;2;4] (module IntCmp)) = [1;2;3;4]
    -      
    +                    
     
         toArray (fromArray [1;3;2;4] (module IntCmp)) = [1;2;3;4]
         
    -
    val ofSortedArrayUnsafe : 'elt array -> id:('elt, 'id) id -> ('elt, 'id) t
    +
    val ofSortedArrayUnsafe : 'value array -> id:('value, 'id) id -> ('value, 'id) t
    +
    val fromSortedArrayUnsafe : 'value array -> id:('value, 'id) id -> ('value, 'id) t
    - ofSortedArrayUnsafe xs ~id + fromSortedArrayUnsafe xs ~id

    - The same as Belt_Set.ofArray except it is after assuming the input array x is already sorted + The same as Belt_Set.fromArray except it is after assuming the input array x is already sorted

    Unsafe
    @@ -260,27 +232,19 @@

    Module Belt_Set

    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;     
    -     isEmpty (ofArray [||] ~id:(module IntCmp)) = true;;
    -     isEmpty (ofArray [|1|] ~id:(module IntCmp)) = true;;  
    +                    
     
         isEmpty (fromArray [||] ~id:(module IntCmp)) = true;;
    +     isEmpty (fromArray [|1|] ~id:(module IntCmp)) = true;;
        
    -
    val has : ('elt, 'id) t -> 'elt -> bool
    +
    val has : ('value, 'id) t -> 'value -> bool
    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -     let v = ofArray [|1;4;2;5|] ~id:(module IntCmp);;
    +                    
     
         let v = fromArray [|1;4;2;5|] ~id:(module IntCmp);;
          has v 3 = false;;
          has v 1 = true;;
        
    @@ -288,17 +252,13 @@

    Module Belt_Set

    -
    val add : ('elt, 'id) t -> 'elt -> ('elt, 'id) t
    +
    val add : ('value, 'id) t -> 'value -> ('value, 'id) t
    add s x If x was already in s, s is returned unchanged.
    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -     let s0 = make ~id:(module IntCmp);;
    +                    
     
         let s0 = make ~id:(module IntCmp);;
          let s1 = add s0 1 ;;
          let s2 = add s1 2;;
          let s3 = add s2 2;;
    @@ -312,7 +272,7 @@ 

    Module Belt_Set

    -
    val mergeMany : ('elt, 'id) t -> 'elt array -> ('elt, 'id) t
    +
    val mergeMany : ('value, 'id) t -> 'value array -> ('value, 'id) t
    mergeMany s xs

    @@ -326,30 +286,26 @@

    Module Belt_Set

    -
    val remove : ('elt, 'id) t -> 'elt -> ('elt, 'id) t
    +
    val remove : ('value, 'id) t -> 'value -> ('value, 'id) t
    remove m x If x was not in m, m is returned reference unchanged.
    -
     
          module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|2;3;1;4;5|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|2;3;1;4;5|];;
           let s1 = remove s0 1 ;;
           let s2 = remove s1 3 ;;
           let s3 = remove s2 3 ;;
     
           toArray s1 = [|2;3;4;5|];;
           toArray s2 = [|2;4;5|];;
    -      s2 == s3;; 
    +      s2 == s3;;
         
    -
    val removeMany : ('elt, 'id) t -> 'elt array -> ('elt, 'id) t
    +
    val removeMany : ('value, 'id) t -> 'value array -> ('value, 'id) t
    removeMany s xs

    @@ -363,54 +319,42 @@

    Module Belt_Set

    -
    val union : ('elt, 'id) t -> ('elt, 'id) t -> ('elt, 'id) t
    +
    val union : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    union s0 s1
    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -     let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    -     let s1 = ofArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
    +                    
     
         let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +     let s1 = fromArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
          toArray (union s0 s1) =  [|1;2;3;4;5;6|]
        
    -
    val intersect : ('elt, 'id) t -> ('elt, 'id) t -> ('elt, 'id) t
    +
    val intersect : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    intersect s0 s1
    -
     
         module IntCmp =
    -       (val Belt.Id.comparableU
    -           ~cmp:(fun[@bs]
    -                  (x:int) y -> Pervasives.compare x y));;
    -     let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    -     let s1 = ofArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
    +                    
     
         let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +     let s1 = fromArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
          toArray (intersect s0 s1) =  [|2;3;5|]
        
    -
    val diff : ('elt, 'id) t -> ('elt, 'id) t -> ('elt, 'id) t
    +
    val diff : ('value, 'id) t ->
    ('value, 'id) t -> ('value, 'id) t
    diff s0 s1
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    -      let s1 = ofArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +      let s1 = fromArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
           toArray (diff s0 s1) = [|6|];;
           toArray (diff s1 s0) = [|1;4|];;
         
    @@ -418,28 +362,24 @@

    Module Belt_Set

    -
    val subset : ('elt, 'id) t -> ('elt, 'id) t -> bool
    +
    val subset : ('value, 'id) t -> ('value, 'id) t -> bool
    subset s0 s1
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    -      let s1 = ofArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +      let s1 = fromArray ~id:(module IntCmp) [|5;2;3;1;5;4;|];;
           let s2 = intersect s0 s1;;
           subset s2 s0 = true;;
    -      subset s1 s0 = true;;
    -      subset s1 s2 = false;;
    +      subset s2 s1 = true;;
    +      subset s1 s0 = false;;
         
    -
    val cmp : ('elt, 'id) t -> ('elt, 'id) t -> int
    +
    val cmp : ('value, 'id) t -> ('value, 'id) t -> int
    Total ordering between sets. Can be used as the ordering function for doing sets of sets. @@ -451,7 +391,7 @@

    Module Belt_Set

    -
    val eq : ('elt, 'id) t -> ('elt, 'id) t -> bool
    +
    val eq : ('value, 'id) t -> ('value, 'id) t -> bool
    eq s0 s1
    Returns true if toArray s0 = toArray s1
    @@ -461,19 +401,15 @@

    Module Belt_Set

    -
    val forEachU : ('elt, 'id) t -> ('elt -> unit [@bs]) -> unit
    -
    val forEach : ('elt, 'id) t -> ('elt -> unit) -> unit
    +
    val forEachU : ('value, 'id) t -> ('value -> unit [@bs]) -> unit
    +
    val forEach : ('value, 'id) t -> ('value -> unit) -> unit
    forEach s f applies f in turn to all elements of s. In increasing order
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
           let acc = ref [] ;;
           forEach s0 (fun x -> acc := x !acc);;
           !acc = [6;5;3;2];;
    @@ -482,26 +418,22 @@ 

    Module Belt_Set

    -
    val reduceU : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a [@bs]) -> 'a
    -
    val reduce : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a) -> 'a
    +
    val reduceU : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a [@bs]) -> 'a
    +
    val reduce : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a) -> 'a
    In increasing order.
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
           reduce s0 [] Bs.List.add = [6;5;3;2];;
         
    -
    val everyU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val every : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val everyU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val every : ('value, 'id) t -> ('value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -511,8 +443,8 @@

    Module Belt_Set

    -
    val someU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val some : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val someU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val some : ('value, 'id) t -> ('value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p.
    @@ -522,8 +454,8 @@

    Module Belt_Set

    -
    val keepU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> ('elt, 'id) t
    -
    val keep : ('elt, 'id) t -> ('elt -> bool) -> ('elt, 'id) t
    +
    val keepU : ('value, 'id) t ->
    ('value -> bool [@bs]) -> ('value, 'id) t
    +
    val keep : ('value, 'id) t -> ('value -> bool) -> ('value, 'id) t
    keep m p returns the set of all elements in s that satisfy predicate p.
    @@ -533,8 +465,8 @@

    Module Belt_Set

    -
    val partitionU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) -> ('elt, 'id) t * ('elt, 'id) t
    -
    val partition : ('elt, 'id) t ->
    ('elt -> bool) -> ('elt, 'id) t * ('elt, 'id) t
    +
    val partitionU : ('value, 'id) t ->
    ('value -> bool [@bs]) -> ('value, 'id) t * ('value, 'id) t
    +
    val partition : ('value, 'id) t ->
    ('value -> bool) -> ('value, 'id) t * ('value, 'id) t
    partition m p returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -546,41 +478,33 @@

    Module Belt_Set

    -
    val size : ('elt, 'id) t -> int
    +
    val size : ('value, 'id) t -> int
    size s
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
           size s0 = 4;;
         
    -
    val toArray : ('elt, 'id) t -> 'elt array
    +
    val toArray : ('value, 'id) t -> 'value array
    toArray s0
    -
     
          module IntCmp =
    -        (val Belt.Id.comparableU
    -            ~cmp:(fun[@bs]
    -                   (x:int) y -> Pervasives.compare x y));;
    -      let s0 = ofArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
    +                    
     
          let s0 = fromArray ~id:(module IntCmp) [|5;2;3;5;6|]];;
           toArray s0 = [|2;3;5;6|];;
         
    -
    val toList : ('elt, 'id) t -> 'elt list
    +
    val toList : ('value, 'id) t -> 'value list
    In increasing order

    @@ -592,7 +516,7 @@

    Module Belt_Set

    -
    val minimum : ('elt, 'id) t -> 'elt option
    +
    val minimum : ('value, 'id) t -> 'value option
    minimum s0
    Returns the minimum element of the collection, None if it is empty
    @@ -602,7 +526,7 @@

    Module Belt_Set

    -
    val minUndefined : ('elt, 'id) t -> 'elt Js.undefined
    +
    val minUndefined : ('value, 'id) t -> 'value Js.undefined
    minUndefined s0
    Returns the minimum element of the collection, undefined if it is empty
    @@ -612,7 +536,7 @@

    Module Belt_Set

    -
    val maximum : ('elt, 'id) t -> 'elt option
    +
    val maximum : ('value, 'id) t -> 'value option
    maximum s0
    Returns the maximum element of the collection, None if it is empty
    @@ -622,7 +546,7 @@

    Module Belt_Set

    -
    val maxUndefined : ('elt, 'id) t -> 'elt Js.undefined
    +
    val maxUndefined : ('value, 'id) t -> 'value Js.undefined
    maxUndefined s0
    Returns the maximum element of the collection, undefined if it is empty
    @@ -632,7 +556,7 @@

    Module Belt_Set

    -
    val get : ('elt, 'id) t -> 'elt -> 'elt option
    +
    val get : ('value, 'id) t -> 'value -> 'value option
    get s0 k
    Returns the reference of the value k' which is equivalent to k @@ -644,7 +568,7 @@

    Module Belt_Set

    -
    val getUndefined : ('elt, 'id) t -> 'elt -> 'elt Js.undefined
    +
    val getUndefined : ('value, 'id) t -> 'value -> 'value Js.undefined
    See Belt_Set.get
    @@ -653,7 +577,7 @@

    Module Belt_Set

    -
    val getExn : ('elt, 'id) t -> 'elt -> 'elt
    +
    val getExn : ('value, 'id) t -> 'value -> 'value
    See Belt_Set.get

    @@ -665,7 +589,7 @@

    Module Belt_Set

    -
    val split : ('elt, 'id) t ->
    'elt -> (('elt, 'id) t * ('elt, 'id) t) * bool
    +
    val split : ('value, 'id) t ->
    'value -> (('value, 'id) t * ('value, 'id) t) * bool
    split set ele
    Returns a tuple ((smaller, larger), present), @@ -676,7 +600,7 @@

    Module Belt_Set

    -
    val getData : ('k, 'id) t -> ('k, 'id) Belt_SetDict.t
    +
    val getData : ('value, 'id) t -> ('value, 'id) Belt_SetDict.t
    getData s0

    @@ -691,7 +615,7 @@

    Module Belt_Set

    -
    val getId : ('k, 'id) t -> ('k, 'id) id
    +
    val getId : ('value, 'id) t -> ('value, 'id) id
    getId s0

    @@ -704,7 +628,7 @@

    Module Belt_Set

    -
    val packIdData : id:('k, 'id) id ->
    data:('k, 'id) Belt_SetDict.t -> ('k, 'id) t
    +
    val packIdData : id:('value, 'id) id ->
    data:('value, 'id) Belt_SetDict.t -> ('value, 'id) t
    packIdData ~id ~data

    @@ -716,4 +640,4 @@

    Module Belt_Set

    - + \ No newline at end of file diff --git a/docs/api/Belt_SetDict.html b/docs/api/Belt_SetDict.html index 0167a2610f..8edc4d53db 100644 --- a/docs/api/Belt_SetDict.html +++ b/docs/api/Belt_SetDict.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -115,9 +116,11 @@

    Module Belt_SetDict

    -
    val empty : ('elt, 'id) t
    +
    val empty : ('value, 'id) t
    val ofArray : 'k array -> cmp:('k, 'id) cmp -> ('k, 'id) t
    -
    val ofSortedArrayUnsafe : 'elt array -> ('elt, 'id) t
    +
    val ofSortedArrayUnsafe : 'value array -> ('value, 'id) t
    +
    val fromArray : 'k array -> cmp:('k, 'id) cmp -> ('k, 'id) t
    +
    val fromSortedArrayUnsafe : 'value array -> ('value, 'id) t
    val isEmpty : ('a, 'b) t -> bool
    val has : ('k, 'id) t -> 'k -> cmp:('k, 'id) cmp -> bool
    val add : ('k, 'id) t ->
    'k -> cmp:('k, 'id) cmp -> ('k, 'id) t
    @@ -129,8 +132,8 @@

    Module Belt_SetDict

    -
    val mergeMany : ('elt, 'id) t ->
    'elt array -> cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val remove : ('elt, 'id) t ->
    'elt -> cmp:('elt, 'id) cmp -> ('elt, 'id) t
    +
    val mergeMany : ('value, 'id) t ->
    'value array ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val remove : ('value, 'id) t ->
    'value -> cmp:('value, 'id) cmp -> ('value, 'id) t
    remove m x If x was not in m, m is returned reference unchanged.
    @@ -139,12 +142,12 @@

    Module Belt_SetDict

    -
    val removeMany : ('elt, 'id) t ->
    'elt array -> cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val union : ('elt, 'id) t ->
    ('elt, 'id) t ->
    cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val intersect : ('elt, 'id) t ->
    ('elt, 'id) t ->
    cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val diff : ('elt, 'id) t ->
    ('elt, 'id) t ->
    cmp:('elt, 'id) cmp -> ('elt, 'id) t
    -
    val subset : ('elt, 'id) t ->
    ('elt, 'id) t -> cmp:('elt, 'id) cmp -> bool
    -
    val cmp : ('elt, 'id) t ->
    ('elt, 'id) t -> cmp:('elt, 'id) cmp -> int
    +
    val removeMany : ('value, 'id) t ->
    'value array ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val union : ('value, 'id) t ->
    ('value, 'id) t ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val intersect : ('value, 'id) t ->
    ('value, 'id) t ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val diff : ('value, 'id) t ->
    ('value, 'id) t ->
    cmp:('value, 'id) cmp -> ('value, 'id) t
    +
    val subset : ('value, 'id) t ->
    ('value, 'id) t -> cmp:('value, 'id) cmp -> bool
    +
    val cmp : ('value, 'id) t ->
    ('value, 'id) t -> cmp:('value, 'id) cmp -> int
    Total ordering between sets. Can be used as the ordering function for doing sets of sets.
    @@ -154,9 +157,9 @@

    Module Belt_SetDict

    -
    val eq : ('elt, 'id) t ->
    ('elt, 'id) t -> cmp:('elt, 'id) cmp -> bool
    -
    val forEachU : ('elt, 'id) t -> ('elt -> unit [@bs]) -> unit
    -
    val forEach : ('elt, 'id) t -> ('elt -> unit) -> unit
    +
    val eq : ('value, 'id) t ->
    ('value, 'id) t -> cmp:('value, 'id) cmp -> bool
    +
    val forEachU : ('value, 'id) t -> ('value -> unit [@bs]) -> unit
    +
    val forEach : ('value, 'id) t -> ('value -> unit) -> unit
    forEach s f applies f in turn to all elements of s. In increasing order
    @@ -166,8 +169,8 @@

    Module Belt_SetDict

    -
    val reduceU : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a [@bs]) -> 'a
    -
    val reduce : ('elt, 'id) t -> 'a -> ('a -> 'elt -> 'a) -> 'a
    +
    val reduceU : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a [@bs]) -> 'a
    +
    val reduce : ('value, 'id) t -> 'a -> ('a -> 'value -> 'a) -> 'a
    In increasing order.
    @@ -176,8 +179,8 @@

    Module Belt_SetDict

    -
    val everyU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val every : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val everyU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val every : ('value, 'id) t -> ('value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified
    @@ -187,8 +190,8 @@

    Module Belt_SetDict

    -
    val someU : ('elt, 'id) t -> ('elt -> bool [@bs]) -> bool
    -
    val some : ('elt, 'id) t -> ('elt -> bool) -> bool
    +
    val someU : ('value, 'id) t -> ('value -> bool [@bs]) -> bool
    +
    val some : ('value, 'id) t -> ('value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p.
    @@ -198,8 +201,8 @@

    Module Belt_SetDict

    -
    val keepU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) -> ('elt, 'id) t
    -
    val keep : ('elt, 'id) t -> ('elt -> bool) -> ('elt, 'id) t
    +
    val keepU : ('value, 'id) t ->
    ('value -> bool [@bs]) -> ('value, 'id) t
    +
    val keep : ('value, 'id) t ->
    ('value -> bool) -> ('value, 'id) t
    keep m p returns the set of all elements in s that satisfy predicate p.
    @@ -209,8 +212,8 @@

    Module Belt_SetDict

    -
    val partitionU : ('elt, 'id) t ->
    ('elt -> bool [@bs]) ->
    ('elt, 'id) t * ('elt, 'id) t
    -
    val partition : ('elt, 'id) t ->
    ('elt -> bool) -> ('elt, 'id) t * ('elt, 'id) t
    +
    val partitionU : ('value, 'id) t ->
    ('value -> bool [@bs]) ->
    ('value, 'id) t * ('value, 'id) t
    +
    val partition : ('value, 'id) t ->
    ('value -> bool) ->
    ('value, 'id) t * ('value, 'id) t
    partition m p returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -222,8 +225,8 @@

    Module Belt_SetDict

    -
    val size : ('elt, 'id) t -> int
    -
    val toList : ('elt, 'id) t -> 'elt list
    +
    val size : ('value, 'id) t -> int
    +
    val toList : ('value, 'id) t -> 'value list
    In increasing order
    @@ -232,18 +235,18 @@

    Module Belt_SetDict

    -
    val toArray : ('elt, 'id) t -> 'elt array
    -
    val minimum : ('elt, 'id) t -> 'elt option
    -
    val minUndefined : ('elt, 'id) t -> 'elt Js.undefined
    -
    val maximum : ('elt, 'id) t -> 'elt option
    -
    val maxUndefined : ('elt, 'id) t -> 'elt Js.undefined
    -
    val get : ('elt, 'id) t ->
    'elt -> cmp:('elt, 'id) cmp -> 'elt option
    -
    val getUndefined : ('elt, 'id) t ->
    'elt -> cmp:('elt, 'id) cmp -> 'elt Js.undefined
    -
    val getExn : ('elt, 'id) t ->
    'elt -> cmp:('elt, 'id) cmp -> 'elt
    -
    val split : ('elt, 'id) t ->
    'elt ->
    cmp:('elt, 'id) cmp ->
    (('elt, 'id) t * ('elt, 'id) t) * bool
    +
    val toArray : ('value, 'id) t -> 'value array
    +
    val minimum : ('value, 'id) t -> 'value option
    +
    val minUndefined : ('value, 'id) t -> 'value Js.undefined
    +
    val maximum : ('value, 'id) t -> 'value option
    +
    val maxUndefined : ('value, 'id) t -> 'value Js.undefined
    +
    val get : ('value, 'id) t ->
    'value -> cmp:('value, 'id) cmp -> 'value option
    +
    val getUndefined : ('value, 'id) t ->
    'value -> cmp:('value, 'id) cmp -> 'value Js.undefined
    +
    val getExn : ('value, 'id) t ->
    'value -> cmp:('value, 'id) cmp -> 'value
    +
    val split : ('value, 'id) t ->
    'value ->
    cmp:('value, 'id) cmp ->
    (('value, 'id) t * ('value, 'id) t) * bool
    val checkInvariantInternal : ('a, 'b) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_SetInt.html b/docs/api/Belt_SetInt.html index 31c4624b32..0fd512a0d2 100644 --- a/docs/api/Belt_SetInt.html +++ b/docs/api/Belt_SetInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,8 +100,8 @@

    Module Belt_SetInt

    module Belt_SetInt: sig .. end
    - This module is Belt.Set specialized with key type to be a primitive type. - It is more efficient in general, the API is the same with Belt_Set except its key type is fixed, + 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)

    @@ -112,7 +113,7 @@

    Module Belt_SetInt


    -
    type elt = int 
    +
    type value = int 
    @@ -137,11 +138,13 @@

    Module Belt_SetInt

    val empty : t
    -
    val ofArray : elt array -> t
    -
    val ofSortedArrayUnsafe : elt array -> t
    +
    val ofArray : value array -> t
    +
    val ofSortedArrayUnsafe : value array -> t
    +
    val fromArray : value array -> t
    +
    val fromSortedArrayUnsafe : value array -> t
    val isEmpty : t -> bool
    -
    val has : t -> elt -> bool
    -
    val add : t -> elt -> t
    +
    val has : t -> value -> bool
    +
    val add : t -> value -> t
    If x was already in s, s is returned unchanged.
    @@ -150,8 +153,8 @@

    Module Belt_SetInt

    -
    val mergeMany : t -> elt array -> t
    -
    val remove : t -> elt -> t
    +
    val mergeMany : t -> value array -> t
    +
    val remove : t -> value -> t
    If x was not in s, s is returned unchanged.
    @@ -160,7 +163,7 @@

    Module Belt_SetInt

    -
    val removeMany : t -> elt array -> t
    +
    val removeMany : t -> value array -> t
    val union : t -> t -> t
    val intersect : t -> t -> t
    val diff : t -> t -> t
    @@ -194,8 +197,8 @@

    Module Belt_SetInt

    -
    val forEachU : t -> (elt -> unit [@bs]) -> unit
    -
    val forEach : t -> (elt -> unit) -> unit
    +
    val forEachU : t -> (value -> unit [@bs]) -> unit
    +
    val forEach : t -> (value -> unit) -> unit
    In increasing order
    @@ -204,8 +207,8 @@

    Module Belt_SetInt

    -
    val reduceU : t -> 'a -> ('a -> elt -> 'a [@bs]) -> 'a
    -
    val reduce : t -> 'a -> ('a -> elt -> 'a) -> 'a
    +
    val reduceU : t -> 'a -> ('a -> value -> 'a [@bs]) -> 'a
    +
    val reduce : t -> 'a -> ('a -> value -> 'a) -> 'a
    Iterate in increasing order.
    @@ -214,8 +217,8 @@

    Module Belt_SetInt

    -
    val everyU : t -> (elt -> bool [@bs]) -> bool
    -
    val every : t -> (elt -> bool) -> bool
    +
    val everyU : t -> (value -> bool [@bs]) -> bool
    +
    val every : t -> (value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -225,8 +228,8 @@

    Module Belt_SetInt

    -
    val someU : t -> (elt -> bool [@bs]) -> bool
    -
    val some : t -> (elt -> bool) -> bool
    +
    val someU : t -> (value -> bool [@bs]) -> bool
    +
    val some : t -> (value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p. Oder unspecified.
    @@ -236,8 +239,8 @@

    Module Belt_SetInt

    -
    val keepU : t -> (elt -> bool [@bs]) -> t
    -
    val keep : t -> (elt -> bool) -> t
    +
    val keepU : t -> (value -> bool [@bs]) -> t
    +
    val keep : t -> (value -> bool) -> t
    keep p s returns the set of all elements in s that satisfy predicate p.
    @@ -247,8 +250,8 @@

    Module Belt_SetInt

    -
    val partitionU : t ->
    (elt -> bool [@bs]) -> t * t
    -
    val partition : t -> (elt -> bool) -> t * t
    +
    val partitionU : t ->
    (value -> bool [@bs]) -> t * t
    +
    val partition : t -> (value -> bool) -> t * t
    partition p s returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -261,7 +264,7 @@

    Module Belt_SetInt

    val size : t -> int
    -
    val toList : t -> elt list
    +
    val toList : t -> value list
    In increasing order with respect
    @@ -270,15 +273,15 @@

    Module Belt_SetInt

    -
    val toArray : t -> elt array
    -
    val minimum : t -> elt option
    -
    val minUndefined : t -> elt Js.undefined
    -
    val maximum : t -> elt option
    -
    val maxUndefined : t -> elt Js.undefined
    -
    val get : t -> elt -> elt option
    -
    val getUndefined : t -> elt -> elt Js.undefined
    -
    val getExn : t -> elt -> elt
    -
    val split : t -> elt -> (t * t) * bool
    +
    val toArray : t -> value array
    +
    val minimum : t -> value option
    +
    val minUndefined : t -> value Js.undefined
    +
    val maximum : t -> value option
    +
    val maxUndefined : t -> value Js.undefined
    +
    val get : t -> value -> value option
    +
    val getUndefined : t -> value -> value Js.undefined
    +
    val getExn : t -> value -> value
    +
    val split : t -> value -> (t * t) * bool
    split x s returns a triple (l, present, r), where l is the set of elements of s that are @@ -295,7 +298,7 @@

    Module Belt_SetInt

    val checkInvariantInternal : t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_SetString.html b/docs/api/Belt_SetString.html index 398978e957..5dceb5de6d 100644 --- a/docs/api/Belt_SetString.html +++ b/docs/api/Belt_SetString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,8 +100,8 @@

    Module Belt_SetString

    module Belt_SetString: sig .. end
    - This module is Belt.Set specialized with key type to be a primitive type. - It is more efficient in general, the API is the same with Belt_Set except its key type is fixed, + 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)

    @@ -112,7 +113,7 @@

    Module Belt_SetString


    -
    type elt = string 
    +
    type value = string 
    @@ -137,11 +138,13 @@

    Module Belt_SetString

    val empty : t
    -
    val ofArray : elt array -> t
    -
    val ofSortedArrayUnsafe : elt array -> t
    +
    val ofArray : value array -> t
    +
    val ofSortedArrayUnsafe : value array -> t
    +
    val fromArray : value array -> t
    +
    val fromSortedArrayUnsafe : value array -> t
    val isEmpty : t -> bool
    -
    val has : t -> elt -> bool
    -
    val add : t -> elt -> t
    +
    val has : t -> value -> bool
    +
    val add : t -> value -> t
    If x was already in s, s is returned unchanged.
    @@ -150,8 +153,8 @@

    Module Belt_SetString

    -
    val mergeMany : t -> elt array -> t
    -
    val remove : t -> elt -> t
    +
    val mergeMany : t -> value array -> t
    +
    val remove : t -> value -> t
    If x was not in s, s is returned unchanged.
    @@ -160,7 +163,7 @@

    Module Belt_SetString

    -
    val removeMany : t -> elt array -> t
    +
    val removeMany : t -> value array -> t
    val union : t -> t -> t
    val intersect : t -> t -> t
    val diff : t -> t -> t
    @@ -194,8 +197,8 @@

    Module Belt_SetString

    -
    val forEachU : t -> (elt -> unit [@bs]) -> unit
    -
    val forEach : t -> (elt -> unit) -> unit
    +
    val forEachU : t -> (value -> unit [@bs]) -> unit
    +
    val forEach : t -> (value -> unit) -> unit
    In increasing order
    @@ -204,8 +207,8 @@

    Module Belt_SetString

    -
    val reduceU : t -> 'a -> ('a -> elt -> 'a [@bs]) -> 'a
    -
    val reduce : t -> 'a -> ('a -> elt -> 'a) -> 'a
    +
    val reduceU : t -> 'a -> ('a -> value -> 'a [@bs]) -> 'a
    +
    val reduce : t -> 'a -> ('a -> value -> 'a) -> 'a
    Iterate in increasing order.
    @@ -214,8 +217,8 @@

    Module Belt_SetString

    -
    val everyU : t -> (elt -> bool [@bs]) -> bool
    -
    val every : t -> (elt -> bool) -> bool
    +
    val everyU : t -> (value -> bool [@bs]) -> bool
    +
    val every : t -> (value -> bool) -> bool
    every p s checks if all elements of the set satisfy the predicate p. Order unspecified.
    @@ -225,8 +228,8 @@

    Module Belt_SetString

    -
    val someU : t -> (elt -> bool [@bs]) -> bool
    -
    val some : t -> (elt -> bool) -> bool
    +
    val someU : t -> (value -> bool [@bs]) -> bool
    +
    val some : t -> (value -> bool) -> bool
    some p s checks if at least one element of the set satisfies the predicate p. Oder unspecified.
    @@ -236,8 +239,8 @@

    Module Belt_SetString

    -
    val keepU : t -> (elt -> bool [@bs]) -> t
    -
    val keep : t -> (elt -> bool) -> t
    +
    val keepU : t -> (value -> bool [@bs]) -> t
    +
    val keep : t -> (value -> bool) -> t
    keep p s returns the set of all elements in s that satisfy predicate p.
    @@ -247,8 +250,8 @@

    Module Belt_SetString

    -
    val partitionU : t ->
    (elt -> bool [@bs]) -> t * t
    -
    val partition : t ->
    (elt -> bool) -> t * t
    +
    val partitionU : t ->
    (value -> bool [@bs]) -> t * t
    +
    val partition : t ->
    (value -> bool) -> t * t
    partition p s returns a pair of sets (s1, s2), where s1 is the set of all the elements of s that satisfy the @@ -261,7 +264,7 @@

    Module Belt_SetString

    val size : t -> int
    -
    val toList : t -> elt list
    +
    val toList : t -> value list
    In increasing order with respect
    @@ -270,15 +273,15 @@

    Module Belt_SetString

    -
    val toArray : t -> elt array
    -
    val minimum : t -> elt option
    -
    val minUndefined : t -> elt Js.undefined
    -
    val maximum : t -> elt option
    -
    val maxUndefined : t -> elt Js.undefined
    -
    val get : t -> elt -> elt option
    -
    val getUndefined : t -> elt -> elt Js.undefined
    -
    val getExn : t -> elt -> elt
    -
    val split : t ->
    elt -> (t * t) * bool
    +
    val toArray : t -> value array
    +
    val minimum : t -> value option
    +
    val minUndefined : t -> value Js.undefined
    +
    val maximum : t -> value option
    +
    val maxUndefined : t -> value Js.undefined
    +
    val get : t -> value -> value option
    +
    val getUndefined : t -> value -> value Js.undefined
    +
    val getExn : t -> value -> value
    +
    val split : t ->
    value -> (t * t) * bool
    split x s returns a triple (l, present, r), where l is the set of elements of s that are @@ -295,7 +298,7 @@

    Module Belt_SetString

    val checkInvariantInternal : t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    diff --git a/docs/api/Belt_SortArray.Int.html b/docs/api/Belt_SortArray.Int.html index b64d092741..08214a3eeb 100644 --- a/docs/api/Belt_SortArray.Int.html +++ b/docs/api/Belt_SortArray.Int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_SortArray.String.html b/docs/api/Belt_SortArray.String.html index ffb71075e7..d41439fc55 100644 --- a/docs/api/Belt_SortArray.String.html +++ b/docs/api/Belt_SortArray.String.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_SortArray.html b/docs/api/Belt_SortArray.html index 10ed4367ee..536f92a872 100644 --- a/docs/api/Belt_SortArray.html +++ b/docs/api/Belt_SortArray.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_SortArrayInt.html b/docs/api/Belt_SortArrayInt.html index 5673db0b00..fc9d5583bb 100644 --- a/docs/api/Belt_SortArrayInt.html +++ b/docs/api/Belt_SortArrayInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_SortArrayString.html b/docs/api/Belt_SortArrayString.html index ba8361b895..db2e6a5a62 100644 --- a/docs/api/Belt_SortArrayString.html +++ b/docs/api/Belt_SortArrayString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalAVLset.html b/docs/api/Belt_internalAVLset.html index fb6bca8012..3024b2f704 100644 --- a/docs/api/Belt_internalAVLset.html +++ b/docs/api/Belt_internalAVLset.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,7 +100,7 @@

    Module Belt_internalAVLset

    module Belt_internalAVLset: sig .. end
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -151,7 +152,7 @@

    Module Belt_internalAVLset

    val toList : 'a t -> 'a list
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -160,9 +161,9 @@

    Module Belt_internalAVLset

    val fillArray : 'a node -> int -> 'a array -> int
    val toArray : 'a t -> 'a array
    -
    val ofSortedArrayAux : 'a array -> int -> int -> 'a t
    -
    val ofSortedArrayRevAux : 'a array -> int -> int -> 'a t
    -
    val ofSortedArrayUnsafe : 'a array -> 'a t
    +
    val fromSortedArrayAux : 'a array -> int -> int -> 'a t
    +
    val fromSortedArrayRevAux : 'a array -> int -> int -> 'a t
    +
    val fromSortedArrayUnsafe : 'a array -> 'a t
    val has : 'a t -> 'a -> cmp:('a, 'b) cmp -> bool
    val cmp : 'a t -> 'a t -> cmp:('a, 'b) cmp -> int
    val eq : 'a t -> 'a t -> cmp:('a, 'b) cmp -> bool
    @@ -170,7 +171,7 @@

    Module Belt_internalAVLset

    val get : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a option
    val getUndefined : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a Js.undefined
    val getExn : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a
    -
    val ofArray : 'a array -> cmp:('a, 'b) cmp -> 'a t
    +
    val fromArray : 'a array -> cmp:('a, 'b) cmp -> 'a t
    val addMutate : cmp:('a, 'b) cmp -> 'a t -> 'a -> 'a t
    val balMutate : 'a node -> 'a node
    val removeMinAuxWithRootMutate : 'a node -> 'a node -> 'a t
    \ No newline at end of file diff --git a/docs/api/Belt_internalAVLtree.html b/docs/api/Belt_internalAVLtree.html index dfdacc3fa1..8a5fb3e550 100644 --- a/docs/api/Belt_internalAVLtree.html +++ b/docs/api/Belt_internalAVLtree.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,7 +100,7 @@

    Module Belt_internalAVLtree

    module Belt_internalAVLtree: sig .. end
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -159,7 +160,7 @@

    Module Belt_internalAVLtree

    val toList : ('a, 'b) t -> ('a * 'b) list
    val checkInvariantInternal : ('a, 'b) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -170,9 +171,9 @@

    Module Belt_internalAVLtree

    val toArray : ('a, 'b) t -> ('a * 'b) array
    val keysToArray : ('a, 'b) t -> 'a array
    val valuesToArray : ('a, 'b) t -> 'b array
    -
    val ofSortedArrayAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    -
    val ofSortedArrayRevAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    -
    val ofSortedArrayUnsafe : ('a * 'b) array -> ('a, 'b) t
    +
    val fromSortedArrayAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    +
    val fromSortedArrayRevAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    +
    val fromSortedArrayUnsafe : ('a * 'b) array -> ('a, 'b) t
    val cmpU : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd) cmp -> vcmp:('b -> 'c -> int [@bs]) -> int
    val cmp : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd) cmp -> vcmp:('b -> 'c -> int) -> int
    val eqU : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd) cmp ->
    veq:('b -> 'c -> bool [@bs]) -> bool
    @@ -182,7 +183,7 @@

    Module Belt_internalAVLtree

    val getWithDefault : ('a, 'b) t -> 'a -> 'b -> cmp:('a, 'c) cmp -> 'b
    val getExn : ('a, 'b) t -> 'a -> cmp:('a, 'c) cmp -> 'b
    val has : ('a, 'b) t -> 'a -> cmp:('a, 'c) cmp -> bool
    -
    val ofArray : ('a * 'b) array -> cmp:('a, 'id) cmp -> ('a, 'b) t
    +
    val fromArray : ('a * 'b) array -> cmp:('a, 'id) cmp -> ('a, 'b) t
    val updateMutate : ('a, 'b) t ->
    'a -> 'b -> cmp:('a, 'id) cmp -> ('a, 'b) t
    val balMutate : ('a, 'b) node -> ('a, 'b) node
    val removeMinAuxWithRootMutate : ('a, 'b) node -> ('a, 'b) node -> ('a, 'b) t
    \ No newline at end of file diff --git a/docs/api/Belt_internalBuckets.C.html b/docs/api/Belt_internalBuckets.C.html index 2a6040f043..6611240586 100644 --- a/docs/api/Belt_internalBuckets.C.html +++ b/docs/api/Belt_internalBuckets.C.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalBuckets.html b/docs/api/Belt_internalBuckets.html index 1ca941dac8..766e673576 100644 --- a/docs/api/Belt_internalBuckets.html +++ b/docs/api/Belt_internalBuckets.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalBucketsType.html b/docs/api/Belt_internalBucketsType.html index b7677d836b..d102aefcee 100644 --- a/docs/api/Belt_internalBucketsType.html +++ b/docs/api/Belt_internalBucketsType.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalMapInt.A.html b/docs/api/Belt_internalMapInt.A.html index d2fa907ada..3683b4bfa9 100644 --- a/docs/api/Belt_internalMapInt.A.html +++ b/docs/api/Belt_internalMapInt.A.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalMapInt.N.html b/docs/api/Belt_internalMapInt.N.html index 8600532f11..05bbe2712c 100644 --- a/docs/api/Belt_internalMapInt.N.html +++ b/docs/api/Belt_internalMapInt.N.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -150,7 +151,7 @@

    Module Belt_internalMapInt.Nval toList : ('a, 'b) t -> ('a * 'b) list
    val checkInvariantInternal : ('a, 'b) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -161,9 +162,9 @@

    Module Belt_internalMapInt.Nval toArray : ('a, 'b) t -> ('a * 'b) array
    val keysToArray : ('a, 'b) t -> 'a array
    val valuesToArray : ('a, 'b) t -> 'b array
    -
    val ofSortedArrayAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    -
    val ofSortedArrayRevAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    -
    val ofSortedArrayUnsafe : ('a * 'b) array -> ('a, 'b) t
    +
    val fromSortedArrayAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    +
    val fromSortedArrayRevAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    +
    val fromSortedArrayUnsafe : ('a * 'b) array -> ('a, 'b) t
    val cmpU : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd) cmp -> vcmp:('b -> 'c -> int [@bs]) -> int
    val cmp : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd) cmp -> vcmp:('b -> 'c -> int) -> int
    val eqU : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd) cmp ->
    veq:('b -> 'c -> bool [@bs]) -> bool
    @@ -173,7 +174,7 @@

    Module Belt_internalMapInt.Nval getWithDefault : ('a, 'b) t -> 'a -> 'b -> cmp:('a, 'c) cmp -> 'b
    val getExn : ('a, 'b) t -> 'a -> cmp:('a, 'c) cmp -> 'b
    val has : ('a, 'b) t -> 'a -> cmp:('a, 'c) cmp -> bool
    -
    val ofArray : ('a * 'b) array -> cmp:('a, 'id) cmp -> ('a, 'b) t
    +
    val fromArray : ('a * 'b) array -> cmp:('a, 'id) cmp -> ('a, 'b) t
    val updateMutate : ('a, 'b) t ->
    'a -> 'b -> cmp:('a, 'id) cmp -> ('a, 'b) t
    val balMutate : ('a, 'b) node -> ('a, 'b) node
    val removeMinAuxWithRootMutate : ('a, 'b) node -> ('a, 'b) node -> ('a, 'b) t
    \ No newline at end of file diff --git a/docs/api/Belt_internalMapInt.S.html b/docs/api/Belt_internalMapInt.S.html index d42da9cd09..da4d032611 100644 --- a/docs/api/Belt_internalMapInt.S.html +++ b/docs/api/Belt_internalMapInt.S.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalMapInt.html b/docs/api/Belt_internalMapInt.html index f5b70a2c9b..dfd024c6aa 100644 --- a/docs/api/Belt_internalMapInt.html +++ b/docs/api/Belt_internalMapInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -140,4 +141,4 @@

    Module Belt_internalMapInt

    val eqU : (key, 'a) N.t ->
    (key, 'b) N.t -> ('a -> 'b -> bool [@bs]) -> bool
    val eq : (key, 'a) N.t ->
    (key, 'b) N.t -> ('a -> 'b -> bool) -> bool
    val addMutate : 'a t ->
    key -> 'a -> 'a t
    -
    val ofArray : (key * 'a) array -> (key, 'a) N.t
    \ No newline at end of file +
    val fromArray : (key * 'a) array -> (key, 'a) N.t
    \ No newline at end of file diff --git a/docs/api/Belt_internalMapString.A.html b/docs/api/Belt_internalMapString.A.html index bee79c4c75..fa3aabcb40 100644 --- a/docs/api/Belt_internalMapString.A.html +++ b/docs/api/Belt_internalMapString.A.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalMapString.N.html b/docs/api/Belt_internalMapString.N.html index 34204b6269..7cd0d7afcd 100644 --- a/docs/api/Belt_internalMapString.N.html +++ b/docs/api/Belt_internalMapString.N.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -150,7 +151,7 @@

    Module Belt_internalMapString.N
    val toList : ('a, 'b) t -> ('a * 'b) list
    val checkInvariantInternal : ('a, 'b) t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -161,9 +162,9 @@

    Module Belt_internalMapString.N
    val toArray : ('a, 'b) t -> ('a * 'b) array
    val keysToArray : ('a, 'b) t -> 'a array
    val valuesToArray : ('a, 'b) t -> 'b array
    -
    val ofSortedArrayAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    -
    val ofSortedArrayRevAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    -
    val ofSortedArrayUnsafe : ('a * 'b) array -> ('a, 'b) t
    +
    val fromSortedArrayAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    +
    val fromSortedArrayRevAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    +
    val fromSortedArrayUnsafe : ('a * 'b) array -> ('a, 'b) t
    val cmpU : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd)
    cmp -> vcmp:('b -> 'c -> int [@bs]) -> int
    val cmp : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd) cmp -> vcmp:('b -> 'c -> int) -> int
    val eqU : ('a, 'b) t ->
    ('a, 'c) t ->
    kcmp:('a, 'd) cmp ->
    veq:('b -> 'c -> bool [@bs]) -> bool
    @@ -173,7 +174,7 @@

    Module Belt_internalMapString.N
    val getWithDefault : ('a, 'b) t -> 'a -> 'b -> cmp:('a, 'c) cmp -> 'b
    val getExn : ('a, 'b) t -> 'a -> cmp:('a, 'c) cmp -> 'b
    val has : ('a, 'b) t -> 'a -> cmp:('a, 'c) cmp -> bool
    -
    val ofArray : ('a * 'b) array -> cmp:('a, 'id) cmp -> ('a, 'b) t
    +
    val fromArray : ('a * 'b) array -> cmp:('a, 'id) cmp -> ('a, 'b) t
    val updateMutate : ('a, 'b) t ->
    'a -> 'b -> cmp:('a, 'id) cmp -> ('a, 'b) t
    val balMutate : ('a, 'b) node -> ('a, 'b) node
    val removeMinAuxWithRootMutate : ('a, 'b) node -> ('a, 'b) node -> ('a, 'b) t
    \ No newline at end of file diff --git a/docs/api/Belt_internalMapString.S.html b/docs/api/Belt_internalMapString.S.html index 005afd4938..401b61fdd7 100644 --- a/docs/api/Belt_internalMapString.S.html +++ b/docs/api/Belt_internalMapString.S.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalMapString.html b/docs/api/Belt_internalMapString.html index 7a5e8dd772..a68b7852dd 100644 --- a/docs/api/Belt_internalMapString.html +++ b/docs/api/Belt_internalMapString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -140,4 +141,4 @@

    Module Belt_internalMapString
    val eqU : (key, 'a) N.t ->
    (key, 'b) N.t -> ('a -> 'b -> bool [@bs]) -> bool
    val eq : (key, 'a) N.t ->
    (key, 'b) N.t -> ('a -> 'b -> bool) -> bool
    val addMutate : 'a t ->
    key -> 'a -> 'a t
    -
    val ofArray : (key * 'a) array ->
    (key, 'a) N.t
    \ No newline at end of file +
    val fromArray : (key * 'a) array ->
    (key, 'a) N.t
    \ No newline at end of file diff --git a/docs/api/Belt_internalMutableAVLMap.html b/docs/api/Belt_internalMutableAVLMap.html index 914a0a0e2a..0fc7baa509 100644 --- a/docs/api/Belt_internalMutableAVLMap.html +++ b/docs/api/Belt_internalMutableAVLMap.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalSetBuckets.C.html b/docs/api/Belt_internalSetBuckets.C.html index 749cab1381..b93a989770 100644 --- a/docs/api/Belt_internalSetBuckets.C.html +++ b/docs/api/Belt_internalSetBuckets.C.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalSetBuckets.html b/docs/api/Belt_internalSetBuckets.html index cd3a234474..b8f25a02ee 100644 --- a/docs/api/Belt_internalSetBuckets.html +++ b/docs/api/Belt_internalSetBuckets.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalSetInt.A.html b/docs/api/Belt_internalSetInt.A.html index 1f8c1d89e3..d7731b7035 100644 --- a/docs/api/Belt_internalSetInt.A.html +++ b/docs/api/Belt_internalSetInt.A.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalSetInt.N.html b/docs/api/Belt_internalSetInt.N.html index 5a981a2abc..57920be23e 100644 --- a/docs/api/Belt_internalSetInt.N.html +++ b/docs/api/Belt_internalSetInt.N.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -143,7 +144,7 @@

    Module Belt_internalSetInt.Nval toList : 'a t -> 'a list
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -152,9 +153,9 @@

    Module Belt_internalSetInt.Nval fillArray : 'a node -> int -> 'a array -> int
    val toArray : 'a t -> 'a array
    -
    val ofSortedArrayAux : 'a array -> int -> int -> 'a t
    -
    val ofSortedArrayRevAux : 'a array -> int -> int -> 'a t
    -
    val ofSortedArrayUnsafe : 'a array -> 'a t
    +
    val fromSortedArrayAux : 'a array -> int -> int -> 'a t
    +
    val fromSortedArrayRevAux : 'a array -> int -> int -> 'a t
    +
    val fromSortedArrayUnsafe : 'a array -> 'a t
    val has : 'a t -> 'a -> cmp:('a, 'b) cmp -> bool
    val cmp : 'a t -> 'a t -> cmp:('a, 'b) cmp -> int
    val eq : 'a t -> 'a t -> cmp:('a, 'b) cmp -> bool
    @@ -162,7 +163,7 @@

    Module Belt_internalSetInt.Nval get : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a option
    val getUndefined : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a Js.undefined
    val getExn : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a
    -
    val ofArray : 'a array -> cmp:('a, 'b) cmp -> 'a t
    +
    val fromArray : 'a array -> cmp:('a, 'b) cmp -> 'a t
    val addMutate : cmp:('a, 'b) cmp -> 'a t -> 'a -> 'a t
    val balMutate : 'a node -> 'a node
    val removeMinAuxWithRootMutate : 'a node -> 'a node -> 'a t
    \ No newline at end of file diff --git a/docs/api/Belt_internalSetInt.S.html b/docs/api/Belt_internalSetInt.S.html index dd300c4f4d..04507d0f4e 100644 --- a/docs/api/Belt_internalSetInt.S.html +++ b/docs/api/Belt_internalSetInt.S.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalSetInt.html b/docs/api/Belt_internalSetInt.html index 267d55b2f7..9aeae31ce9 100644 --- a/docs/api/Belt_internalSetInt.html +++ b/docs/api/Belt_internalSetInt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,7 +100,7 @@

    Module Belt_internalSetInt

    module Belt_internalSetInt: sig .. end

    -
    type elt = int 
    +
    type value = int 
    @@ -118,17 +119,17 @@

    Module Belt_internalSetInt

    -
    type t = elt N.t 
    +
    type t = value N.t 
    -
    val has : t -> elt -> bool
    -
    val compareAux : elt N.node list ->
    elt N.node list -> int
    -
    val cmp : elt N.t -> elt N.t -> int
    -
    val eq : t -> elt N.t -> bool
    +
    val has : t -> value -> bool
    +
    val compareAux : value N.node list ->
    value N.node list -> int
    +
    val cmp : value N.t -> value N.t -> int
    +
    val eq : t -> value N.t -> bool
    val subset : t -> t -> bool
    -
    val get : t ->
    elt -> elt option
    -
    val getUndefined : t ->
    elt -> elt Js.Undefined.t
    -
    val getExn : t -> elt -> elt
    -
    val addMutate : elt N.t ->
    elt -> elt N.t
    -
    val ofArray : elt array -> elt N.t
    \ No newline at end of file +
    val get : t ->
    value -> value option
    +
    val getUndefined : t ->
    value -> value Js.Undefined.t
    +
    val getExn : t ->
    value -> value
    +
    val addMutate : value N.t ->
    value -> value N.t
    +
    val fromArray : value array -> value N.t
    \ No newline at end of file diff --git a/docs/api/Belt_internalSetString.A.html b/docs/api/Belt_internalSetString.A.html index beb21d4198..4c88a29461 100644 --- a/docs/api/Belt_internalSetString.A.html +++ b/docs/api/Belt_internalSetString.A.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalSetString.N.html b/docs/api/Belt_internalSetString.N.html index fc39d90f1e..d41fe51792 100644 --- a/docs/api/Belt_internalSetString.N.html +++ b/docs/api/Belt_internalSetString.N.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -143,7 +144,7 @@

    Module Belt_internalSetString.N
    val toList : 'a t -> 'a list
    val checkInvariantInternal : 'a t -> unit
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -152,9 +153,9 @@

    Module Belt_internalSetString.N
    val fillArray : 'a node -> int -> 'a array -> int
    val toArray : 'a t -> 'a array
    -
    val ofSortedArrayAux : 'a array -> int -> int -> 'a t
    -
    val ofSortedArrayRevAux : 'a array -> int -> int -> 'a t
    -
    val ofSortedArrayUnsafe : 'a array -> 'a t
    +
    val fromSortedArrayAux : 'a array -> int -> int -> 'a t
    +
    val fromSortedArrayRevAux : 'a array -> int -> int -> 'a t
    +
    val fromSortedArrayUnsafe : 'a array -> 'a t
    val has : 'a t -> 'a -> cmp:('a, 'b) cmp -> bool
    val cmp : 'a t -> 'a t -> cmp:('a, 'b) cmp -> int
    val eq : 'a t -> 'a t -> cmp:('a, 'b) cmp -> bool
    @@ -162,7 +163,7 @@

    Module Belt_internalSetString.N
    val get : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a option
    val getUndefined : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a Js.undefined
    val getExn : 'a t -> 'a -> cmp:('a, 'b) cmp -> 'a
    -
    val ofArray : 'a array -> cmp:('a, 'b) cmp -> 'a t
    +
    val fromArray : 'a array -> cmp:('a, 'b) cmp -> 'a t
    val addMutate : cmp:('a, 'b) cmp -> 'a t -> 'a -> 'a t
    val balMutate : 'a node -> 'a node
    val removeMinAuxWithRootMutate : 'a node -> 'a node -> 'a t
    \ No newline at end of file diff --git a/docs/api/Belt_internalSetString.S.html b/docs/api/Belt_internalSetString.S.html index 183e4ee00d..803ef6bf3d 100644 --- a/docs/api/Belt_internalSetString.S.html +++ b/docs/api/Belt_internalSetString.S.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Belt_internalSetString.html b/docs/api/Belt_internalSetString.html index 8a8c851f88..2510ba1f9b 100644 --- a/docs/api/Belt_internalSetString.html +++ b/docs/api/Belt_internalSetString.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -99,7 +100,7 @@

    Module Belt_internalSetString
    module Belt_internalSetString: sig .. end

    -
    type elt = string 
    +
    type value = string 
    @@ -118,17 +119,17 @@

    Module Belt_internalSetString

    -
    type t = elt N.t 
    +
    type t = value N.t 
    -
    val has : t -> elt -> bool
    -
    val compareAux : elt N.node list ->
    elt N.node list -> int
    -
    val cmp : elt N.t -> elt N.t -> int
    -
    val eq : t -> elt N.t -> bool
    +
    val has : t -> value -> bool
    +
    val compareAux : value N.node list ->
    value N.node list -> int
    +
    val cmp : value N.t -> value N.t -> int
    +
    val eq : t -> value N.t -> bool
    val subset : t -> t -> bool
    -
    val get : t ->
    elt -> elt option
    -
    val getUndefined : t ->
    elt -> elt Js.Undefined.t
    -
    val getExn : t ->
    elt -> elt
    -
    val addMutate : elt N.t ->
    elt -> elt N.t
    -
    val ofArray : elt array -> elt N.t
    \ No newline at end of file +
    val get : t ->
    value -> value option
    +
    val getUndefined : t ->
    value -> value Js.Undefined.t
    +
    val getExn : t ->
    value -> value
    +
    val addMutate : value N.t ->
    value -> value N.t
    +
    val fromArray : value array -> value N.t
    \ No newline at end of file diff --git a/docs/api/Dom.Storage.html b/docs/api/Dom.Storage.html index 84a7a3c939..96173e43fd 100644 --- a/docs/api/Dom.Storage.html +++ b/docs/api/Dom.Storage.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Dom.html b/docs/api/Dom.html index 0ad2b13795..a3258dc409 100644 --- a/docs/api/Dom.html +++ b/docs/api/Dom.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Dom_storage.html b/docs/api/Dom_storage.html index 3db11f8669..b019902a74 100644 --- a/docs/api/Dom_storage.html +++ b/docs/api/Dom_storage.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Array.html b/docs/api/Js.Array.html index 3404fea4d4..22312f3a83 100644 --- a/docs/api/Js.Array.html +++ b/docs/api/Js.Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Boolean.html b/docs/api/Js.Boolean.html index d396343c71..98cc2ea227 100644 --- a/docs/api/Js.Boolean.html +++ b/docs/api/Js.Boolean.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Console.html b/docs/api/Js.Console.html index d2c994ac60..eb29bb6b7a 100644 --- a/docs/api/Js.Console.html +++ b/docs/api/Js.Console.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Date.html b/docs/api/Js.Date.html index 5369702005..c2247a94ed 100644 --- a/docs/api/Js.Date.html +++ b/docs/api/Js.Date.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Dict.html b/docs/api/Js.Dict.html index aa214fef44..df07a4cfcb 100644 --- a/docs/api/Js.Dict.html +++ b/docs/api/Js.Dict.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Exn.html b/docs/api/Js.Exn.html index b1b1cd3475..80f4a73f35 100644 --- a/docs/api/Js.Exn.html +++ b/docs/api/Js.Exn.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Float.html b/docs/api/Js.Float.html index 0ce4b9e000..5dd8b6dc98 100644 --- a/docs/api/Js.Float.html +++ b/docs/api/Js.Float.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Global.html b/docs/api/Js.Global.html index 6719d48b2f..ec773f39a1 100644 --- a/docs/api/Js.Global.html +++ b/docs/api/Js.Global.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Int.html b/docs/api/Js.Int.html index 6ced65fb28..ef43dd5906 100644 --- a/docs/api/Js.Int.html +++ b/docs/api/Js.Int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Json.html b/docs/api/Js.Json.html index 6ea1dbc6cc..4892182a11 100644 --- a/docs/api/Js.Json.html +++ b/docs/api/Js.Json.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.List.html b/docs/api/Js.List.html index b857902e65..33bfe84779 100644 --- a/docs/api/Js.List.html +++ b/docs/api/Js.List.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Math.html b/docs/api/Js.Math.html index cfcf258a10..5bb5de2892 100644 --- a/docs/api/Js.Math.html +++ b/docs/api/Js.Math.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Null.html b/docs/api/Js.Null.html index a9bb7fbdcf..54700e0c46 100644 --- a/docs/api/Js.Null.html +++ b/docs/api/Js.Null.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -213,4 +214,5 @@

    Module Js.Null

    - \ No newline at end of file + +
    val to_opt : 'a t -> 'a option
    \ No newline at end of file diff --git a/docs/api/Js.Null_undefined.html b/docs/api/Js.Null_undefined.html index ca6f11b2ef..e2e7fec71b 100644 --- a/docs/api/Js.Null_undefined.html +++ b/docs/api/Js.Null_undefined.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -181,7 +182,7 @@

    Module Js.Null_undefined

    -
    val from_opt : 'a option -> 'a t
    +
    val fromOption : 'a option -> 'a t
    Maps 'a option to 'a Js.null_undefined

    @@ -197,7 +198,8 @@

    Module Js.Null_undefined

    -
    val to_opt : 'a t -> 'a option
    +
    val from_opt : 'a option -> 'a t
    +
    val toOption : 'a t -> 'a option
    Maps 'a Js.null_undefined to 'a option

    @@ -213,4 +215,5 @@

    Module Js.Null_undefined

    - \ No newline at end of file + +
    val to_opt : 'a t -> 'a option
    \ No newline at end of file diff --git a/docs/api/Js.Nullable.html b/docs/api/Js.Nullable.html index f67d039602..b5b26bbb18 100644 --- a/docs/api/Js.Nullable.html +++ b/docs/api/Js.Nullable.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -189,7 +190,7 @@

    Module Js.Nullable

    -
    val from_opt : 'a option -> 'a t
    +
    val fromOption : 'a option -> 'a t
    Maps 'a option to 'a Js.null_undefined

    @@ -205,7 +206,8 @@

    Module Js.Nullable

    -
    val to_opt : 'a t -> 'a option
    +
    val from_opt : 'a option -> 'a t
    +
    val toOption : 'a t -> 'a option
    Maps 'a Js.null_undefined to 'a option

    @@ -221,4 +223,5 @@

    Module Js.Nullable

    - \ No newline at end of file + +
    val to_opt : 'a t -> 'a option
    \ No newline at end of file diff --git a/docs/api/Js.Obj.html b/docs/api/Js.Obj.html index cc450f024f..f0490151dd 100644 --- a/docs/api/Js.Obj.html +++ b/docs/api/Js.Obj.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Option.html b/docs/api/Js.Option.html index c7512d0cab..f37ab4ffd6 100644 --- a/docs/api/Js.Option.html +++ b/docs/api/Js.Option.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Promise.html b/docs/api/Js.Promise.html index 3ed0389a10..41415d562d 100644 --- a/docs/api/Js.Promise.html +++ b/docs/api/Js.Promise.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Re.html b/docs/api/Js.Re.html index c17317e03a..214bbbe271 100644 --- a/docs/api/Js.Re.html +++ b/docs/api/Js.Re.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Result.html b/docs/api/Js.Result.html index 240294d0b2..568d559d6f 100644 --- a/docs/api/Js.Result.html +++ b/docs/api/Js.Result.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.String.html b/docs/api/Js.String.html index 50cf75b66a..7bd8f1cea7 100644 --- a/docs/api/Js.String.html +++ b/docs/api/Js.String.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Typed_array.html b/docs/api/Js.Typed_array.html index e626d709d1..ae8cd3142c 100644 --- a/docs/api/Js.Typed_array.html +++ b/docs/api/Js.Typed_array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Types.html b/docs/api/Js.Types.html index 1deff1b2b6..513b22e293 100644 --- a/docs/api/Js.Types.html +++ b/docs/api/Js.Types.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Undefined.html b/docs/api/Js.Undefined.html index 5eb72cdeb8..23a51b4dbb 100644 --- a/docs/api/Js.Undefined.html +++ b/docs/api/Js.Undefined.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.Vector.html b/docs/api/Js.Vector.html index 18d0308e98..ab2b608088 100644 --- a/docs/api/Js.Vector.html +++ b/docs/api/Js.Vector.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js.html b/docs/api/Js.html index c4cff5e0e5..eb2705170b 100644 --- a/docs/api/Js.html +++ b/docs/api/Js.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_array.html b/docs/api/Js_array.html index 00cdf7e25a..f9af1b9178 100644 --- a/docs/api/Js_array.html +++ b/docs/api/Js_array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_boolean.html b/docs/api/Js_boolean.html index 9a3d9cf027..5e7839e7be 100644 --- a/docs/api/Js_boolean.html +++ b/docs/api/Js_boolean.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_cast.html b/docs/api/Js_cast.html index 11ae106a52..a616964a36 100644 --- a/docs/api/Js_cast.html +++ b/docs/api/Js_cast.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_console.html b/docs/api/Js_console.html index 8038d5d876..88210bb789 100644 --- a/docs/api/Js_console.html +++ b/docs/api/Js_console.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_date.html b/docs/api/Js_date.html index c583dff9f6..8a6065a1f4 100644 --- a/docs/api/Js_date.html +++ b/docs/api/Js_date.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_dict.html b/docs/api/Js_dict.html index 3d57ed0f4e..67e1b292ef 100644 --- a/docs/api/Js_dict.html +++ b/docs/api/Js_dict.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_exn.html b/docs/api/Js_exn.html index cda97f47fb..426e80759f 100644 --- a/docs/api/Js_exn.html +++ b/docs/api/Js_exn.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_float.html b/docs/api/Js_float.html index 5a6aeff9b9..d1df99e5bb 100644 --- a/docs/api/Js_float.html +++ b/docs/api/Js_float.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_global.html b/docs/api/Js_global.html index 5fb5ec08cf..9662231075 100644 --- a/docs/api/Js_global.html +++ b/docs/api/Js_global.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_int.html b/docs/api/Js_int.html index f1080f9e77..d25b566722 100644 --- a/docs/api/Js_int.html +++ b/docs/api/Js_int.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_int64.html b/docs/api/Js_int64.html index 3c93a69dbb..8d731b4727 100644 --- a/docs/api/Js_int64.html +++ b/docs/api/Js_int64.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_internal.html b/docs/api/Js_internal.html index 64de909a46..0dad8bf901 100644 --- a/docs/api/Js_internal.html +++ b/docs/api/Js_internal.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_json.html b/docs/api/Js_json.html index 7b1f1334fb..a6d768b284 100644 --- a/docs/api/Js_json.html +++ b/docs/api/Js_json.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_list.html b/docs/api/Js_list.html index 3ed90c65b3..e45707482e 100644 --- a/docs/api/Js_list.html +++ b/docs/api/Js_list.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_mapperRt.html b/docs/api/Js_mapperRt.html index 121e619259..3885875e4e 100644 --- a/docs/api/Js_mapperRt.html +++ b/docs/api/Js_mapperRt.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_math.html b/docs/api/Js_math.html index 6bd41305fc..ecd66bddb2 100644 --- a/docs/api/Js_math.html +++ b/docs/api/Js_math.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_nativeint.html b/docs/api/Js_nativeint.html index 7f472b0d42..ec2cdec9a2 100644 --- a/docs/api/Js_nativeint.html +++ b/docs/api/Js_nativeint.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_null.html b/docs/api/Js_null.html index 85390b2a4e..8a400698d6 100644 --- a/docs/api/Js_null.html +++ b/docs/api/Js_null.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -214,4 +215,5 @@

    Module Js_null

    - \ No newline at end of file + +
    val to_opt : 'a t -> 'a option
    \ No newline at end of file diff --git a/docs/api/Js_null_undefined.html b/docs/api/Js_null_undefined.html index d3198620e0..4ec414c875 100644 --- a/docs/api/Js_null_undefined.html +++ b/docs/api/Js_null_undefined.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -189,7 +190,7 @@

    Module Js_null_undefined

    -
    val from_opt : 'a option -> 'a t
    +
    val fromOption : 'a option -> 'a t
    Maps 'a option to 'a Js.null_undefined

    @@ -205,7 +206,8 @@

    Module Js_null_undefined

    -
    val to_opt : 'a t -> 'a option
    +
    val from_opt : 'a option -> 'a t
    +
    val toOption : 'a t -> 'a option
    Maps 'a Js.null_undefined to 'a option

    @@ -221,4 +223,5 @@

    Module Js_null_undefined

    - \ No newline at end of file + +
    val to_opt : 'a t -> 'a option
    \ No newline at end of file diff --git a/docs/api/Js_obj.html b/docs/api/Js_obj.html index 1535d78f9b..242a46785b 100644 --- a/docs/api/Js_obj.html +++ b/docs/api/Js_obj.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_option.html b/docs/api/Js_option.html index d72d32600f..9329a1da6d 100644 --- a/docs/api/Js_option.html +++ b/docs/api/Js_option.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_primitive.html b/docs/api/Js_primitive.html index f413b904fc..05cfed1c92 100644 --- a/docs/api/Js_primitive.html +++ b/docs/api/Js_primitive.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_promise.html b/docs/api/Js_promise.html index b759f688cf..a6078168c9 100644 --- a/docs/api/Js_promise.html +++ b/docs/api/Js_promise.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_re.html b/docs/api/Js_re.html index 8c1c311e89..6933135cf0 100644 --- a/docs/api/Js_re.html +++ b/docs/api/Js_re.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_result.html b/docs/api/Js_result.html index 8821325e68..db3b76102c 100644 --- a/docs/api/Js_result.html +++ b/docs/api/Js_result.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_string.html b/docs/api/Js_string.html index 5a23a05737..0c0404dd8f 100644 --- a/docs/api/Js_string.html +++ b/docs/api/Js_string.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.ArrayBuffer.html b/docs/api/Js_typed_array.ArrayBuffer.html index 59c3698da9..ac12a2bce4 100644 --- a/docs/api/Js_typed_array.ArrayBuffer.html +++ b/docs/api/Js_typed_array.ArrayBuffer.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.DataView.html b/docs/api/Js_typed_array.DataView.html index c6a8b63a3f..657d05124d 100644 --- a/docs/api/Js_typed_array.DataView.html +++ b/docs/api/Js_typed_array.DataView.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Float32Array.html b/docs/api/Js_typed_array.Float32Array.html index 60924a788c..f055dcd2a6 100644 --- a/docs/api/Js_typed_array.Float32Array.html +++ b/docs/api/Js_typed_array.Float32Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Float32_array.html b/docs/api/Js_typed_array.Float32_array.html index 534d9f3808..cf2e20228e 100644 --- a/docs/api/Js_typed_array.Float32_array.html +++ b/docs/api/Js_typed_array.Float32_array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Float64Array.html b/docs/api/Js_typed_array.Float64Array.html index 22b3fad0f7..0767ec796b 100644 --- a/docs/api/Js_typed_array.Float64Array.html +++ b/docs/api/Js_typed_array.Float64Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Float64_array.html b/docs/api/Js_typed_array.Float64_array.html index c13ccd2ed2..ae06707c64 100644 --- a/docs/api/Js_typed_array.Float64_array.html +++ b/docs/api/Js_typed_array.Float64_array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Int16Array.html b/docs/api/Js_typed_array.Int16Array.html index 49e9880be9..e6f1a9e6d3 100644 --- a/docs/api/Js_typed_array.Int16Array.html +++ b/docs/api/Js_typed_array.Int16Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Int32Array.html b/docs/api/Js_typed_array.Int32Array.html index b46c3675e0..723dcb0523 100644 --- a/docs/api/Js_typed_array.Int32Array.html +++ b/docs/api/Js_typed_array.Int32Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Int32_array.html b/docs/api/Js_typed_array.Int32_array.html index 8002b0be82..bc4231d06b 100644 --- a/docs/api/Js_typed_array.Int32_array.html +++ b/docs/api/Js_typed_array.Int32_array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Int8Array.html b/docs/api/Js_typed_array.Int8Array.html index 1f5e58aa14..41b4ad3ce7 100644 --- a/docs/api/Js_typed_array.Int8Array.html +++ b/docs/api/Js_typed_array.Int8Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.S.html b/docs/api/Js_typed_array.S.html index dc773005d1..a73967d93d 100644 --- a/docs/api/Js_typed_array.S.html +++ b/docs/api/Js_typed_array.S.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Type.html b/docs/api/Js_typed_array.Type.html index 95df473191..6080fa425c 100644 --- a/docs/api/Js_typed_array.Type.html +++ b/docs/api/Js_typed_array.Type.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Uint16Array.html b/docs/api/Js_typed_array.Uint16Array.html index 9f43275077..f71da3290f 100644 --- a/docs/api/Js_typed_array.Uint16Array.html +++ b/docs/api/Js_typed_array.Uint16Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Uint32Array.html b/docs/api/Js_typed_array.Uint32Array.html index 1bb1438401..38e2313925 100644 --- a/docs/api/Js_typed_array.Uint32Array.html +++ b/docs/api/Js_typed_array.Uint32Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Uint8Array.html b/docs/api/Js_typed_array.Uint8Array.html index 59f82489d9..3504ea9c1a 100644 --- a/docs/api/Js_typed_array.Uint8Array.html +++ b/docs/api/Js_typed_array.Uint8Array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.Uint8ClampedArray.html b/docs/api/Js_typed_array.Uint8ClampedArray.html index 336c6210b7..5143086c3c 100644 --- a/docs/api/Js_typed_array.Uint8ClampedArray.html +++ b/docs/api/Js_typed_array.Uint8ClampedArray.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_typed_array.html b/docs/api/Js_typed_array.html index d23af3ef0f..c400036ab1 100644 --- a/docs/api/Js_typed_array.html +++ b/docs/api/Js_typed_array.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_types.html b/docs/api/Js_types.html index fb4a57fc4b..f14919c61a 100644 --- a/docs/api/Js_types.html +++ b/docs/api/Js_types.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_undefined.html b/docs/api/Js_undefined.html index e91ae4342c..ccc1fbb545 100644 --- a/docs/api/Js_undefined.html +++ b/docs/api/Js_undefined.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_unsafe.html b/docs/api/Js_unsafe.html index d0881129f3..15f5c7aee9 100644 --- a/docs/api/Js_unsafe.html +++ b/docs/api/Js_unsafe.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Js_vector.html b/docs/api/Js_vector.html index b03d3824ee..144d11aa97 100644 --- a/docs/api/Js_vector.html +++ b/docs/api/Js_vector.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node.Buffer.html b/docs/api/Node.Buffer.html index 9b77323c7d..2152da76e9 100644 --- a/docs/api/Node.Buffer.html +++ b/docs/api/Node.Buffer.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node.Child_process.html b/docs/api/Node.Child_process.html index 0f9e855a91..40c17a16ae 100644 --- a/docs/api/Node.Child_process.html +++ b/docs/api/Node.Child_process.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node.Fs.html b/docs/api/Node.Fs.html index 3348edc321..d2ff8e7cff 100644 --- a/docs/api/Node.Fs.html +++ b/docs/api/Node.Fs.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node.Module.html b/docs/api/Node.Module.html index f9d0c30f1f..64080176bc 100644 --- a/docs/api/Node.Module.html +++ b/docs/api/Node.Module.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node.Path.html b/docs/api/Node.Path.html index ebb547d9e3..2a2cbaeb79 100644 --- a/docs/api/Node.Path.html +++ b/docs/api/Node.Path.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node.Process.html b/docs/api/Node.Process.html index 9026f8824a..c51249ca07 100644 --- a/docs/api/Node.Process.html +++ b/docs/api/Node.Process.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node.html b/docs/api/Node.html index 7cbba87979..d6fa78671b 100644 --- a/docs/api/Node.html +++ b/docs/api/Node.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node_buffer.html b/docs/api/Node_buffer.html index 22b4532b09..6e6f7c746d 100644 --- a/docs/api/Node_buffer.html +++ b/docs/api/Node_buffer.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node_child_process.html b/docs/api/Node_child_process.html index dcd9eb9102..269bdc4483 100644 --- a/docs/api/Node_child_process.html +++ b/docs/api/Node_child_process.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node_fs.Watch.html b/docs/api/Node_fs.Watch.html index eef36c5b8e..cb16593d94 100644 --- a/docs/api/Node_fs.Watch.html +++ b/docs/api/Node_fs.Watch.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node_fs.html b/docs/api/Node_fs.html index 8f880f75fd..7614abc0bd 100644 --- a/docs/api/Node_fs.html +++ b/docs/api/Node_fs.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node_module.html b/docs/api/Node_module.html index 2b7f6de321..c97d2085bd 100644 --- a/docs/api/Node_module.html +++ b/docs/api/Node_module.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node_path.html b/docs/api/Node_path.html index 00c9f1c44e..a3002ab3c5 100644 --- a/docs/api/Node_path.html +++ b/docs/api/Node_path.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/Node_process.html b/docs/api/Node_process.html index 52c4bef348..35e4eea023 100644 --- a/docs/api/Node_process.html +++ b/docs/api/Node_process.html @@ -32,6 +32,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/index_attributes.html b/docs/api/index_attributes.html index b65ccd9592..ed7e7b0140 100644 --- a/docs/api/index_attributes.html +++ b/docs/api/index_attributes.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/index_class_types.html b/docs/api/index_class_types.html index c19bfe9be3..65c956d2ca 100644 --- a/docs/api/index_class_types.html +++ b/docs/api/index_class_types.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/index_classes.html b/docs/api/index_classes.html index 5e5a125135..7681c74929 100644 --- a/docs/api/index_classes.html +++ b/docs/api/index_classes.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/index_exceptions.html b/docs/api/index_exceptions.html index d19a5fa9a7..fce2dab6b2 100644 --- a/docs/api/index_exceptions.html +++ b/docs/api/index_exceptions.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/index_extensions.html b/docs/api/index_extensions.html index d530d97f64..f91e30c93a 100644 --- a/docs/api/index_extensions.html +++ b/docs/api/index_extensions.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/index_methods.html b/docs/api/index_methods.html index 733d2c4630..fbee9cfdde 100644 --- a/docs/api/index_methods.html +++ b/docs/api/index_methods.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/index_module_types.html b/docs/api/index_module_types.html index cb07eddeff..f2783bce1f 100644 --- a/docs/api/index_module_types.html +++ b/docs/api/index_module_types.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • diff --git a/docs/api/index_modules.html b/docs/api/index_modules.html index 0e68b64d13..cb2e9d598d 100644 --- a/docs/api/index_modules.html +++ b/docs/api/index_modules.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -132,7 +133,7 @@

    Index of modules

    Belt.Array

    - mutable array: Utililites functions
    + mutable array: Utilities functions

    @@ -146,23 +147,23 @@

    Index of modules

    Belt
    - A stdlib shipped with BuckleScript + A stdlib shipped with BuckleScript

    - This stdlib is still in beta status, but we encourage you to try it out and + This stdlib is still in beta status, but we encourage you to try it out and provide feedback.

    Motivation

    - The motivation of creating such library is to provide BuckleScript users a - better end-to-end user experience, since the original OCaml stdlib was not - written with JS platform in mind, below are a list of areas this lib aims to + The motivation of creating such library is to provide BuckleScript users a + better end-to-end user experience, since the original OCaml stdlib was not + written with JS platform in mind, below are a list of areas this lib aims to improve:

    1. 1. Consistency in name convention: camlCase, and arguments order
    2. 2. Exception thrown functions are all suffixed with Exn, e.g, getExn
    3. -
    4. 3. Beter peformance and smaller code size running on JS platform
    5. +
    6. 3. Better performance and smaller code size running on JS platform

    @@ -187,7 +188,7 @@

    Index of modules

    When we create a collection library for a custom data type, take Set for - example, suppose its element type is a pair of ints, + example, suppose its element type is a pair of ints, it needs a custom compare function. However, the Set could not just be typed as Set.t (int * int) , its customized compare function needs to be @@ -201,37 +202,41 @@

    Index of modules

    We introduced a phantom type to solve the problem

    -

          type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match compare a0 b0 with
    -             | 0 -> compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 = Belt.Set.make ~id:(module I0)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 = Belt.Set.make ~id:(module I1)
    +    
          module Comparable1 = Belt.Id.MakeComparable(struct
    +        type t = int * int
    +        let cmp (a0, a1) (b0, b1) =
    +          match Pervasives.compare a0 b0 with
    +          | 0 -> Pervasives.compare a1 b1
    +          | c -> c
    +      end)
    +
    +    let mySet1 = Belt.Set.make ~id:(module Comparable1)
    +
    +    module Comparable2 = Belt.Id.MakeComparable(struct
    +      type t = int * int
    +      let cmp (a0, a1) (b0, b1) =
    +        match Pervasives.compare a0 b0 with
    +        | 0 -> Pervasives.compare a1 b1
    +        | c -> c
    +    end)
    +
    +    let mySet2 = Belt.Set.make ~id:(module Comparable2)
         

    - Here the compiler would infer s0 and s1 having different type so that - it would not mix. + Here, the compiler would infer mySet1 and mySet2 having different type, so + e.g. a `merge` operation that tries to merge these two sets will correctly fail.

    -

          val s0 : ((int * int), I0.identity) t
    -      val s1 : ((int * int), I1.identity) t
    +    
          val mySet1 : ((int * int), Comparable1.identity) t
    +      val mySet2 : ((int * int), Comparable2.identity) t
         

    - I0.identity and I1.identity are not the same using our encoding scheme. + Comparable1.identity and Comparable2.identity are not the same using our encoding scheme.

    - Collection Hierachy + Collection Hierarchy

    In general, we provide a generic collection module, but also create specialized @@ -249,7 +254,7 @@

    Index of modules

    Currently, both Belt_Set and Belt.Set are accessible to users for some - technical rasons, + technical reasons, we strongly recommend users stick to qualified import, Belt.Sort, we may hide the internal, i.e, Belt_Set in the future
    @@ -423,11 +428,11 @@

    Index of modules

    Belt.Id

    - Provide utiliites to create identified comparators or hashes for - data structures used below. + Provide utiliites to create identified comparators or hashes for + data structures used below.

    - It create a unique identifer per module of functions so that different data structures with slightly different + It create a unique identifer per module of functions so that different data structures with slightly different comparison functions won't mix.

    @@ -458,52 +463,11 @@

    Index of modules

    and insertion take time logarithmic in the size of the map.

    - All data are parameterized by not its only type but also a unique identity in - the time of initialization, so that two Map of int keys initialized with different - compare functions will have different type. + For more info on this module's usage of identity, `make` and others, please see + the top level documentation of Belt, A special encoding for collection safety.

    - For example: -

         type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match Pervasives.compare a0 b0 with
    -             | 0 -> Pervasives.compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 : (_, string, _) t = make ~id:(module I0) (* value is of type string *)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 : (_, string, _) t = make ~id:(module I1)
    -   
    -

    - - Here the compiler would infer s0 and s1 having different type so that - it would not mix. -

    - -

         val s0 : ((int * int), string,  I0.identity) t 
    -     val s1 : ((int * int), string,  I1.identity) t
    -   
    -

    - - We can add elements to the collection: -

    - -

         let s2 = add s1 (0,0) "a"
    -     let s3 = add s2 (1,1) "b"
    -   
    -

    - - Since this is an immutable data strucure, s1 will be an empty map - while s2 will contain one pair, s3 will contain two. -

    - - The merge s0 s3 callback will result in a type error, since their identity mismatch
    + Example usage:

    @@ -520,14 +484,14 @@

    Index of modules

    Belt_MapInt
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    Belt_MapString
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    @@ -537,53 +501,7 @@

    Index of modules

    A mutable sorted map module which allows customize compare behavior.

    - The implementation uses balanced binary trees, and therefore searching - and insertion take time logarithmic in the size of the map. -

    - - All data are parameterized by not its only type but also a unique identity in - the time of initialization, so that two Sets of ints initialized with different - compare functions will have different type. -

    - - For example: -

         type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match Pervasives.compare a0 b0 with
    -             | 0 -> Pervasives.compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 : (_, string,_) t = make ~id:(module I0)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 : (_, string, _) t = make ~id:(module I1)
    -   
    -

    - - Here the compiler would infer s0 and s1 having different type so that - it would not mix. -

    - -

         val s0 : ((int * int), string, I0.identity) t 
    -     val s1 : ((int * int), string, I1.identity) t 
    -   
    -

    - - We can add elements to the collection: -

    - -

         let () =
    -       add s1 (0,0) "a";
    -       add s1 (1,1) "b"
    -   
    -

    - - Since this is an mutable data strucure, s1 will contain two pairs.
    + Same as Belt.Map, but mutable.

    @@ -621,53 +539,7 @@

    Index of modules

    A mutable sorted set module which allows customize compare behavior.

    - The implementation uses balanced binary trees, and therefore searching - and insertion take time logarithmic in the size of the map. -

    - - All data are parameterized by not its only type but also a unique identity in - the time of initialization, so that two Sets of ints initialized with different - compare functions will have different type. -

    - - For example: -

         type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match Pervasives.compare a0 b0 with
    -             | 0 -> Pervasives.compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 = make ~id:(module I0)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 = make ~id:(module I1)
    -   
    -

    - - Here the compiler would infer s0 and s1 having different type so that - it would not mix. -

    - -

         val s0 : ((int * int), I0.identity) t 
    -     val s1 : ((int * int), I1.identity) t 
    -   
    -

    - - We can add elements to the collection: -

    - -

         let () =
    -       add s1 (0,0);
    -       add s1 (1,1)
    -   
    -

    - - Since this is an mutable data strucure, s1 will contain two pairs.
    + Same as Belt.Set, but mutable.

    @@ -707,6 +579,16 @@

    Index of modules

    This module implements stacks, with in-place modification.
    +
    +
    +Belt_Option +
    +
    + Belt.Option +

    + + Utilities for option data type
    +

    Belt_Range @@ -727,52 +609,11 @@

    Index of modules

    and insertion take time logarithmic in the size of the map.

    - All data are parameterized by not its only type but also a unique identity in - the time of initialization, so that two Sets of ints initialized with different - compare functions will have different type. -

    - - For example: -

         type t = int * int 
    -      module I0 =
    -        (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -             match Pervasives.compare a0 b0 with
    -             | 0 -> Pervasives.compare a1 b1
    -             | c -> c 
    -           ))
    -    let s0 = make ~id:(module I0)
    -    module I1 =
    -      (val Belt.Id.comparableU ~cmp:(fun[@bs] ((a0,a1) : t) ((b0,b1) : t) ->
    -           match compare a1 b1 with
    -           | 0 -> compare a0 b0
    -           | c -> c 
    -         ))
    -    let s1 = make ~id:(module I1)
    -   
    -

    - - Here the compiler would infer s0 and s1 having different type so that - it would not mix. + For more info on this module's usage of identity, `make` and others, please see + the top level documentation of Belt, A special encoding for collection safety.

    -

         val s0 :  ((int * int), I0.identity) t
    -     val s1 :  ((int * int), I1.identity) t
    -   
    -

    - - We can add elements to the collection: -

    - -

         let s2 = add s1 (0,0)
    -     let s3 = add s2 (1,1)
    -   
    -

    - - Since this is an immutable data strucure, s1 will be an empty set - while s2 will contain one element, s3 will contain two. -

    - - The union s0 s3 will result in a type error, since their identity mismatch
    + Example usage:

    @@ -786,8 +627,8 @@

    Index of modules

    Belt_SetInt
    - This module is Belt.Set specialized with key type to be a primitive type. - It is more efficient in general, the API is the same with Belt_Set except its key type is fixed, + 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)

    @@ -798,8 +639,8 @@

    Index of modules

    Belt_SetString
    - This module is Belt.Set specialized with key type to be a primitive type. - It is more efficient in general, the API is the same with Belt_Set except its key type is fixed, + 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)

    @@ -833,14 +674,14 @@

    Index of modules

    Belt_internalAVLset
    - raise when invariant is not helld
    + raise when invariant is not held
    Belt_internalAVLtree
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -1046,7 +887,7 @@

    Index of modules

    Belt.HashMap

    - The toplevel provides generic mutable hash map operations. + The top level provides generic mutable hash map operations.

    It also has two specialized inner modules @@ -1060,7 +901,7 @@

    Index of modules

    Belt.HashSet

    - The toplevel provides generic mutable hash set operations. + The top level provides generic mutable hash set operations.

    It also has two specialized inner modules @@ -1075,12 +916,12 @@

    Index of modules

    Belt.Id

    - Provide utiliites to create identified comparators or hashes for - data structures used below. + Provide utilities to create identified comparators or hashes for + data structures used below.

    - It create a unique identifer per module of - functions so that different data structures with slightly different + It create a unique identifier per module of + functions so that different data structures with slightly different comparison functions won't mix

    @@ -1133,7 +974,7 @@

    Index of modules

    Int [Belt_Set]
    - Specalized when key type is int, more efficient + Specalized when value type is int, more efficient than the gerneic type, its compare behavior is fixed using the built-in comparison
    @@ -1447,13 +1288,37 @@

    Syntax sugar


    M +MakeComparable [Belt_Id] +
    +
    + +
    +
    +MakeComparableU [Belt_Id] +
    +
    + +
    +
    +MakeHashable [Belt_Id] +
    +
    + +
    +
    +MakeHashableU [Belt_Id] +
    +
    + +
    +
    Map [Belt]
    Belt.Map,

    - The toplevel provides generic immutable map operations. + The top level provides generic immutable map operations.

    It also has three specialized inner modules @@ -1461,7 +1326,7 @@

    Syntax sugar

    Belt.Map.Dict: This module separate date from function - which is more verbbose but slightly more efficient
    + which is more verbose but slightly more efficient

    @@ -1484,7 +1349,7 @@

    Syntax sugar

    Belt.MutableMap

    - The toplevel provides generic mutable map operations. + The top level provides generic mutable map operations.

    It also has two specialized inner modules @@ -1508,7 +1373,7 @@

    Syntax sugar

    Belt.MutableSet

    - The toplevel provides generic mutable set operations. + The top level provides generic mutable set operations.

    It also has two specialized inner modules @@ -1634,6 +1499,16 @@

    Syntax sugar

    Provide utilities for option
    +
    +
    +Option [Belt] +
    +
    + Belt.Option +

    + + Utilities for option data type
    +


    P @@ -1712,7 +1587,7 @@

    Syntax sugar

    Belt.Set

    - The toplevel provides generic immutable set operations. + The top level provides generic immutable set operations.

    It also has three specialized inner modules @@ -1720,7 +1595,7 @@

    Syntax sugar

    Belt.Set.Dict: This module separate date from function - which is more verbbose but slightly more efficient
    + which is more verbose but slightly more efficient

    @@ -1730,7 +1605,7 @@

    Syntax sugar

    Belt.SortArray

    - The toplevel provides some generic sort related utililties. + The top level provides some generic sort related utilities.

    It also has two specialized inner modules @@ -1792,7 +1667,7 @@

    Syntax sugar

    String [Belt_Set]
    - Specalized when key type is string, more efficient + Specalized when value type is string, more efficient than the gerneic type, its compare behavior is fixed using the built-in comparison
    @@ -1868,4 +1743,4 @@

    Syntax sugar

    - + \ No newline at end of file diff --git a/docs/api/index_types.html b/docs/api/index_types.html index 5059abb66f..947315abc7 100644 --- a/docs/api/index_types.html +++ b/docs/api/index_types.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -473,7 +474,7 @@

    Index of types

    ('a,'id) cmp

    - Its runtime representation is a cmp function, but signed with a + Its runtime representation is a cmp function, but signed with a type parameter, so that different hash functions type mismatch

    @@ -491,13 +492,13 @@

    Index of types

    Unlike normal functions, when created, it comes with a unique identity (guaranteed - by the type system). + by the type system).

    - It can be created using function Belt_Id.comparableU orBelt_Id.comparable. + It can be created using function Belt_Id.comparableU orBelt_Id.comparable.

    - The idea of a unique identity when created is that it makes sure two sets would type + The idea of a unique identity when created is that it makes sure two sets would type mismatch if they use different comparison function

    @@ -628,46 +629,6 @@

    Index of types

    -
    -
    -elt [Belt_internalSetString] -
    -
    - -
    -
    -elt [Belt_internalSetInt] -
    -
    - -
    -
    -elt [Belt_MutableSetString] -
    -
    - The type of the set elements.
    - -
    -
    -elt [Belt_MutableSetInt] -
    -
    - The type of the set elements.
    - -
    -
    -elt [Belt_SetString] -
    -
    - The type of the set elements.
    - -
    -
    -elt [Belt_SetInt] -
    -
    - The type of the set elements.
    -
    eq [Belt_Id] @@ -676,7 +637,7 @@

    Index of types

    ('a, 'id) eq

    - Its runtime represenation is an eq function, but signed with a + Its runtime represenation is an eq function, but signed with a type parameter, so that different hash functions type mismatch

    @@ -756,7 +717,7 @@

    Index of types

    ('a, 'id) hash

    - Its runtime represenation is a hash function, but signed with a + Its runtime represenation is a hash function, but signed with a type parameter, so that different hash functions type mismatch

    @@ -768,13 +729,13 @@

    Index of types

    Unlike normal functions, when created, it comes with a unique identity (guaranteed - by the type system). + by the type system).

    It can be created using function Belt_Id.hashableU or Belt_Id.hashable.

    - The idea of a unique identity when created is that it makes sure two hash sets would type + The idea of a unique identity when created is that it makes sure two hash sets would type mismatch if they use different comparison function

    @@ -1525,14 +1486,14 @@

    Index of types

    t [Belt_MapString]
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    t [Belt_MapInt]
    - The type of maps from type key to type 'a.
    + The type of maps from type key to type 'value.
    @@ -1542,7 +1503,10 @@

    Index of types

    ('key, 'identity) t

    - 'key is the element type + 'key is the field type +

    + + 'value is the element type

    'identity the identity of the collection
    @@ -1572,10 +1536,10 @@

    Index of types

    t [Belt_Set]
    - ('key, 'identity) t + ('value, 'identity) t

    - 'key is the element type + 'value is the element type

    'identity the identity of the collection
    @@ -1701,6 +1665,47 @@

    Index of types

    This type has only one value undefined
    +
    +
    +
    V +value [Belt_internalSetString] +
    +
    + +
    +
    +value [Belt_internalSetInt] +
    +
    + +
    +
    +value [Belt_MutableSetString] +
    +
    + The type of the set elements.
    + +
    +
    +value [Belt_MutableSetInt] +
    +
    + The type of the set elements.
    + +
    +
    +value [Belt_SetString] +
    +
    + The type of the set elements.
    + +
    +
    +value [Belt_SetInt] +
    +
    + The type of the set elements.
    +

    W diff --git a/docs/api/index_values.html b/docs/api/index_values.html index 218c8f9b32..bba3aec740 100644 --- a/docs/api/index_values.html +++ b/docs/api/index_values.html @@ -31,6 +31,7 @@
  • Belt_MutableSetInt
  • Belt_MutableSetString
  • Belt_MutableStack
  • +
  • Belt_Option
  • Belt_Range
  • Belt_Set
  • Belt_SetDict
  • @@ -789,98 +790,98 @@

    Index of values

    checkInvariantInternal [Belt_internalAVLtree]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_internalAVLset]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MutableMapString]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MutableMapInt]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MutableMap]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MutableSetString]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MutableSetInt]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MutableSet]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MapDict]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MapString]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_MapInt]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_SetDict]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_SetString]
    - raise when invariant is not helld
    + raise when invariant is not held
    checkInvariantInternal [Belt_SetInt]
    - raise when invariant is not helld
    + raise when invariant is not held
    @@ -1044,6 +1045,12 @@

    Index of values

    +
    +
    +cmp [Belt_Option] +
    +
    +
    cmp [Belt_MutableMapString] @@ -1112,10 +1119,10 @@

    Index of values

    cmp [Belt_Map]
    - cmp s0 s1 vcmp + cmp m0 m1 vcmp

    - Totoal ordering of map given total ordering of value function. + Total ordering of map given total ordering of value function.

    It will compare size first and each element following the order one by one.
    @@ -1209,6 +1216,12 @@

    Index of values

    +
    +
    +cmpU [Belt_Option] +
    +
    +
    cmpU [Belt_MutableMapString] @@ -1950,6 +1963,12 @@

    Index of values

    +
    +
    +eq [Belt_Option] +
    +
    +
    eq [Belt_MutableMapString] @@ -2130,6 +2149,12 @@

    Index of values

    +
    +
    +eqU [Belt_Option] +
    +
    +
    eqU [Belt_MutableMapString] @@ -2795,6 +2820,18 @@

    Index of values

    returns the enabled flags as a string
    +
    +
    +flatMap [Belt_Option] +
    +
    + +
    +
    +flatMapU [Belt_Option] +
    +
    +
    flatten [Js_list] @@ -3585,6 +3622,177 @@

    Index of values

    fromArray entries creates a new dictionary containing each (key, value) pair in entries
    +
    +
    +fromArray [Belt_internalSetString] +
    +
    + +
    +
    +fromArray [Belt_internalSetInt] +
    +
    + +
    +
    +fromArray [Belt_internalMapString] +
    +
    + +
    +
    +fromArray [Belt_internalMapInt] +
    +
    + +
    +
    +fromArray [Belt_internalAVLtree] +
    +
    + +
    +
    +fromArray [Belt_internalAVLset] +
    +
    + +
    +
    +fromArray [Belt_HashMapString] +
    +
    + +
    +
    +fromArray [Belt_HashMapInt] +
    +
    + +
    +
    +fromArray [Belt_HashMap] +
    +
    + +
    +
    +fromArray [Belt_HashSetString] +
    +
    + +
    +
    +fromArray [Belt_HashSetInt] +
    +
    + +
    +
    +fromArray [Belt_HashSet] +
    +
    + +
    +
    +fromArray [Belt_MutableMapString] +
    +
    + +
    +
    +fromArray [Belt_MutableMapInt] +
    +
    + +
    +
    +fromArray [Belt_MutableMap] +
    +
    + +
    +
    +fromArray [Belt_MutableSetString] +
    +
    + +
    +
    +fromArray [Belt_MutableSetInt] +
    +
    + +
    +
    +fromArray [Belt_MutableSet] +
    +
    + +
    +
    +fromArray [Belt_MapDict] +
    +
    + +
    +
    +fromArray [Belt_MapString] +
    +
    + +
    +
    +fromArray [Belt_MapInt] +
    +
    + +
    +
    +fromArray [Belt_Map] +
    +
    + fromArray kvs ~id
    + +
    +
    +fromArray [Belt_SetDict] +
    +
    + +
    +
    +fromArray [Belt_SetString] +
    +
    + +
    +
    +fromArray [Belt_SetInt] +
    +
    + +
    +
    +fromArray [Belt_Set] +
    +
    + fromArray xs ~id
    + +
    +
    +fromArray [Belt_List] +
    +
    + +
    +
    +fromArray [Belt_MutableQueue] +
    +
    + fromArray a is equivalent to Array.forEach a (add q a)
    +
    fromBuffer [Js_typed_array.DataView] @@ -3905,6 +4113,20 @@

    Index of values

    ES2015
    +
    +
    +fromOption [Js_null_undefined] +
    +
    + Maps 'a option to 'a Js.null_undefined +

    + + +
    Some a -> return a +
    None -> undefined +
    +
    +

    fromOption [Js_undefined] @@ -3933,6 +4155,91 @@

    Index of values


    +
    +
    +fromSortedArrayAux [Belt_internalAVLtree] +
    +
    + +
    +
    +fromSortedArrayAux [Belt_internalAVLset] +
    +
    + +
    +
    +fromSortedArrayRevAux [Belt_internalAVLtree] +
    +
    + +
    +
    +fromSortedArrayRevAux [Belt_internalAVLset] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_internalAVLtree] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_internalAVLset] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_MutableSetString] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_MutableSetInt] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_MutableSet] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_SetDict] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_SetString] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_SetInt] +
    +
    + +
    +
    +fromSortedArrayUnsafe [Belt_Set] +
    +
    + fromSortedArrayUnsafe xs ~id +

    + + The same as Belt_Set.fromArray except it is after assuming the input array x is already sorted +

    + + Unsafe
    +

    fromString [Node_buffer] @@ -3992,15 +4299,7 @@

    Index of values

    from_opt [Js_null_undefined]
    - Maps 'a option to 'a Js.null_undefined -

    - - -
    Some a -> return a -
    None -> undefined -
    -
    - +

    from_opt [Js_undefined] @@ -4376,6 +4675,12 @@

    Index of values

    +
    +
    +getExn [Belt_Option] +
    +
    +
    getExn [Belt_MutableMapString] @@ -4890,6 +5195,12 @@

    Index of values

    +
    +
    +getWithDefault [Belt_Option] +
    +
    +
    getWithDefault [Belt_MutableMapString] @@ -5082,7 +5393,7 @@

    Index of values

    has [Belt_Map]
    - has s k
    + has m k checks whether m has the key k
    @@ -5490,7 +5801,7 @@

    Index of values

    isEmpty [Belt_Map]
    - isEmpty s0
    + isEmpty m checks whether a map m is empty
    @@ -5558,12 +5869,24 @@

    Index of values

    +
    +
    +isNone [Belt_Option] +
    +
    +
    isSome [Js_option]
    +
    +
    +isSome [Belt_Option] +
    +
    +
    isSomeValue [Js_option] @@ -6542,14 +6865,14 @@

    Index of values

    make [Belt_Map]
    - make ~id
    + make ~id creates a new map by taking in the comparator
    make [Belt_Set]
    - make ~id
    + make ~id creates a new set by taking in the comparator
    @@ -6726,6 +7049,12 @@

    Index of values

    +
    +
    +map [Belt_Option] +
    +
    +
    map [Belt_MutableMapString] @@ -6870,6 +7199,12 @@

    Index of values

    +
    +
    +mapU [Belt_Option] +
    +
    +
    mapU [Belt_MutableMapString] @@ -6930,6 +7265,18 @@

    Index of values

    +
    +
    +mapWithDefault [Belt_Option] +
    +
    + +
    +
    +mapWithDefaultU [Belt_Option] +
    +
    +
    mapWithIndex [Belt_List] @@ -8144,42 +8491,6 @@

    Index of values

    object_ dict makes a JSON objet of the Js.Dict.t dict
    -
    -
    -ofArray [Belt_internalSetString] -
    -
    - -
    -
    -ofArray [Belt_internalSetInt] -
    -
    - -
    -
    -ofArray [Belt_internalMapString] -
    -
    - -
    -
    -ofArray [Belt_internalMapInt] -
    -
    - -
    -
    -ofArray [Belt_internalAVLtree] -
    -
    - -
    -
    -ofArray [Belt_internalAVLset] -
    -
    -
    ofArray [Belt_HashMapString] @@ -8275,8 +8586,7 @@

    Index of values

    ofArray [Belt_Map]
    - ofArray kvs ~id
    - +
    ofArray [Belt_SetDict] @@ -8300,8 +8610,7 @@

    Index of values

    ofArray [Belt_Set]
    - ofArray xs ~id
    - +
    ofArray [Belt_List] @@ -8311,43 +8620,6 @@

    Index of values

    ofArray [Belt_MutableQueue] -
    -
    - ofArray a is equivalent to Array.forEach a (add q a)
    - -
    -
    -ofSortedArrayAux [Belt_internalAVLtree] -
    -
    - -
    -
    -ofSortedArrayAux [Belt_internalAVLset] -
    -
    - -
    -
    -ofSortedArrayRevAux [Belt_internalAVLtree] -
    -
    - -
    -
    -ofSortedArrayRevAux [Belt_internalAVLset] -
    -
    - -
    -
    -ofSortedArrayUnsafe [Belt_internalAVLtree] -
    -
    - -
    -
    -ofSortedArrayUnsafe [Belt_internalAVLset]
    @@ -8392,14 +8664,7 @@

    Index of values

    ofSortedArrayUnsafe [Belt_Set]
    - ofSortedArrayUnsafe xs ~id -

    - - The same as Belt_Set.ofArray except it is after assuming the input array x is already sorted -

    - - Unsafe
    - +

    of_buffer [Js_typed_array.Float64Array] @@ -10443,6 +10708,13 @@

    Index of values

    +
    +
    +shuffle [Belt_List] +
    +
    + shuffle xs
    +
    shuffle [Belt_Array] @@ -12162,6 +12434,21 @@

    Index of values

    +
    +
    +toOption [Js_null_undefined] +
    +
    + Maps 'a Js.null_undefined to 'a option +

    + + +
    return a -> Some a +
    undefined -> None +
    null -> None +
    +
    +

    toOption [Js_undefined] @@ -12390,22 +12677,19 @@

    Index of values

    to_opt [Js_null_undefined]
    - Maps 'a Js.null_undefined to 'a option -

    - - -
    return a -> Some a -
    undefined -> None -
    null -> None -
    -
    - +

    to_opt [Js_undefined]
    +
    +
    +to_opt [Js_null] +
    +
    +
    to_string [Js_nativeint] diff --git a/docs/api/type_Belt.Option.html b/docs/api/type_Belt.Option.html new file mode 100644 index 0000000000..61c7101562 --- /dev/null +++ b/docs/api/type_Belt.Option.html @@ -0,0 +1,11 @@ + + + + + + + + + Belt.Option + +(module Belt_Option) \ No newline at end of file diff --git a/docs/api/type_Belt_HashMap.html b/docs/api/type_Belt_HashMap.html index 79f5d99010..c7027036d0 100644 --- a/docs/api/type_Belt_HashMap.html +++ b/docs/api/type_Belt_HashMap.html @@ -45,11 +45,14 @@   val toArray : ('key, 'value, 'id) Belt_HashMap.t -> ('key * 'value) array
      val keysToArray : ('key, 'a, 'b) Belt_HashMap.t -> 'key array
      val valuesToArray : ('a, 'value, 'b) Belt_HashMap.t -> 'value array
    -  val ofArray :
    +  val fromArray :
        ('key * 'value) array ->
        id:('key, 'id) Belt_HashMap.id -> ('key, 'value, 'id) Belt_HashMap.t
      val mergeMany :
        ('key, 'value, 'id) Belt_HashMap.t -> ('key * 'value) array -> unit
      val getBucketHistogram : ('a, 'b, 'c) Belt_HashMap.t -> int array
      val logStats : ('a, 'b, 'c) Belt_HashMap.t -> unit
    +  val ofArray :
    +    ('key * 'value) array ->
    +    id:('key, 'id) Belt_HashMap.id -> ('key, 'value, 'id) Belt_HashMap.t
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_HashMapInt.html b/docs/api/type_Belt_HashMapInt.html index 6a0316f544..1cece0681c 100644 --- a/docs/api/type_Belt_HashMapInt.html +++ b/docs/api/type_Belt_HashMapInt.html @@ -38,9 +38,10 @@   val toArray : 'Belt_HashMapInt.t -> (Belt_HashMapInt.key * 'a) array
      val keysToArray : 'Belt_HashMapInt.t -> Belt_HashMapInt.key array
      val valuesToArray : 'Belt_HashMapInt.t -> 'a array
    -  val ofArray : (Belt_HashMapInt.key * 'a) array -> 'Belt_HashMapInt.t
    +  val fromArray : (Belt_HashMapInt.key * 'a) array -> 'Belt_HashMapInt.t
      val mergeMany :
        'Belt_HashMapInt.t -> (Belt_HashMapInt.key * 'a) array -> unit
      val getBucketHistogram : 'Belt_HashMapInt.t -> int array
      val logStats : 'Belt_HashMapInt.t -> unit
    +  val ofArray : (Belt_HashMapInt.key * 'a) array -> 'Belt_HashMapInt.t
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_HashMapString.html b/docs/api/type_Belt_HashMapString.html index 7398f8ea06..19c947f4f6 100644 --- a/docs/api/type_Belt_HashMapString.html +++ b/docs/api/type_Belt_HashMapString.html @@ -41,10 +41,12 @@     'Belt_HashMapString.t -> (Belt_HashMapString.key * 'a) array
      val keysToArray : 'Belt_HashMapString.t -> Belt_HashMapString.key array
      val valuesToArray : 'Belt_HashMapString.t -> 'a array
    -  val ofArray :
    +  val fromArray :
        (Belt_HashMapString.key * 'a) array -> 'Belt_HashMapString.t
      val mergeMany :
        'Belt_HashMapString.t -> (Belt_HashMapString.key * 'a) array -> unit
      val getBucketHistogram : 'Belt_HashMapString.t -> int array
      val logStats : 'Belt_HashMapString.t -> unit
    +  val ofArray :
    +    (Belt_HashMapString.key * 'a) array -> 'Belt_HashMapString.t
    end \ No newline at end of file diff --git a/docs/api/type_Belt_HashSet.html b/docs/api/type_Belt_HashSet.html index 2cb67b824e..096c1741e8 100644 --- a/docs/api/type_Belt_HashSet.html +++ b/docs/api/type_Belt_HashSet.html @@ -31,6 +31,8 @@   val toArray : ('a, 'id) Belt_HashSet.t -> 'a array
      val ofArray :
        'a array -> id:('a, 'id) Belt_HashSet.id -> ('a, 'id) Belt_HashSet.t
    +  val fromArray :
    +    'a array -> id:('a, 'id) Belt_HashSet.id -> ('a, 'id) Belt_HashSet.t
      val mergeMany : ('a, 'id) Belt_HashSet.t -> 'a array -> unit
      val getBucketHistogram : ('a, 'b) Belt_HashSet.t -> int array
    end \ No newline at end of file diff --git a/docs/api/type_Belt_HashSetInt.html b/docs/api/type_Belt_HashSetInt.html index 77993fc145..4afef0f091 100644 --- a/docs/api/type_Belt_HashSetInt.html +++ b/docs/api/type_Belt_HashSetInt.html @@ -29,6 +29,7 @@   val logStats : Belt_HashSetInt.t -> unit
      val toArray : Belt_HashSetInt.t -> Belt_HashSetInt.key array
      val ofArray : Belt_HashSetInt.key array -> Belt_HashSetInt.t
    +  val fromArray : Belt_HashSetInt.key array -> Belt_HashSetInt.t
      val mergeMany : Belt_HashSetInt.t -> Belt_HashSetInt.key array -> unit
      val getBucketHistogram : Belt_HashSetInt.t -> int array
    end \ No newline at end of file diff --git a/docs/api/type_Belt_HashSetString.html b/docs/api/type_Belt_HashSetString.html index 70647928b7..66ca028dab 100644 --- a/docs/api/type_Belt_HashSetString.html +++ b/docs/api/type_Belt_HashSetString.html @@ -31,6 +31,7 @@   val logStats : Belt_HashSetString.t -> unit
      val toArray : Belt_HashSetString.t -> Belt_HashSetString.key array
      val ofArray : Belt_HashSetString.key array -> Belt_HashSetString.t
    +  val fromArray : Belt_HashSetString.key array -> Belt_HashSetString.t
      val mergeMany :
        Belt_HashSetString.t -> Belt_HashSetString.key array -> unit
      val getBucketHistogram : Belt_HashSetString.t -> int array
    diff --git a/docs/api/type_Belt_Id.MakeComparable.html b/docs/api/type_Belt_Id.MakeComparable.html new file mode 100644 index 0000000000..3989570ac4 --- /dev/null +++ b/docs/api/type_Belt_Id.MakeComparable.html @@ -0,0 +1,17 @@ + + + + + + + + + Belt_Id.MakeComparable + +functor
    +  (M : sig
    +         type t
    +         val cmp :
    +           Belt_Id.MakeComparable.t -> Belt_Id.MakeComparable.t -> int
    +       end->
    +  sig type identity type t = M.t val cmp : (t, identity) cmp end
    \ No newline at end of file diff --git a/docs/api/type_Belt_Id.MakeComparableU.html b/docs/api/type_Belt_Id.MakeComparableU.html new file mode 100644 index 0000000000..3c14b12ea7 --- /dev/null +++ b/docs/api/type_Belt_Id.MakeComparableU.html @@ -0,0 +1,18 @@ + + + + + + + + + Belt_Id.MakeComparableU + +functor
    +  (M : sig
    +         type t
    +         val cmp :
    +           (Belt_Id.MakeComparableU.t -> Belt_Id.MakeComparableU.t -> int
    +           [@bs])
    +       end->
    +  sig type identity type t = M.t val cmp : (t, identity) cmp end
    \ No newline at end of file diff --git a/docs/api/type_Belt_Id.MakeHashable.html b/docs/api/type_Belt_Id.MakeHashable.html new file mode 100644 index 0000000000..7f971e8845 --- /dev/null +++ b/docs/api/type_Belt_Id.MakeHashable.html @@ -0,0 +1,22 @@ + + + + + + + + + Belt_Id.MakeHashable + +functor
    +  (M : sig
    +         type t
    +         val hash : Belt_Id.MakeHashable.t -> int
    +         val eq : Belt_Id.MakeHashable.t -> Belt_Id.MakeHashable.t -> bool
    +       end->
    +  sig
    +    type identity
    +    type t = M.t
    +    val hash : (t, identity) hash
    +    val eq : (t, identity) eq
    +  end
    \ No newline at end of file diff --git a/docs/api/type_Belt_Id.MakeHashableU.html b/docs/api/type_Belt_Id.MakeHashableU.html new file mode 100644 index 0000000000..d2c4063942 --- /dev/null +++ b/docs/api/type_Belt_Id.MakeHashableU.html @@ -0,0 +1,23 @@ + + + + + + + + + Belt_Id.MakeHashableU + +functor
    +  (M : sig
    +         type t
    +         val hash : (Belt_Id.MakeHashableU.t -> int [@bs])
    +         val eq :
    +           (Belt_Id.MakeHashableU.t -> Belt_Id.MakeHashableU.t -> bool [@bs])
    +       end->
    +  sig
    +    type identity
    +    type t = M.t
    +    val hash : (t, identity) hash
    +    val eq : (t, identity) eq
    +  end
    \ No newline at end of file diff --git a/docs/api/type_Belt_Id.html b/docs/api/type_Belt_Id.html index f444809fbd..6939522063 100644 --- a/docs/api/type_Belt_Id.html +++ b/docs/api/type_Belt_Id.html @@ -21,6 +21,23 @@     end
      type ('key, 'id) comparable =
          (module Belt_Id.Comparable with type identity = 'id and type t = 'key)
    +  module MakeComparableU :
    +    functor
    +      (M : sig
    +             type t
    +             val cmp :
    +               (Belt_Id.MakeComparableU.t -> Belt_Id.MakeComparableU.t -> int
    +               [@bs])
    +           end->
    +      sig type identity type t = M.t val cmp : (t, identity) cmp end
    +  module MakeComparable :
    +    functor
    +      (M : sig
    +             type t
    +             val cmp :
    +               Belt_Id.MakeComparable.t -> Belt_Id.MakeComparable.t -> int
    +           end->
    +      sig type identity type t = M.t val cmp : (t, identity) cmp end
      val comparableU :
        cmp:('-> '-> int [@bs]) ->
        (module Belt_Id.Comparable with type t = 'a)
    @@ -35,6 +52,35 @@     end
      type ('key, 'id) hashable =
          (module Belt_Id.Hashable with type identity = 'id and type t = 'key)
    +  module MakeHashableU :
    +    functor
    +      (M : sig
    +             type t
    +             val hash : (Belt_Id.MakeHashableU.t -> int [@bs])
    +             val eq :
    +               (Belt_Id.MakeHashableU.t -> Belt_Id.MakeHashableU.t -> bool
    +               [@bs])
    +           end->
    +      sig
    +        type identity
    +        type t = M.t
    +        val hash : (t, identity) hash
    +        val eq : (t, identity) eq
    +      end
    +  module MakeHashable :
    +    functor
    +      (M : sig
    +             type t
    +             val hash : Belt_Id.MakeHashable.t -> int
    +             val eq :
    +               Belt_Id.MakeHashable.t -> Belt_Id.MakeHashable.t -> bool
    +           end->
    +      sig
    +        type identity
    +        type t = M.t
    +        val hash : (t, identity) hash
    +        val eq : (t, identity) eq
    +      end
      val hashableU :
        hash:('-> int [@bs]) ->
        eq:('-> '-> bool [@bs]) -> (module Belt_Id.Hashable with type t = 'a)
    diff --git a/docs/api/type_Belt_List.html b/docs/api/type_Belt_List.html index 93c49dae74..3860c18336 100644 --- a/docs/api/type_Belt_List.html +++ b/docs/api/type_Belt_List.html @@ -22,6 +22,7 @@   val make : int -> '-> 'Belt_List.t
      val makeByU : int -> (int -> 'a [@bs]) -> 'Belt_List.t
      val makeBy : int -> (int -> 'a) -> 'Belt_List.t
    +  val shuffle : 'Belt_List.t -> 'Belt_List.t
      val drop : 'Belt_List.t -> int -> 'Belt_List.t option
      val take : 'Belt_List.t -> int -> 'Belt_List.t option
      val splitAt : 'Belt_List.t -> int -> ('a list * 'a list) option
    @@ -41,6 +42,7 @@     'Belt_List.t -> (int -> '-> 'b [@bs]) -> 'Belt_List.t
      val mapWithIndex : 'Belt_List.t -> (int -> '-> 'b) -> 'Belt_List.t
      val ofArray : 'a array -> 'Belt_List.t
    +  val fromArray : 'a array -> 'Belt_List.t
      val toArray : 'Belt_List.t -> 'a array
      val reverse : 'Belt_List.t -> 'Belt_List.t
      val mapReverseU : 'Belt_List.t -> ('-> 'b [@bs]) -> 'Belt_List.t
    diff --git a/docs/api/type_Belt_Map.html b/docs/api/type_Belt_Map.html index 9db5aa4519..24ed280c4c 100644 --- a/docs/api/type_Belt_Map.html +++ b/docs/api/type_Belt_Map.html @@ -14,9 +14,9 @@   module Dict = Belt_MapDict
      type ('key, 'value, 'identity) t
      type ('key, 'id) id = ('key, 'id) Belt_Id.comparable
    -  val make : id:('k, 'id) Belt_Map.id -> ('k, 'a, 'id) Belt_Map.t
    +  val make : id:('k, 'id) Belt_Map.id -> ('k, 'v, 'id) Belt_Map.t
      val isEmpty : ('a, 'b, 'c) Belt_Map.t -> bool
    -  val has : ('k, 'a, 'id) Belt_Map.t -> '-> bool
    +  val has : ('k, 'v, 'id) Belt_Map.t -> '-> bool
      val cmpU :
        ('k, 'v, 'id) Belt_Map.t ->
        ('k, 'v, 'id) Belt_Map.t -> ('-> '-> int [@bs]) -> int
    @@ -24,90 +24,96 @@     ('k, 'v, 'id) Belt_Map.t ->
        ('k, 'v, 'id) Belt_Map.t -> ('-> '-> int) -> int
      val eqU :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('k, 'a, 'id) Belt_Map.t -> ('-> '-> bool [@bs]) -> bool
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('k, 'v, 'id) Belt_Map.t -> ('-> '-> bool [@bs]) -> bool
      val eq :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('k, 'a, 'id) Belt_Map.t -> ('-> '-> bool) -> bool
    -  val forEachU : ('k, 'a, 'id) Belt_Map.t -> ('-> '-> unit [@bs]) -> unit
    -  val forEach : ('k, 'a, 'id) Belt_Map.t -> ('-> '-> unit) -> unit
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('k, 'v, 'id) Belt_Map.t -> ('-> '-> bool) -> bool
    +  val forEachU : ('k, 'v, 'id) Belt_Map.t -> ('-> '-> unit [@bs]) -> unit
    +  val forEach : ('k, 'v, 'id) Belt_Map.t -> ('-> '-> unit) -> unit
      val reduceU :
    -    ('k, 'a, 'id) Belt_Map.t -> '-> ('-> '-> '-> 'b [@bs]) -> 'b
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    'acc -> ('acc -> '-> '-> 'acc [@bs]) -> 'acc
      val reduce :
    -    ('k, 'a, 'id) Belt_Map.t -> 'acc -> ('acc -> '-> '-> 'acc) -> 'acc
    -  val everyU : ('k, 'a, 'id) Belt_Map.t -> ('-> '-> bool [@bs]) -> bool
    -  val every : ('k, 'a, 'id) Belt_Map.t -> ('-> '-> bool) -> bool
    -  val someU : ('k, 'a, 'id) Belt_Map.t -> ('-> '-> bool [@bs]) -> bool
    -  val some : ('k, 'a, 'id) Belt_Map.t -> ('-> '-> bool) -> bool
    -  val size : ('k, 'a, 'id) Belt_Map.t -> int
    -  val toArray : ('k, 'a, 'id) Belt_Map.t -> ('k * 'a) array
    -  val toList : ('k, 'a, 'id) Belt_Map.t -> ('k * 'a) list
    +    ('k, 'v, 'id) Belt_Map.t -> 'acc -> ('acc -> '-> '-> 'acc) -> 'acc
    +  val everyU : ('k, 'v, 'id) Belt_Map.t -> ('-> '-> bool [@bs]) -> bool
    +  val every : ('k, 'v, 'id) Belt_Map.t -> ('-> '-> bool) -> bool
    +  val someU : ('k, 'v, 'id) Belt_Map.t -> ('-> '-> bool [@bs]) -> bool
    +  val some : ('k, 'v, 'id) Belt_Map.t -> ('-> '-> bool) -> bool
    +  val size : ('k, 'v, 'id) Belt_Map.t -> int
    +  val toArray : ('k, 'v, 'id) Belt_Map.t -> ('k * 'v) array
    +  val toList : ('k, 'v, 'id) Belt_Map.t -> ('k * 'v) list
      val ofArray :
    -    ('k * 'a) array -> id:('k, 'id) Belt_Map.id -> ('k, 'a, 'id) Belt_Map.t
    -  val keysToArray : ('k, 'a, 'id) Belt_Map.t -> 'k array
    -  val valuesToArray : ('k, 'a, 'id) Belt_Map.t -> 'a array
    +    ('k * 'v) array -> id:('k, 'id) Belt_Map.id -> ('k, 'v, 'id) Belt_Map.t
    +  val fromArray :
    +    ('k * 'v) array -> id:('k, 'id) Belt_Map.id -> ('k, 'v, 'id) Belt_Map.t
    +  val keysToArray : ('k, 'v, 'id) Belt_Map.t -> 'k array
    +  val valuesToArray : ('k, 'v, 'id) Belt_Map.t -> 'v array
      val minKey : ('k, 'a, 'b) Belt_Map.t -> 'k option
      val minKeyUndefined : ('k, 'a, 'b) Belt_Map.t -> 'Js.undefined
      val maxKey : ('k, 'a, 'b) Belt_Map.t -> 'k option
      val maxKeyUndefined : ('k, 'a, 'b) Belt_Map.t -> 'Js.undefined
    -  val minimum : ('k, 'a, 'b) Belt_Map.t -> ('k * 'a) option
    -  val minUndefined : ('k, 'a, 'b) Belt_Map.t -> ('k * 'a) Js.undefined
    -  val maximum : ('k, 'a, 'b) Belt_Map.t -> ('k * 'a) option
    -  val maxUndefined : ('k, 'a, 'b) Belt_Map.t -> ('k * 'a) Js.undefined
    -  val get : ('k, 'a, 'id) Belt_Map.t -> '-> 'a option
    -  val getUndefined : ('k, 'a, 'id) Belt_Map.t -> '-> 'Js.undefined
    -  val getWithDefault : ('k, 'a, 'id) Belt_Map.t -> '-> '-> 'a
    -  val getExn : ('k, 'a, 'id) Belt_Map.t -> '-> 'a
    -  val remove : ('k, 'a, 'id) Belt_Map.t -> '-> ('k, 'a, 'id) Belt_Map.t
    +  val minimum : ('k, 'v, 'a) Belt_Map.t -> ('k * 'v) option
    +  val minUndefined : ('k, 'v, 'a) Belt_Map.t -> ('k * 'v) Js.undefined
    +  val maximum : ('k, 'v, 'a) Belt_Map.t -> ('k * 'v) option
    +  val maxUndefined : ('k, 'v, 'a) Belt_Map.t -> ('k * 'v) Js.undefined
    +  val get : ('k, 'v, 'id) Belt_Map.t -> '-> 'v option
    +  val getUndefined : ('k, 'v, 'id) Belt_Map.t -> '-> 'Js.undefined
    +  val getWithDefault : ('k, 'v, 'id) Belt_Map.t -> '-> '-> 'v
    +  val getExn : ('k, 'v, 'id) Belt_Map.t -> '-> 'v
    +  val remove : ('k, 'v, 'id) Belt_Map.t -> '-> ('k, 'v, 'id) Belt_Map.t
      val removeMany :
    -    ('k, 'a, 'id) Belt_Map.t -> 'k array -> ('k, 'a, 'id) Belt_Map.t
    -  val set : ('k, 'a, 'id) Belt_Map.t -> '-> '-> ('k, 'a, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t -> 'k array -> ('k, 'v, 'id) Belt_Map.t
    +  val set : ('k, 'v, 'id) Belt_Map.t -> '-> '-> ('k, 'v, 'id) Belt_Map.t
      val updateU :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    '-> ('a option -> 'a option [@bs]) -> ('k, 'a, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    '-> ('v option -> 'v option [@bs]) -> ('k, 'v, 'id) Belt_Map.t
      val update :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    '-> ('a option -> 'a option) -> ('k, 'a, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    '-> ('v option -> 'v option) -> ('k, 'v, 'id) Belt_Map.t
      val mergeMany :
    -    ('k, 'a, 'id) Belt_Map.t -> ('k * 'a) array -> ('k, 'a, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t -> ('k * 'v) array -> ('k, 'v, 'id) Belt_Map.t
      val mergeU :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('k, 'b, 'id) Belt_Map.t ->
    -    ('-> 'a option -> 'b option -> 'c option [@bs]) ->
    -    ('k, 'c, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('k, 'v2, 'id) Belt_Map.t ->
    +    ('-> 'v option -> 'v2 option -> 'v3 option [@bs]) ->
    +    ('k, 'v3, 'id) Belt_Map.t
      val merge :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('k, 'b, 'id) Belt_Map.t ->
    -    ('-> 'a option -> 'b option -> 'c option) -> ('k, 'c, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('k, 'v2, 'id) Belt_Map.t ->
    +    ('-> 'v option -> 'v2 option -> 'v3 option) ->
    +    ('k, 'v3, 'id) Belt_Map.t
      val keepU :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('-> '-> bool [@bs]) -> ('k, 'a, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('-> '-> bool [@bs]) -> ('k, 'v, 'id) Belt_Map.t
      val keep :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('-> '-> bool) -> ('k, 'a, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('-> '-> bool) -> ('k, 'v, 'id) Belt_Map.t
      val partitionU :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('-> '-> bool [@bs]) ->
    -    ('k, 'a, 'id) Belt_Map.t * ('k, 'a, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('-> '-> bool [@bs]) ->
    +    ('k, 'v, 'id) Belt_Map.t * ('k, 'v, 'id) Belt_Map.t
      val partition :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('-> '-> bool) -> ('k, 'a, 'id) Belt_Map.t * ('k, 'a, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('-> '-> bool) -> ('k, 'v, 'id) Belt_Map.t * ('k, 'v, 'id) Belt_Map.t
      val split :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    '-> (('k, 'a, 'id) Belt_Map.t * ('k, 'a, 'id) Belt_Map.t) * 'a option
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    '-> (('k, 'v, 'id) Belt_Map.t * ('k, 'v, 'id) Belt_Map.t) * 'v option
      val mapU :
    -    ('k, 'a, 'id) Belt_Map.t -> ('-> 'b [@bs]) -> ('k, 'b, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('-> 'v2 [@bs]) -> ('k, 'v2, 'id) Belt_Map.t
      val map :
    -    ('k, 'a, 'id) Belt_Map.t -> ('-> 'b) -> ('k, 'b, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t -> ('-> 'v2) -> ('k, 'v2, 'id) Belt_Map.t
      val mapWithKeyU :
    -    ('k, 'a, 'id) Belt_Map.t ->
    -    ('-> '-> 'b [@bs]) -> ('k, 'b, 'id) Belt_Map.t
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('-> '-> 'v2 [@bs]) -> ('k, 'v2, 'id) Belt_Map.t
      val mapWithKey :
    -    ('k, 'a, 'id) Belt_Map.t -> ('-> '-> 'b) -> ('k, 'b, 'id) Belt_Map.t
    -  val getData : ('a, 'b, 'c) Belt_Map.t -> ('a, 'b, 'c) Belt_MapDict.t
    -  val getId : ('a, 'b, 'c) Belt_Map.t -> ('a, 'c) Belt_Map.id
    +    ('k, 'v, 'id) Belt_Map.t ->
    +    ('-> '-> 'v2) -> ('k, 'v2, 'id) Belt_Map.t
    +  val getData : ('k, 'v, 'id) Belt_Map.t -> ('k, 'v, 'id) Belt_MapDict.t
    +  val getId : ('k, 'v, 'id) Belt_Map.t -> ('k, 'id) Belt_Map.id
      val packIdData :
    -    id:('a, 'b) Belt_Map.id ->
    -    data:('a, 'c, 'b) Belt_MapDict.t -> ('a, 'c, 'b) Belt_Map.t
    +    id:('k, 'id) Belt_Map.id ->
    +    data:('k, 'v, 'id) Belt_MapDict.t -> ('k, 'v, 'id) Belt_Map.t
      val checkInvariantInternal : ('a, 'b, 'c) Belt_Map.t -> unit
    end \ No newline at end of file diff --git a/docs/api/type_Belt_MapDict.html b/docs/api/type_Belt_MapDict.html index 22c7427fc6..507776ee29 100644 --- a/docs/api/type_Belt_MapDict.html +++ b/docs/api/type_Belt_MapDict.html @@ -51,6 +51,9 @@   val ofArray :
        ('k * 'a) array ->
        cmp:('k, 'id) Belt_MapDict.cmp -> ('k, 'a, 'id) Belt_MapDict.t
    +  val fromArray :
    +    ('k * 'a) array ->
    +    cmp:('k, 'id) Belt_MapDict.cmp -> ('k, 'a, 'id) Belt_MapDict.t
      val keysToArray : ('k, 'a, 'id) Belt_MapDict.t -> 'k array
      val valuesToArray : ('k, 'a, 'id) Belt_MapDict.t -> 'a array
      val minKey : ('k, 'a, 'b) Belt_MapDict.t -> 'k option
    diff --git a/docs/api/type_Belt_MapInt.html b/docs/api/type_Belt_MapInt.html index e55b7bd60b..ac2f397aee 100644 --- a/docs/api/type_Belt_MapInt.html +++ b/docs/api/type_Belt_MapInt.html @@ -10,90 +10,92 @@ sig
      type key = int
    -  type 'a t
    -  val empty : 'Belt_MapInt.t
    -  val isEmpty : 'Belt_MapInt.t -> bool
    -  val has : 'Belt_MapInt.t -> Belt_MapInt.key -> bool
    +  type 'value t
    +  val empty : 'Belt_MapInt.t
    +  val isEmpty : 'Belt_MapInt.t -> bool
    +  val has : 'Belt_MapInt.t -> Belt_MapInt.key -> bool
      val cmpU :
    -    'Belt_MapInt.t -> 'Belt_MapInt.t -> ('-> '-> int [@bs]) -> int
    -  val cmp : 'Belt_MapInt.t -> 'Belt_MapInt.t -> ('-> '-> int) -> int
    +    'Belt_MapInt.t -> 'Belt_MapInt.t -> ('-> '-> int [@bs]) -> int
    +  val cmp : 'Belt_MapInt.t -> 'Belt_MapInt.t -> ('-> '-> int) -> int
      val eqU :
    -    'Belt_MapInt.t -> 'Belt_MapInt.t -> ('-> '-> bool [@bs]) -> bool
    -  val eq : 'Belt_MapInt.t -> 'Belt_MapInt.t -> ('-> '-> bool) -> bool
    +    'Belt_MapInt.t -> 'Belt_MapInt.t -> ('-> '-> bool [@bs]) -> bool
    +  val eq : 'Belt_MapInt.t -> 'Belt_MapInt.t -> ('-> '-> bool) -> bool
      val forEachU :
    -    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> unit [@bs]) -> unit
    -  val forEach : 'Belt_MapInt.t -> (Belt_MapInt.key -> '-> unit) -> unit
    +    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> unit [@bs]) -> unit
    +  val forEach : 'Belt_MapInt.t -> (Belt_MapInt.key -> '-> unit) -> unit
      val reduceU :
    -    'Belt_MapInt.t -> '-> ('-> Belt_MapInt.key -> '-> 'b [@bs]) -> 'b
    +    'Belt_MapInt.t ->
    +    'v2 -> ('v2 -> Belt_MapInt.key -> '-> 'v2 [@bs]) -> 'v2
      val reduce :
    -    'Belt_MapInt.t -> '-> ('-> Belt_MapInt.key -> '-> 'b) -> 'b
    +    'Belt_MapInt.t -> 'v2 -> ('v2 -> Belt_MapInt.key -> '-> 'v2) -> 'v2
      val everyU :
    -    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool [@bs]) -> bool
    -  val every : 'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool) -> bool
    +    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool [@bs]) -> bool
    +  val every : 'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool) -> bool
      val someU :
    -    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool [@bs]) -> bool
    -  val some : 'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool) -> bool
    -  val size : 'Belt_MapInt.t -> int
    -  val toList : 'Belt_MapInt.t -> (Belt_MapInt.key * 'a) list
    -  val toArray : 'Belt_MapInt.t -> (Belt_MapInt.key * 'a) array
    -  val ofArray : (Belt_MapInt.key * 'a) array -> 'Belt_MapInt.t
    -  val keysToArray : 'Belt_MapInt.t -> Belt_MapInt.key array
    -  val valuesToArray : 'Belt_MapInt.t -> 'a array
    +    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool [@bs]) -> bool
    +  val some : 'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool) -> bool
    +  val size : 'Belt_MapInt.t -> int
    +  val toList : 'Belt_MapInt.t -> (Belt_MapInt.key * 'v) list
    +  val toArray : 'Belt_MapInt.t -> (Belt_MapInt.key * 'v) array
    +  val ofArray : (Belt_MapInt.key * 'v) array -> 'Belt_MapInt.t
    +  val fromArray : (Belt_MapInt.key * 'v) array -> 'Belt_MapInt.t
    +  val keysToArray : 'Belt_MapInt.t -> Belt_MapInt.key array
    +  val valuesToArray : 'Belt_MapInt.t -> 'v array
      val minKey : 'Belt_MapInt.t -> Belt_MapInt.key option
      val minKeyUndefined : 'Belt_MapInt.t -> Belt_MapInt.key Js.undefined
      val maxKey : 'Belt_MapInt.t -> Belt_MapInt.key option
      val maxKeyUndefined : 'Belt_MapInt.t -> Belt_MapInt.key Js.undefined
    -  val minimum : 'Belt_MapInt.t -> (Belt_MapInt.key * 'a) option
    -  val minUndefined : 'Belt_MapInt.t -> (Belt_MapInt.key * 'a) Js.undefined
    -  val maximum : 'Belt_MapInt.t -> (Belt_MapInt.key * 'a) option
    -  val maxUndefined : 'Belt_MapInt.t -> (Belt_MapInt.key * 'a) Js.undefined
    -  val get : 'Belt_MapInt.t -> Belt_MapInt.key -> 'a option
    -  val getUndefined : 'Belt_MapInt.t -> Belt_MapInt.key -> 'Js.undefined
    -  val getWithDefault : 'Belt_MapInt.t -> Belt_MapInt.key -> '-> 'a
    -  val getExn : 'Belt_MapInt.t -> Belt_MapInt.key -> 'a
    -  val remove : 'Belt_MapInt.t -> Belt_MapInt.key -> 'Belt_MapInt.t
    +  val minimum : 'Belt_MapInt.t -> (Belt_MapInt.key * 'v) option
    +  val minUndefined : 'Belt_MapInt.t -> (Belt_MapInt.key * 'v) Js.undefined
    +  val maximum : 'Belt_MapInt.t -> (Belt_MapInt.key * 'v) option
    +  val maxUndefined : 'Belt_MapInt.t -> (Belt_MapInt.key * 'v) Js.undefined
    +  val get : 'Belt_MapInt.t -> Belt_MapInt.key -> 'v option
    +  val getUndefined : 'Belt_MapInt.t -> Belt_MapInt.key -> 'Js.undefined
    +  val getWithDefault : 'Belt_MapInt.t -> Belt_MapInt.key -> '-> 'v
    +  val getExn : 'Belt_MapInt.t -> Belt_MapInt.key -> 'v
    +  val remove : 'Belt_MapInt.t -> Belt_MapInt.key -> 'Belt_MapInt.t
      val removeMany :
    -    'Belt_MapInt.t -> Belt_MapInt.key array -> 'Belt_MapInt.t
    -  val set : 'Belt_MapInt.t -> Belt_MapInt.key -> '-> 'Belt_MapInt.t
    +    'Belt_MapInt.t -> Belt_MapInt.key array -> 'Belt_MapInt.t
    +  val set : 'Belt_MapInt.t -> Belt_MapInt.key -> '-> 'Belt_MapInt.t
      val updateU :
    -    'Belt_MapInt.t ->
    -    Belt_MapInt.key -> ('a option -> 'a option [@bs]) -> 'Belt_MapInt.t
    +    'Belt_MapInt.t ->
    +    Belt_MapInt.key -> ('v option -> 'v option [@bs]) -> 'Belt_MapInt.t
      val update :
    -    'Belt_MapInt.t ->
    -    Belt_MapInt.key -> ('a option -> 'a option) -> 'Belt_MapInt.t
    +    'Belt_MapInt.t ->
    +    Belt_MapInt.key -> ('v option -> 'v option) -> 'Belt_MapInt.t
      val mergeArray :
    -    'Belt_MapInt.t -> (Belt_MapInt.key * 'a) array -> 'Belt_MapInt.t
    +    'Belt_MapInt.t -> (Belt_MapInt.key * 'v) array -> 'Belt_MapInt.t
      val mergeU :
    -    'Belt_MapInt.t ->
    -    'Belt_MapInt.t ->
    -    (Belt_MapInt.key -> 'a option -> 'b option -> 'c option [@bs]) ->
    +    'Belt_MapInt.t ->
    +    'v2 Belt_MapInt.t ->
    +    (Belt_MapInt.key -> 'v option -> 'v2 option -> 'c option [@bs]) ->
        'Belt_MapInt.t
      val merge :
    -    'Belt_MapInt.t ->
    -    'Belt_MapInt.t ->
    -    (Belt_MapInt.key -> 'a option -> 'b option -> 'c option) ->
    +    'Belt_MapInt.t ->
    +    'v2 Belt_MapInt.t ->
    +    (Belt_MapInt.key -> 'v option -> 'v2 option -> 'c option) ->
        'Belt_MapInt.t
      val keepU :
    -    'Belt_MapInt.t ->
    -    (Belt_MapInt.key -> '-> bool [@bs]) -> 'Belt_MapInt.t
    +    'Belt_MapInt.t ->
    +    (Belt_MapInt.key -> '-> bool [@bs]) -> 'Belt_MapInt.t
      val keep :
    -    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool) -> 'Belt_MapInt.t
    +    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> bool) -> 'Belt_MapInt.t
      val partitionU :
    -    'Belt_MapInt.t ->
    -    (Belt_MapInt.key -> '-> bool [@bs]) ->
    -    'Belt_MapInt.t * 'Belt_MapInt.t
    +    'Belt_MapInt.t ->
    +    (Belt_MapInt.key -> '-> bool [@bs]) ->
    +    'Belt_MapInt.t * 'Belt_MapInt.t
      val partition :
    -    'Belt_MapInt.t ->
    -    (Belt_MapInt.key -> '-> bool) -> 'Belt_MapInt.t * 'Belt_MapInt.t
    +    'Belt_MapInt.t ->
    +    (Belt_MapInt.key -> '-> bool) -> 'Belt_MapInt.t * 'Belt_MapInt.t
      val split :
        Belt_MapInt.key ->
    -    'Belt_MapInt.t -> 'Belt_MapInt.t * 'a option * 'Belt_MapInt.t
    -  val mapU : 'Belt_MapInt.t -> ('-> 'b [@bs]) -> 'Belt_MapInt.t
    -  val map : 'Belt_MapInt.t -> ('-> 'b) -> 'Belt_MapInt.t
    +    'Belt_MapInt.t -> 'Belt_MapInt.t * 'v option * 'Belt_MapInt.t
    +  val mapU : 'Belt_MapInt.t -> ('-> 'v2 [@bs]) -> 'v2 Belt_MapInt.t
    +  val map : 'Belt_MapInt.t -> ('-> 'v2) -> 'v2 Belt_MapInt.t
      val mapWithKeyU :
    -    'Belt_MapInt.t ->
    -    (Belt_MapInt.key -> '-> 'b [@bs]) -> 'Belt_MapInt.t
    +    'Belt_MapInt.t ->
    +    (Belt_MapInt.key -> '-> 'v2 [@bs]) -> 'v2 Belt_MapInt.t
      val mapWithKey :
    -    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> 'b) -> 'Belt_MapInt.t
    +    'Belt_MapInt.t -> (Belt_MapInt.key -> '-> 'v2) -> 'v2 Belt_MapInt.t
      val checkInvariantInternal : 'Belt_MapInt.t -> unit
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_MapString.html b/docs/api/type_Belt_MapString.html index c10ec91c2d..2f55a8860d 100644 --- a/docs/api/type_Belt_MapString.html +++ b/docs/api/type_Belt_MapString.html @@ -10,111 +10,113 @@ sig
      type key = string
    -  type 'a t
    -  val empty : 'Belt_MapString.t
    -  val isEmpty : 'Belt_MapString.t -> bool
    -  val has : 'Belt_MapString.t -> Belt_MapString.key -> bool
    +  type 'value t
    +  val empty : 'Belt_MapString.t
    +  val isEmpty : 'Belt_MapString.t -> bool
    +  val has : 'Belt_MapString.t -> Belt_MapString.key -> bool
      val cmpU :
    -    'Belt_MapString.t ->
    -    'Belt_MapString.t -> ('-> '-> int [@bs]) -> int
    +    'Belt_MapString.t ->
    +    'Belt_MapString.t -> ('-> '-> int [@bs]) -> int
      val cmp :
    -    'Belt_MapString.t -> 'Belt_MapString.t -> ('-> '-> int) -> int
    +    'Belt_MapString.t -> 'Belt_MapString.t -> ('-> '-> int) -> int
      val eqU :
    -    'Belt_MapString.t ->
    -    'Belt_MapString.t -> ('-> '-> bool [@bs]) -> bool
    +    'Belt_MapString.t ->
    +    'Belt_MapString.t -> ('-> '-> bool [@bs]) -> bool
      val eq :
    -    'Belt_MapString.t -> 'Belt_MapString.t -> ('-> '-> bool) -> bool
    +    'Belt_MapString.t -> 'Belt_MapString.t -> ('-> '-> bool) -> bool
      val forEachU :
    -    'Belt_MapString.t -> (Belt_MapString.key -> '-> unit [@bs]) -> unit
    +    'Belt_MapString.t -> (Belt_MapString.key -> '-> unit [@bs]) -> unit
      val forEach :
    -    'Belt_MapString.t -> (Belt_MapString.key -> '-> unit) -> unit
    +    'Belt_MapString.t -> (Belt_MapString.key -> '-> unit) -> unit
      val reduceU :
    -    'Belt_MapString.t ->
    -    '-> ('-> Belt_MapString.key -> '-> 'b [@bs]) -> 'b
    +    'Belt_MapString.t ->
    +    'v2 -> ('v2 -> Belt_MapString.key -> '-> 'v2 [@bs]) -> 'v2
      val reduce :
    -    'Belt_MapString.t -> '-> ('-> Belt_MapString.key -> '-> 'b) -> 'b
    +    'Belt_MapString.t ->
    +    'v2 -> ('v2 -> Belt_MapString.key -> '-> 'v2) -> 'v2
      val everyU :
    -    'Belt_MapString.t -> (Belt_MapString.key -> '-> bool [@bs]) -> bool
    +    'Belt_MapString.t -> (Belt_MapString.key -> '-> bool [@bs]) -> bool
      val every :
    -    'Belt_MapString.t -> (Belt_MapString.key -> '-> bool) -> bool
    +    'Belt_MapString.t -> (Belt_MapString.key -> '-> bool) -> bool
      val someU :
    -    'Belt_MapString.t -> (Belt_MapString.key -> '-> bool [@bs]) -> bool
    +    'Belt_MapString.t -> (Belt_MapString.key -> '-> bool [@bs]) -> bool
      val some :
    -    'Belt_MapString.t -> (Belt_MapString.key -> '-> bool) -> bool
    -  val size : 'Belt_MapString.t -> int
    -  val toList : 'Belt_MapString.t -> (Belt_MapString.key * 'a) list
    -  val toArray : 'Belt_MapString.t -> (Belt_MapString.key * 'a) array
    -  val ofArray : (Belt_MapString.key * 'a) array -> 'Belt_MapString.t
    -  val keysToArray : 'Belt_MapString.t -> Belt_MapString.key array
    -  val valuesToArray : 'Belt_MapString.t -> 'a array
    +    'Belt_MapString.t -> (Belt_MapString.key -> '-> bool) -> bool
    +  val size : 'Belt_MapString.t -> int
    +  val toList : 'Belt_MapString.t -> (Belt_MapString.key * 'v) list
    +  val toArray : 'Belt_MapString.t -> (Belt_MapString.key * 'v) array
    +  val ofArray : (Belt_MapString.key * 'v) array -> 'Belt_MapString.t
    +  val fromArray : (Belt_MapString.key * 'v) array -> 'Belt_MapString.t
    +  val keysToArray : 'Belt_MapString.t -> Belt_MapString.key array
    +  val valuesToArray : 'Belt_MapString.t -> 'v array
      val minKey : 'Belt_MapString.t -> Belt_MapString.key option
      val minKeyUndefined :
        'Belt_MapString.t -> Belt_MapString.key Js.undefined
      val maxKey : 'Belt_MapString.t -> Belt_MapString.key option
      val maxKeyUndefined :
        'Belt_MapString.t -> Belt_MapString.key Js.undefined
    -  val minimum : 'Belt_MapString.t -> (Belt_MapString.key * 'a) option
    +  val minimum : 'Belt_MapString.t -> (Belt_MapString.key * 'v) option
      val minUndefined :
    -    'Belt_MapString.t -> (Belt_MapString.key * 'a) Js.undefined
    -  val maximum : 'Belt_MapString.t -> (Belt_MapString.key * 'a) option
    +    'Belt_MapString.t -> (Belt_MapString.key * 'v) Js.undefined
    +  val maximum : 'Belt_MapString.t -> (Belt_MapString.key * 'v) option
      val maxUndefined :
    -    'Belt_MapString.t -> (Belt_MapString.key * 'a) Js.undefined
    -  val get : 'Belt_MapString.t -> Belt_MapString.key -> 'a option
    +    'Belt_MapString.t -> (Belt_MapString.key * 'v) Js.undefined
    +  val get : 'Belt_MapString.t -> Belt_MapString.key -> 'v option
      val getUndefined :
    -    'Belt_MapString.t -> Belt_MapString.key -> 'Js.undefined
    -  val getWithDefault : 'Belt_MapString.t -> Belt_MapString.key -> '-> 'a
    -  val getExn : 'Belt_MapString.t -> Belt_MapString.key -> 'a
    +    'Belt_MapString.t -> Belt_MapString.key -> 'Js.undefined
    +  val getWithDefault : 'Belt_MapString.t -> Belt_MapString.key -> '-> 'v
    +  val getExn : 'Belt_MapString.t -> Belt_MapString.key -> 'v
      val remove :
    -    'Belt_MapString.t -> Belt_MapString.key -> 'Belt_MapString.t
    +    'Belt_MapString.t -> Belt_MapString.key -> 'Belt_MapString.t
      val removeMany :
    -    'Belt_MapString.t -> Belt_MapString.key array -> 'Belt_MapString.t
    +    'Belt_MapString.t -> Belt_MapString.key array -> 'Belt_MapString.t
      val set :
    -    'Belt_MapString.t -> Belt_MapString.key -> '-> 'Belt_MapString.t
    +    'Belt_MapString.t -> Belt_MapString.key -> '-> 'Belt_MapString.t
      val updateU :
    -    'Belt_MapString.t ->
    +    'Belt_MapString.t ->
        Belt_MapString.key ->
    -    ('a option -> 'a option [@bs]) -> 'Belt_MapString.t
    +    ('v option -> 'v option [@bs]) -> 'Belt_MapString.t
      val update :
    -    'Belt_MapString.t ->
    -    Belt_MapString.key -> ('a option -> 'a option) -> 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    Belt_MapString.key -> ('v option -> 'v option) -> 'Belt_MapString.t
      val mergeArray :
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key * 'a) array -> 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    (Belt_MapString.key * 'v) array -> 'Belt_MapString.t
      val mergeU :
    -    'Belt_MapString.t ->
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key -> 'a option -> 'b option -> 'c option [@bs]) ->
    +    'Belt_MapString.t ->
    +    'v2 Belt_MapString.t ->
    +    (Belt_MapString.key -> 'v option -> 'v2 option -> 'c option [@bs]) ->
        'Belt_MapString.t
      val merge :
    -    'Belt_MapString.t ->
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key -> 'a option -> 'b option -> 'c option) ->
    +    'Belt_MapString.t ->
    +    'v2 Belt_MapString.t ->
    +    (Belt_MapString.key -> 'v option -> 'v2 option -> 'c option) ->
        'Belt_MapString.t
      val keepU :
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key -> '-> bool [@bs]) -> 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    (Belt_MapString.key -> '-> bool [@bs]) -> 'Belt_MapString.t
      val keep :
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key -> '-> bool) -> 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    (Belt_MapString.key -> '-> bool) -> 'Belt_MapString.t
      val partitionU :
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key -> '-> bool [@bs]) ->
    -    'Belt_MapString.t * 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    (Belt_MapString.key -> '-> bool [@bs]) ->
    +    'Belt_MapString.t * 'Belt_MapString.t
      val partition :
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key -> '-> bool) ->
    -    'Belt_MapString.t * 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    (Belt_MapString.key -> '-> bool) ->
    +    'Belt_MapString.t * 'Belt_MapString.t
      val split :
        Belt_MapString.key ->
    -    'Belt_MapString.t ->
    -    'Belt_MapString.t * 'a option * 'Belt_MapString.t
    -  val mapU : 'Belt_MapString.t -> ('-> 'b [@bs]) -> 'Belt_MapString.t
    -  val map : 'Belt_MapString.t -> ('-> 'b) -> 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    'Belt_MapString.t * 'v option * 'Belt_MapString.t
    +  val mapU : 'Belt_MapString.t -> ('-> 'v2 [@bs]) -> 'v2 Belt_MapString.t
    +  val map : 'Belt_MapString.t -> ('-> 'v2) -> 'v2 Belt_MapString.t
      val mapWithKeyU :
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key -> '-> 'b [@bs]) -> 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    (Belt_MapString.key -> '-> 'v2 [@bs]) -> 'v2 Belt_MapString.t
      val mapWithKey :
    -    'Belt_MapString.t ->
    -    (Belt_MapString.key -> '-> 'b) -> 'Belt_MapString.t
    +    'Belt_MapString.t ->
    +    (Belt_MapString.key -> '-> 'v2) -> 'v2 Belt_MapString.t
      val checkInvariantInternal : 'Belt_MapString.t -> unit
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_MutableMap.html b/docs/api/type_Belt_MutableMap.html index 9c9ddbebb1..f72e32c516 100644 --- a/docs/api/type_Belt_MutableMap.html +++ b/docs/api/type_Belt_MutableMap.html @@ -47,7 +47,7 @@   val size : ('k, 'a, 'id) Belt_MutableMap.t -> int
      val toList : ('k, 'a, 'id) Belt_MutableMap.t -> ('k * 'a) list
      val toArray : ('k, 'a, 'id) Belt_MutableMap.t -> ('k * 'a) array
    -  val ofArray :
    +  val fromArray :
        ('k * 'a) array ->
        id:('k, 'id) Belt_MutableMap.id -> ('k, 'a, 'id) Belt_MutableMap.t
      val keysToArray : ('k, 'a, 'b) Belt_MutableMap.t -> 'k array
    @@ -65,6 +65,9 @@   val getWithDefault : ('k, 'a, 'id) Belt_MutableMap.t -> '-> '-> 'a
      val getExn : ('k, 'a, 'id) Belt_MutableMap.t -> '-> 'a
      val checkInvariantInternal : ('a, 'b, 'c) Belt_MutableMap.t -> unit
    +  val ofArray :
    +    ('k * 'a) array ->
    +    id:('k, 'id) Belt_MutableMap.id -> ('k, 'a, 'id) Belt_MutableMap.t
      val remove : ('k, 'a, 'id) Belt_MutableMap.t -> '-> unit
      val removeMany : ('k, 'a, 'id) Belt_MutableMap.t -> 'k array -> unit
      val set : ('k, 'a, 'id) Belt_MutableMap.t -> '-> '-> unit
    diff --git a/docs/api/type_Belt_MutableMapInt.html b/docs/api/type_Belt_MutableMapInt.html index 90c5f79c6b..a98759e7a2 100644 --- a/docs/api/type_Belt_MutableMapInt.html +++ b/docs/api/type_Belt_MutableMapInt.html @@ -54,6 +54,8 @@     'Belt_MutableMapInt.t -> (Belt_MutableMapInt.key * 'a) array
      val ofArray :
        (Belt_MutableMapInt.key * 'a) array -> 'Belt_MutableMapInt.t
    +  val fromArray :
    +    (Belt_MutableMapInt.key * 'a) array -> 'Belt_MutableMapInt.t
      val keysToArray : 'Belt_MutableMapInt.t -> Belt_MutableMapInt.key array
      val valuesToArray : 'Belt_MutableMapInt.t -> 'a array
      val minKey : 'Belt_MutableMapInt.t -> Belt_MutableMapInt.key option
    diff --git a/docs/api/type_Belt_MutableMapString.html b/docs/api/type_Belt_MutableMapString.html index 0ff5831995..7b1963237f 100644 --- a/docs/api/type_Belt_MutableMapString.html +++ b/docs/api/type_Belt_MutableMapString.html @@ -58,6 +58,8 @@     'Belt_MutableMapString.t -> (Belt_MutableMapString.key * 'a) array
      val ofArray :
        (Belt_MutableMapString.key * 'a) array -> 'Belt_MutableMapString.t
    +  val fromArray :
    +    (Belt_MutableMapString.key * 'a) array -> 'Belt_MutableMapString.t
      val keysToArray :
        'Belt_MutableMapString.t -> Belt_MutableMapString.key array
      val valuesToArray : 'Belt_MutableMapString.t -> 'a array
    diff --git a/docs/api/type_Belt_MutableQueue.html b/docs/api/type_Belt_MutableQueue.html index e5bb70bc1f..9c90aa273d 100644 --- a/docs/api/type_Belt_MutableQueue.html +++ b/docs/api/type_Belt_MutableQueue.html @@ -14,6 +14,7 @@   val clear : 'Belt_MutableQueue.t -> unit
      val isEmpty : 'Belt_MutableQueue.t -> bool
      val ofArray : 'a array -> 'Belt_MutableQueue.t
    +  val fromArray : 'a array -> 'Belt_MutableQueue.t
      val add : 'Belt_MutableQueue.t -> '-> unit
      val peek : 'Belt_MutableQueue.t -> 'a option
      val peekUndefined : 'Belt_MutableQueue.t -> 'Js.undefined
    diff --git a/docs/api/type_Belt_MutableSet.html b/docs/api/type_Belt_MutableSet.html index 0dcc59637e..37fa4c2cce 100644 --- a/docs/api/type_Belt_MutableSet.html +++ b/docs/api/type_Belt_MutableSet.html @@ -14,76 +14,87 @@   type ('k, 'id) t
      type ('k, 'id) id = ('k, 'id) Belt_Id.comparable
      val make :
    -    id:('elt, 'id) Belt_MutableSet.id -> ('elt, 'id) Belt_MutableSet.t
    -  val ofArray :
    +    id:('value, 'id) Belt_MutableSet.id -> ('value, 'id) Belt_MutableSet.t
    +  val fromArray :
        'k array ->
        id:('k, 'id) Belt_MutableSet.id -> ('k, 'id) Belt_MutableSet.t
    -  val ofSortedArrayUnsafe :
    -    'elt array ->
    -    id:('elt, 'id) Belt_MutableSet.id -> ('elt, 'id) Belt_MutableSet.t
    +  val fromSortedArrayUnsafe :
    +    'value array ->
    +    id:('value, 'id) Belt_MutableSet.id -> ('value, 'id) Belt_MutableSet.t
      val copy : ('k, 'id) Belt_MutableSet.t -> ('k, 'id) Belt_MutableSet.t
      val isEmpty : ('a, 'b) Belt_MutableSet.t -> bool
    -  val has : ('elt, 'a) Belt_MutableSet.t -> 'elt -> bool
    -  val add : ('elt, 'id) Belt_MutableSet.t -> 'elt -> unit
    -  val addCheck : ('elt, 'id) Belt_MutableSet.t -> 'elt -> bool
    -  val mergeMany : ('elt, 'id) Belt_MutableSet.t -> 'elt array -> unit
    -  val remove : ('elt, 'id) Belt_MutableSet.t -> 'elt -> unit
    -  val removeCheck : ('elt, 'id) Belt_MutableSet.t -> 'elt -> bool
    -  val removeMany : ('elt, 'id) Belt_MutableSet.t -> 'elt array -> unit
    +  val has : ('value, 'a) Belt_MutableSet.t -> 'value -> bool
    +  val add : ('value, 'id) Belt_MutableSet.t -> 'value -> unit
    +  val addCheck : ('value, 'id) Belt_MutableSet.t -> 'value -> bool
    +  val mergeMany : ('value, 'id) Belt_MutableSet.t -> 'value array -> unit
    +  val remove : ('value, 'id) Belt_MutableSet.t -> 'value -> unit
    +  val removeCheck : ('value, 'id) Belt_MutableSet.t -> 'value -> bool
    +  val removeMany : ('value, 'id) Belt_MutableSet.t -> 'value array -> unit
      val union :
    -    ('elt, 'id) Belt_MutableSet.t ->
    -    ('elt, 'id) Belt_MutableSet.t -> ('elt, 'id) Belt_MutableSet.t
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value, 'id) Belt_MutableSet.t -> ('value, 'id) Belt_MutableSet.t
      val intersect :
    -    ('elt, 'id) Belt_MutableSet.t ->
    -    ('elt, 'id) Belt_MutableSet.t -> ('elt, 'id) Belt_MutableSet.t
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value, 'id) Belt_MutableSet.t -> ('value, 'id) Belt_MutableSet.t
      val diff :
    -    ('elt, 'id) Belt_MutableSet.t ->
    -    ('elt, 'id) Belt_MutableSet.t -> ('elt, 'id) Belt_MutableSet.t
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value, 'id) Belt_MutableSet.t -> ('value, 'id) Belt_MutableSet.t
      val subset :
    -    ('elt, 'id) Belt_MutableSet.t -> ('elt, 'id) Belt_MutableSet.t -> bool
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value, 'id) Belt_MutableSet.t -> bool
      val cmp :
    -    ('elt, 'id) Belt_MutableSet.t -> ('elt, 'id) Belt_MutableSet.t -> int
    +    ('value, 'id) Belt_MutableSet.t -> ('value, 'id) Belt_MutableSet.t -> int
      val eq :
    -    ('elt, 'id) Belt_MutableSet.t -> ('elt, 'id) Belt_MutableSet.t -> bool
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value, 'id) Belt_MutableSet.t -> bool
      val forEachU :
    -    ('elt, 'id) Belt_MutableSet.t -> ('elt -> unit [@bs]) -> unit
    -  val forEach : ('elt, 'id) Belt_MutableSet.t -> ('elt -> unit) -> unit
    +    ('value, 'id) Belt_MutableSet.t -> ('value -> unit [@bs]) -> unit
    +  val forEach : ('value, 'id) Belt_MutableSet.t -> ('value -> unit) -> unit
      val reduceU :
    -    ('elt, 'id) Belt_MutableSet.t -> '-> ('-> 'elt -> 'a [@bs]) -> 'a
    +    ('value, 'id) Belt_MutableSet.t -> '-> ('-> 'value -> 'a [@bs]) -> 'a
      val reduce :
    -    ('elt, 'id) Belt_MutableSet.t -> '-> ('-> 'elt -> 'a) -> 'a
    -  val everyU : ('elt, 'id) Belt_MutableSet.t -> ('elt -> bool [@bs]) -> bool
    -  val every : ('elt, 'id) Belt_MutableSet.t -> ('elt -> bool) -> bool
    -  val someU : ('elt, 'id) Belt_MutableSet.t -> ('elt -> bool [@bs]) -> bool
    -  val some : ('elt, 'id) Belt_MutableSet.t -> ('elt -> bool) -> bool
    +    ('value, 'id) Belt_MutableSet.t -> '-> ('-> 'value -> 'a) -> 'a
    +  val everyU :
    +    ('value, 'id) Belt_MutableSet.t -> ('value -> bool [@bs]) -> bool
    +  val every : ('value, 'id) Belt_MutableSet.t -> ('value -> bool) -> bool
    +  val someU :
    +    ('value, 'id) Belt_MutableSet.t -> ('value -> bool [@bs]) -> bool
    +  val some : ('value, 'id) Belt_MutableSet.t -> ('value -> bool) -> bool
      val keepU :
    -    ('elt, 'id) Belt_MutableSet.t ->
    -    ('elt -> bool [@bs]) -> ('elt, 'id) Belt_MutableSet.t
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value -> bool [@bs]) -> ('value, 'id) Belt_MutableSet.t
      val keep :
    -    ('elt, 'id) Belt_MutableSet.t ->
    -    ('elt -> bool) -> ('elt, 'id) Belt_MutableSet.t
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value -> bool) -> ('value, 'id) Belt_MutableSet.t
      val partitionU :
    -    ('elt, 'id) Belt_MutableSet.t ->
    -    ('elt -> bool [@bs]) ->
    -    ('elt, 'id) Belt_MutableSet.t * ('elt, 'id) Belt_MutableSet.t
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value -> bool [@bs]) ->
    +    ('value, 'id) Belt_MutableSet.t * ('value, 'id) Belt_MutableSet.t
      val partition :
    -    ('elt, 'id) Belt_MutableSet.t ->
    -    ('elt -> bool) ->
    -    ('elt, 'id) Belt_MutableSet.t * ('elt, 'id) Belt_MutableSet.t
    -  val size : ('elt, 'id) Belt_MutableSet.t -> int
    -  val toList : ('elt, 'id) Belt_MutableSet.t -> 'elt list
    -  val toArray : ('elt, 'id) Belt_MutableSet.t -> 'elt array
    -  val minimum : ('elt, 'id) Belt_MutableSet.t -> 'elt option
    -  val minUndefined : ('elt, 'id) Belt_MutableSet.t -> 'elt Js.undefined
    -  val maximum : ('elt, 'id) Belt_MutableSet.t -> 'elt option
    -  val maxUndefined : ('elt, 'id) Belt_MutableSet.t -> 'elt Js.undefined
    -  val get : ('elt, 'id) Belt_MutableSet.t -> 'elt -> 'elt option
    +    ('value, 'id) Belt_MutableSet.t ->
    +    ('value -> bool) ->
    +    ('value, 'id) Belt_MutableSet.t * ('value, 'id) Belt_MutableSet.t
    +  val size : ('value, 'id) Belt_MutableSet.t -> int
    +  val toList : ('value, 'id) Belt_MutableSet.t -> 'value list
    +  val toArray : ('value, 'id) Belt_MutableSet.t -> 'value array
    +  val minimum : ('value, 'id) Belt_MutableSet.t -> 'value option
    +  val minUndefined : ('value, 'id) Belt_MutableSet.t -> 'value Js.undefined
    +  val maximum : ('value, 'id) Belt_MutableSet.t -> 'value option
    +  val maxUndefined : ('value, 'id) Belt_MutableSet.t -> 'value Js.undefined
    +  val get : ('value, 'id) Belt_MutableSet.t -> 'value -> 'value option
      val getUndefined :
    -    ('elt, 'id) Belt_MutableSet.t -> 'elt -> 'elt Js.undefined
    -  val getExn : ('elt, 'id) Belt_MutableSet.t -> 'elt -> 'elt
    +    ('value, 'id) Belt_MutableSet.t -> 'value -> 'value Js.undefined
    +  val getExn : ('value, 'id) Belt_MutableSet.t -> 'value -> 'value
      val split :
    -    ('elt, 'id) Belt_MutableSet.t ->
    -    'elt ->
    -    (('elt, 'id) Belt_MutableSet.t * ('elt, 'id) Belt_MutableSet.t) * bool
    +    ('value, 'id) Belt_MutableSet.t ->
    +    'value ->
    +    (('value, 'id) Belt_MutableSet.t * ('value, 'id) Belt_MutableSet.t) *
    +    bool
      val checkInvariantInternal : ('a, 'b) Belt_MutableSet.t -> unit
    +  val ofArray :
    +    'k array ->
    +    id:('k, 'id) Belt_MutableSet.id -> ('k, 'id) Belt_MutableSet.t
    +  val ofSortedArrayUnsafe :
    +    'value array ->
    +    id:('value, 'id) Belt_MutableSet.id -> ('value, 'id) Belt_MutableSet.t
    end \ No newline at end of file diff --git a/docs/api/type_Belt_MutableSetInt.html b/docs/api/type_Belt_MutableSetInt.html index 9dde344cad..92f8209c1c 100644 --- a/docs/api/type_Belt_MutableSetInt.html +++ b/docs/api/type_Belt_MutableSetInt.html @@ -9,23 +9,26 @@ Belt_MutableSetInt sig
    -  type elt = int
    +  type value = int
      type t
      val make : unit -> Belt_MutableSetInt.t
    -  val ofArray : Belt_MutableSetInt.elt array -> Belt_MutableSetInt.t
    +  val fromArray : Belt_MutableSetInt.value array -> Belt_MutableSetInt.t
    +  val fromSortedArrayUnsafe :
    +    Belt_MutableSetInt.value array -> Belt_MutableSetInt.t
    +  val ofArray : Belt_MutableSetInt.value array -> Belt_MutableSetInt.t
      val ofSortedArrayUnsafe :
    -    Belt_MutableSetInt.elt array -> Belt_MutableSetInt.t
    +    Belt_MutableSetInt.value array -> Belt_MutableSetInt.t
      val copy : Belt_MutableSetInt.t -> Belt_MutableSetInt.t
      val isEmpty : Belt_MutableSetInt.t -> bool
    -  val has : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt -> bool
    -  val add : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt -> unit
    -  val addCheck : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt -> bool
    +  val has : Belt_MutableSetInt.t -> Belt_MutableSetInt.value -> bool
    +  val add : Belt_MutableSetInt.t -> Belt_MutableSetInt.value -> unit
    +  val addCheck : Belt_MutableSetInt.t -> Belt_MutableSetInt.value -> bool
      val mergeMany :
    -    Belt_MutableSetInt.t -> Belt_MutableSetInt.elt array -> unit
    -  val remove : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt -> unit
    -  val removeCheck : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt -> bool
    +    Belt_MutableSetInt.t -> Belt_MutableSetInt.value array -> unit
    +  val remove : Belt_MutableSetInt.t -> Belt_MutableSetInt.value -> unit
    +  val removeCheck : Belt_MutableSetInt.t -> Belt_MutableSetInt.value -> bool
      val removeMany :
    -    Belt_MutableSetInt.t -> Belt_MutableSetInt.elt array -> unit
    +    Belt_MutableSetInt.t -> Belt_MutableSetInt.value array -> unit
      val union :
        Belt_MutableSetInt.t -> Belt_MutableSetInt.t -> Belt_MutableSetInt.t
      val intersect :
    @@ -36,55 +39,58 @@   val cmp : Belt_MutableSetInt.t -> Belt_MutableSetInt.t -> int
      val eq : Belt_MutableSetInt.t -> Belt_MutableSetInt.t -> bool
      val forEachU :
    -    Belt_MutableSetInt.t -> (Belt_MutableSetInt.elt -> unit [@bs]) -> unit
    +    Belt_MutableSetInt.t -> (Belt_MutableSetInt.value -> unit [@bs]) -> unit
      val forEach :
    -    Belt_MutableSetInt.t -> (Belt_MutableSetInt.elt -> unit) -> unit
    +    Belt_MutableSetInt.t -> (Belt_MutableSetInt.value -> unit) -> unit
      val reduceU :
        Belt_MutableSetInt.t ->
    -    '-> ('-> Belt_MutableSetInt.elt -> 'a [@bs]) -> 'a
    +    '-> ('-> Belt_MutableSetInt.value -> 'a [@bs]) -> 'a
      val reduce :
    -    Belt_MutableSetInt.t -> '-> ('-> Belt_MutableSetInt.elt -> 'a) -> 'a
    +    Belt_MutableSetInt.t ->
    +    '-> ('-> Belt_MutableSetInt.value -> 'a) -> 'a
      val everyU :
    -    Belt_MutableSetInt.t -> (Belt_MutableSetInt.elt -> bool [@bs]) -> bool
    +    Belt_MutableSetInt.t -> (Belt_MutableSetInt.value -> bool [@bs]) -> bool
      val every :
    -    Belt_MutableSetInt.t -> (Belt_MutableSetInt.elt -> bool) -> bool
    +    Belt_MutableSetInt.t -> (Belt_MutableSetInt.value -> bool) -> bool
      val someU :
    -    Belt_MutableSetInt.t -> (Belt_MutableSetInt.elt -> bool [@bs]) -> bool
    -  val some : Belt_MutableSetInt.t -> (Belt_MutableSetInt.elt -> bool) -> bool
    +    Belt_MutableSetInt.t -> (Belt_MutableSetInt.value -> bool [@bs]) -> bool
    +  val some :
    +    Belt_MutableSetInt.t -> (Belt_MutableSetInt.value -> bool) -> bool
      val keepU :
        Belt_MutableSetInt.t ->
    -    (Belt_MutableSetInt.elt -> bool [@bs]) -> Belt_MutableSetInt.t
    +    (Belt_MutableSetInt.value -> bool [@bs]) -> Belt_MutableSetInt.t
      val keep :
        Belt_MutableSetInt.t ->
    -    (Belt_MutableSetInt.elt -> bool) -> Belt_MutableSetInt.t
    +    (Belt_MutableSetInt.value -> bool) -> Belt_MutableSetInt.t
      val partitionU :
        Belt_MutableSetInt.t ->
    -    (Belt_MutableSetInt.elt -> bool [@bs]) ->
    +    (Belt_MutableSetInt.value -> bool [@bs]) ->
        Belt_MutableSetInt.t * Belt_MutableSetInt.t
      val partition :
        Belt_MutableSetInt.t ->
    -    (Belt_MutableSetInt.elt -> bool) ->
    +    (Belt_MutableSetInt.value -> bool) ->
        Belt_MutableSetInt.t * Belt_MutableSetInt.t
      val size : Belt_MutableSetInt.t -> int
    -  val toList : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt list
    -  val toArray : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt array
    -  val minimum : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt option
    +  val toList : Belt_MutableSetInt.t -> Belt_MutableSetInt.value list
    +  val toArray : Belt_MutableSetInt.t -> Belt_MutableSetInt.value array
    +  val minimum : Belt_MutableSetInt.t -> Belt_MutableSetInt.value option
      val minUndefined :
    -    Belt_MutableSetInt.t -> Belt_MutableSetInt.elt Js.undefined
    -  val maximum : Belt_MutableSetInt.t -> Belt_MutableSetInt.elt option
    +    Belt_MutableSetInt.t -> Belt_MutableSetInt.value Js.undefined
    +  val maximum : Belt_MutableSetInt.t -> Belt_MutableSetInt.value option
      val maxUndefined :
    -    Belt_MutableSetInt.t -> Belt_MutableSetInt.elt Js.undefined
    +    Belt_MutableSetInt.t -> Belt_MutableSetInt.value Js.undefined
      val get :
        Belt_MutableSetInt.t ->
    -    Belt_MutableSetInt.elt -> Belt_MutableSetInt.elt option
    +    Belt_MutableSetInt.value -> Belt_MutableSetInt.value option
      val getUndefined :
        Belt_MutableSetInt.t ->
    -    Belt_MutableSetInt.elt -> Belt_MutableSetInt.elt Js.undefined
    +    Belt_MutableSetInt.value -> Belt_MutableSetInt.value Js.undefined
      val getExn :
    -    Belt_MutableSetInt.t -> Belt_MutableSetInt.elt -> Belt_MutableSetInt.elt
    +    Belt_MutableSetInt.t ->
    +    Belt_MutableSetInt.value -> Belt_MutableSetInt.value
      val split :
        Belt_MutableSetInt.t ->
    -    Belt_MutableSetInt.elt ->
    +    Belt_MutableSetInt.value ->
        (Belt_MutableSetInt.t * Belt_MutableSetInt.t) * bool
      val checkInvariantInternal : Belt_MutableSetInt.t -> unit
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_MutableSetString.html b/docs/api/type_Belt_MutableSetString.html index c5c1052ff3..4cc083abad 100644 --- a/docs/api/type_Belt_MutableSetString.html +++ b/docs/api/type_Belt_MutableSetString.html @@ -9,24 +9,29 @@ Belt_MutableSetString sig
    -  type elt = string
    +  type value = string
      type t
      val make : unit -> Belt_MutableSetString.t
    -  val ofArray : Belt_MutableSetString.elt array -> Belt_MutableSetString.t
    +  val fromArray :
    +    Belt_MutableSetString.value array -> Belt_MutableSetString.t
    +  val fromSortedArrayUnsafe :
    +    Belt_MutableSetString.value array -> Belt_MutableSetString.t
    +  val ofArray : Belt_MutableSetString.value array -> Belt_MutableSetString.t
      val ofSortedArrayUnsafe :
    -    Belt_MutableSetString.elt array -> Belt_MutableSetString.t
    +    Belt_MutableSetString.value array -> Belt_MutableSetString.t
      val copy : Belt_MutableSetString.t -> Belt_MutableSetString.t
      val isEmpty : Belt_MutableSetString.t -> bool
    -  val has : Belt_MutableSetString.t -> Belt_MutableSetString.elt -> bool
    -  val add : Belt_MutableSetString.t -> Belt_MutableSetString.elt -> unit
    -  val addCheck : Belt_MutableSetString.t -> Belt_MutableSetString.elt -> bool
    +  val has : Belt_MutableSetString.t -> Belt_MutableSetString.value -> bool
    +  val add : Belt_MutableSetString.t -> Belt_MutableSetString.value -> unit
    +  val addCheck :
    +    Belt_MutableSetString.t -> Belt_MutableSetString.value -> bool
      val mergeMany :
    -    Belt_MutableSetString.t -> Belt_MutableSetString.elt array -> unit
    -  val remove : Belt_MutableSetString.t -> Belt_MutableSetString.elt -> unit
    +    Belt_MutableSetString.t -> Belt_MutableSetString.value array -> unit
    +  val remove : Belt_MutableSetString.t -> Belt_MutableSetString.value -> unit
      val removeCheck :
    -    Belt_MutableSetString.t -> Belt_MutableSetString.elt -> bool
    +    Belt_MutableSetString.t -> Belt_MutableSetString.value -> bool
      val removeMany :
    -    Belt_MutableSetString.t -> Belt_MutableSetString.elt array -> unit
    +    Belt_MutableSetString.t -> Belt_MutableSetString.value array -> unit
      val union :
        Belt_MutableSetString.t ->
        Belt_MutableSetString.t -> Belt_MutableSetString.t
    @@ -41,60 +46,60 @@   val eq : Belt_MutableSetString.t -> Belt_MutableSetString.t -> bool
      val forEachU :
        Belt_MutableSetString.t ->
    -    (Belt_MutableSetString.elt -> unit [@bs]) -> unit
    +    (Belt_MutableSetString.value -> unit [@bs]) -> unit
      val forEach :
    -    Belt_MutableSetString.t -> (Belt_MutableSetString.elt -> unit) -> unit
    +    Belt_MutableSetString.t -> (Belt_MutableSetString.value -> unit) -> unit
      val reduceU :
        Belt_MutableSetString.t ->
    -    '-> ('-> Belt_MutableSetString.elt -> 'a [@bs]) -> 'a
    +    '-> ('-> Belt_MutableSetString.value -> 'a [@bs]) -> 'a
      val reduce :
        Belt_MutableSetString.t ->
    -    '-> ('-> Belt_MutableSetString.elt -> 'a) -> 'a
    +    '-> ('-> Belt_MutableSetString.value -> 'a) -> 'a
      val everyU :
        Belt_MutableSetString.t ->
    -    (Belt_MutableSetString.elt -> bool [@bs]) -> bool
    +    (Belt_MutableSetString.value -> bool [@bs]) -> bool
      val every :
    -    Belt_MutableSetString.t -> (Belt_MutableSetString.elt -> bool) -> bool
    +    Belt_MutableSetString.t -> (Belt_MutableSetString.value -> bool) -> bool
      val someU :
        Belt_MutableSetString.t ->
    -    (Belt_MutableSetString.elt -> bool [@bs]) -> bool
    +    (Belt_MutableSetString.value -> bool [@bs]) -> bool
      val some :
    -    Belt_MutableSetString.t -> (Belt_MutableSetString.elt -> bool) -> bool
    +    Belt_MutableSetString.t -> (Belt_MutableSetString.value -> bool) -> bool
      val keepU :
        Belt_MutableSetString.t ->
    -    (Belt_MutableSetString.elt -> bool [@bs]) -> Belt_MutableSetString.t
    +    (Belt_MutableSetString.value -> bool [@bs]) -> Belt_MutableSetString.t
      val keep :
        Belt_MutableSetString.t ->
    -    (Belt_MutableSetString.elt -> bool) -> Belt_MutableSetString.t
    +    (Belt_MutableSetString.value -> bool) -> Belt_MutableSetString.t
      val partitionU :
        Belt_MutableSetString.t ->
    -    (Belt_MutableSetString.elt -> bool [@bs]) ->
    +    (Belt_MutableSetString.value -> bool [@bs]) ->
        Belt_MutableSetString.t * Belt_MutableSetString.t
      val partition :
        Belt_MutableSetString.t ->
    -    (Belt_MutableSetString.elt -> bool) ->
    +    (Belt_MutableSetString.value -> bool) ->
        Belt_MutableSetString.t * Belt_MutableSetString.t
      val size : Belt_MutableSetString.t -> int
    -  val toList : Belt_MutableSetString.t -> Belt_MutableSetString.elt list
    -  val toArray : Belt_MutableSetString.t -> Belt_MutableSetString.elt array
    -  val minimum : Belt_MutableSetString.t -> Belt_MutableSetString.elt option
    +  val toList : Belt_MutableSetString.t -> Belt_MutableSetString.value list
    +  val toArray : Belt_MutableSetString.t -> Belt_MutableSetString.value array
    +  val minimum : Belt_MutableSetString.t -> Belt_MutableSetString.value option
      val minUndefined :
    -    Belt_MutableSetString.t -> Belt_MutableSetString.elt Js.undefined
    -  val maximum : Belt_MutableSetString.t -> Belt_MutableSetString.elt option
    +    Belt_MutableSetString.t -> Belt_MutableSetString.value Js.undefined
    +  val maximum : Belt_MutableSetString.t -> Belt_MutableSetString.value option
      val maxUndefined :
    -    Belt_MutableSetString.t -> Belt_MutableSetString.elt Js.undefined
    +    Belt_MutableSetString.t -> Belt_MutableSetString.value Js.undefined
      val get :
        Belt_MutableSetString.t ->
    -    Belt_MutableSetString.elt -> Belt_MutableSetString.elt option
    +    Belt_MutableSetString.value -> Belt_MutableSetString.value option
      val getUndefined :
        Belt_MutableSetString.t ->
    -    Belt_MutableSetString.elt -> Belt_MutableSetString.elt Js.undefined
    +    Belt_MutableSetString.value -> Belt_MutableSetString.value Js.undefined
      val getExn :
        Belt_MutableSetString.t ->
    -    Belt_MutableSetString.elt -> Belt_MutableSetString.elt
    +    Belt_MutableSetString.value -> Belt_MutableSetString.value
      val split :
        Belt_MutableSetString.t ->
    -    Belt_MutableSetString.elt ->
    +    Belt_MutableSetString.value ->
        (Belt_MutableSetString.t * Belt_MutableSetString.t) * bool
      val checkInvariantInternal : Belt_MutableSetString.t -> unit
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_Option.html b/docs/api/type_Belt_Option.html new file mode 100644 index 0000000000..479319e5c6 --- /dev/null +++ b/docs/api/type_Belt_Option.html @@ -0,0 +1,26 @@ + + + + + + + + + Belt_Option + +sig
    +  val getExn : 'a option -> 'a
    +  val mapWithDefaultU : 'a option -> '-> ('-> 'b [@bs]) -> 'b
    +  val mapWithDefault : 'a option -> '-> ('-> 'b) -> 'b
    +  val mapU : 'a option -> ('-> 'b [@bs]) -> 'b option
    +  val map : 'a option -> ('-> 'b) -> 'b option
    +  val flatMapU : 'a option -> ('-> 'b option [@bs]) -> 'b option
    +  val flatMap : 'a option -> ('-> 'b option) -> 'b option
    +  val getWithDefault : 'a option -> '-> 'a
    +  val isSome : 'a option -> bool
    +  val isNone : 'a option -> bool
    +  val eqU : 'a option -> 'b option -> ('-> '-> bool [@bs]) -> bool
    +  val eq : 'a option -> 'b option -> ('-> '-> bool) -> bool
    +  val cmpU : 'a option -> 'b option -> ('-> '-> int [@bs]) -> int
    +  val cmp : 'a option -> 'b option -> ('-> '-> int) -> int
    +end
    \ No newline at end of file diff --git a/docs/api/type_Belt_Set.html b/docs/api/type_Belt_Set.html index 667a9e279f..098cfc4b2c 100644 --- a/docs/api/type_Belt_Set.html +++ b/docs/api/type_Belt_Set.html @@ -12,68 +12,76 @@   module Int = Belt_SetInt
      module String = Belt_SetString
      module Dict = Belt_SetDict
    -  type ('key, 'identity) t
    -  type ('key, 'id) id = ('key, 'id) Belt_Id.comparable
    -  val make : id:('elt, 'id) Belt_Set.id -> ('elt, 'id) Belt_Set.t
    -  val ofArray : 'k array -> id:('k, 'id) Belt_Set.id -> ('k, 'id) Belt_Set.t
    +  type ('value, 'identity) t
    +  type ('value, 'id) id = ('value, 'id) Belt_Id.comparable
    +  val make : id:('value, 'id) Belt_Set.id -> ('value, 'id) Belt_Set.t
    +  val ofArray :
    +    'value array -> id:('value, 'id) Belt_Set.id -> ('value, 'id) Belt_Set.t
    +  val fromArray :
    +    'value array -> id:('value, 'id) Belt_Set.id -> ('value, 'id) Belt_Set.t
      val ofSortedArrayUnsafe :
    -    'elt array -> id:('elt, 'id) Belt_Set.id -> ('elt, 'id) Belt_Set.t
    +    'value array -> id:('value, 'id) Belt_Set.id -> ('value, 'id) Belt_Set.t
    +  val fromSortedArrayUnsafe :
    +    'value array -> id:('value, 'id) Belt_Set.id -> ('value, 'id) Belt_Set.t
      val isEmpty : ('a, 'b) Belt_Set.t -> bool
    -  val has : ('elt, 'id) Belt_Set.t -> 'elt -> bool
    -  val add : ('elt, 'id) Belt_Set.t -> 'elt -> ('elt, 'id) Belt_Set.t
    +  val has : ('value, 'id) Belt_Set.t -> 'value -> bool
    +  val add : ('value, 'id) Belt_Set.t -> 'value -> ('value, 'id) Belt_Set.t
      val mergeMany :
    -    ('elt, 'id) Belt_Set.t -> 'elt array -> ('elt, 'id) Belt_Set.t
    -  val remove : ('elt, 'id) Belt_Set.t -> 'elt -> ('elt, 'id) Belt_Set.t
    +    ('value, 'id) Belt_Set.t -> 'value array -> ('value, 'id) Belt_Set.t
    +  val remove : ('value, 'id) Belt_Set.t -> 'value -> ('value, 'id) Belt_Set.t
      val removeMany :
    -    ('elt, 'id) Belt_Set.t -> 'elt array -> ('elt, 'id) Belt_Set.t
    +    ('value, 'id) Belt_Set.t -> 'value array -> ('value, 'id) Belt_Set.t
      val union :
    -    ('elt, 'id) Belt_Set.t ->
    -    ('elt, 'id) Belt_Set.t -> ('elt, 'id) Belt_Set.t
    +    ('value, 'id) Belt_Set.t ->
    +    ('value, 'id) Belt_Set.t -> ('value, 'id) Belt_Set.t
      val intersect :
    -    ('elt, 'id) Belt_Set.t ->
    -    ('elt, 'id) Belt_Set.t -> ('elt, 'id) Belt_Set.t
    +    ('value, 'id) Belt_Set.t ->
    +    ('value, 'id) Belt_Set.t -> ('value, 'id) Belt_Set.t
      val diff :
    -    ('elt, 'id) Belt_Set.t ->
    -    ('elt, 'id) Belt_Set.t -> ('elt, 'id) Belt_Set.t
    -  val subset : ('elt, 'id) Belt_Set.t -> ('elt, 'id) Belt_Set.t -> bool
    -  val cmp : ('elt, 'id) Belt_Set.t -> ('elt, 'id) Belt_Set.t -> int
    -  val eq : ('elt, 'id) Belt_Set.t -> ('elt, 'id) Belt_Set.t -> bool
    -  val forEachU : ('elt, 'id) Belt_Set.t -> ('elt -> unit [@bs]) -> unit
    -  val forEach : ('elt, 'id) Belt_Set.t -> ('elt -> unit) -> unit
    +    ('value, 'id) Belt_Set.t ->
    +    ('value, 'id) Belt_Set.t -> ('value, 'id) Belt_Set.t
    +  val subset : ('value, 'id) Belt_Set.t -> ('value, 'id) Belt_Set.t -> bool
    +  val cmp : ('value, 'id) Belt_Set.t -> ('value, 'id) Belt_Set.t -> int
    +  val eq : ('value, 'id) Belt_Set.t -> ('value, 'id) Belt_Set.t -> bool
    +  val forEachU : ('value, 'id) Belt_Set.t -> ('value -> unit [@bs]) -> unit
    +  val forEach : ('value, 'id) Belt_Set.t -> ('value -> unit) -> unit
      val reduceU :
    -    ('elt, 'id) Belt_Set.t -> '-> ('-> 'elt -> 'a [@bs]) -> 'a
    -  val reduce : ('elt, 'id) Belt_Set.t -> '-> ('-> 'elt -> 'a) -> 'a
    -  val everyU : ('elt, 'id) Belt_Set.t -> ('elt -> bool [@bs]) -> bool
    -  val every : ('elt, 'id) Belt_Set.t -> ('elt -> bool) -> bool
    -  val someU : ('elt, 'id) Belt_Set.t -> ('elt -> bool [@bs]) -> bool
    -  val some : ('elt, 'id) Belt_Set.t -> ('elt -> bool) -> bool
    +    ('value, 'id) Belt_Set.t -> '-> ('-> 'value -> 'a [@bs]) -> 'a
    +  val reduce : ('value, 'id) Belt_Set.t -> '-> ('-> 'value -> 'a) -> 'a
    +  val everyU : ('value, 'id) Belt_Set.t -> ('value -> bool [@bs]) -> bool
    +  val every : ('value, 'id) Belt_Set.t -> ('value -> bool) -> bool
    +  val someU : ('value, 'id) Belt_Set.t -> ('value -> bool [@bs]) -> bool
    +  val some : ('value, 'id) Belt_Set.t -> ('value -> bool) -> bool
      val keepU :
    -    ('elt, 'id) Belt_Set.t -> ('elt -> bool [@bs]) -> ('elt, 'id) Belt_Set.t
    +    ('value, 'id) Belt_Set.t ->
    +    ('value -> bool [@bs]) -> ('value, 'id) Belt_Set.t
      val keep :
    -    ('elt, 'id) Belt_Set.t -> ('elt -> bool) -> ('elt, 'id) Belt_Set.t
    +    ('value, 'id) Belt_Set.t -> ('value -> bool) -> ('value, 'id) Belt_Set.t
      val partitionU :
    -    ('elt, 'id) Belt_Set.t ->
    -    ('elt -> bool [@bs]) -> ('elt, 'id) Belt_Set.t * ('elt, 'id) Belt_Set.t
    +    ('value, 'id) Belt_Set.t ->
    +    ('value -> bool [@bs]) ->
    +    ('value, 'id) Belt_Set.t * ('value, 'id) Belt_Set.t
      val partition :
    -    ('elt, 'id) Belt_Set.t ->
    -    ('elt -> bool) -> ('elt, 'id) Belt_Set.t * ('elt, 'id) Belt_Set.t
    -  val size : ('elt, 'id) Belt_Set.t -> int
    -  val toArray : ('elt, 'id) Belt_Set.t -> 'elt array
    -  val toList : ('elt, 'id) Belt_Set.t -> 'elt list
    -  val minimum : ('elt, 'id) Belt_Set.t -> 'elt option
    -  val minUndefined : ('elt, 'id) Belt_Set.t -> 'elt Js.undefined
    -  val maximum : ('elt, 'id) Belt_Set.t -> 'elt option
    -  val maxUndefined : ('elt, 'id) Belt_Set.t -> 'elt Js.undefined
    -  val get : ('elt, 'id) Belt_Set.t -> 'elt -> 'elt option
    -  val getUndefined : ('elt, 'id) Belt_Set.t -> 'elt -> 'elt Js.undefined
    -  val getExn : ('elt, 'id) Belt_Set.t -> 'elt -> 'elt
    +    ('value, 'id) Belt_Set.t ->
    +    ('value -> bool) -> ('value, 'id) Belt_Set.t * ('value, 'id) Belt_Set.t
    +  val size : ('value, 'id) Belt_Set.t -> int
    +  val toArray : ('value, 'id) Belt_Set.t -> 'value array
    +  val toList : ('value, 'id) Belt_Set.t -> 'value list
    +  val minimum : ('value, 'id) Belt_Set.t -> 'value option
    +  val minUndefined : ('value, 'id) Belt_Set.t -> 'value Js.undefined
    +  val maximum : ('value, 'id) Belt_Set.t -> 'value option
    +  val maxUndefined : ('value, 'id) Belt_Set.t -> 'value Js.undefined
    +  val get : ('value, 'id) Belt_Set.t -> 'value -> 'value option
    +  val getUndefined :
    +    ('value, 'id) Belt_Set.t -> 'value -> 'value Js.undefined
    +  val getExn : ('value, 'id) Belt_Set.t -> 'value -> 'value
      val split :
    -    ('elt, 'id) Belt_Set.t ->
    -    'elt -> (('elt, 'id) Belt_Set.t * ('elt, 'id) Belt_Set.t) * bool
    +    ('value, 'id) Belt_Set.t ->
    +    'value -> (('value, 'id) Belt_Set.t * ('value, 'id) Belt_Set.t) * bool
      val checkInvariantInternal : ('a, 'b) Belt_Set.t -> unit
    -  val getData : ('k, 'id) Belt_Set.t -> ('k, 'id) Belt_SetDict.t
    -  val getId : ('k, 'id) Belt_Set.t -> ('k, 'id) Belt_Set.id
    +  val getData : ('value, 'id) Belt_Set.t -> ('value, 'id) Belt_SetDict.t
    +  val getId : ('value, 'id) Belt_Set.t -> ('value, 'id) Belt_Set.id
      val packIdData :
    -    id:('k, 'id) Belt_Set.id ->
    -    data:('k, 'id) Belt_SetDict.t -> ('k, 'id) Belt_Set.t
    +    id:('value, 'id) Belt_Set.id ->
    +    data:('value, 'id) Belt_SetDict.t -> ('value, 'id) Belt_Set.t
    end \ No newline at end of file diff --git a/docs/api/type_Belt_SetDict.html b/docs/api/type_Belt_SetDict.html index dc894fe199..bdd263db0a 100644 --- a/docs/api/type_Belt_SetDict.html +++ b/docs/api/type_Belt_SetDict.html @@ -11,10 +11,13 @@ sig
      type ('key, 'id) t
      type ('key, 'id) cmp = ('key, 'id) Belt_Id.cmp
    -  val empty : ('elt, 'id) Belt_SetDict.t
    +  val empty : ('value, 'id) Belt_SetDict.t
      val ofArray :
        'k array -> cmp:('k, 'id) Belt_SetDict.cmp -> ('k, 'id) Belt_SetDict.t
    -  val ofSortedArrayUnsafe : 'elt array -> ('elt, 'id) Belt_SetDict.t
    +  val ofSortedArrayUnsafe : 'value array -> ('value, 'id) Belt_SetDict.t
    +  val fromArray :
    +    'k array -> cmp:('k, 'id) Belt_SetDict.cmp -> ('k, 'id) Belt_SetDict.t
    +  val fromSortedArrayUnsafe : 'value array -> ('value, 'id) Belt_SetDict.t
      val isEmpty : ('a, 'b) Belt_SetDict.t -> bool
      val has :
        ('k, 'id) Belt_SetDict.t -> '-> cmp:('k, 'id) Belt_SetDict.cmp -> bool
    @@ -22,79 +25,85 @@     ('k, 'id) Belt_SetDict.t ->
        '-> cmp:('k, 'id) Belt_SetDict.cmp -> ('k, 'id) Belt_SetDict.t
      val mergeMany :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    'elt array ->
    -    cmp:('elt, 'id) Belt_SetDict.cmp -> ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    'value array ->
    +    cmp:('value, 'id) Belt_SetDict.cmp -> ('value, 'id) Belt_SetDict.t
      val remove :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    'elt -> cmp:('elt, 'id) Belt_SetDict.cmp -> ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    'value ->
    +    cmp:('value, 'id) Belt_SetDict.cmp -> ('value, 'id) Belt_SetDict.t
      val removeMany :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    'elt array ->
    -    cmp:('elt, 'id) Belt_SetDict.cmp -> ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    'value array ->
    +    cmp:('value, 'id) Belt_SetDict.cmp -> ('value, 'id) Belt_SetDict.t
      val union :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt, 'id) Belt_SetDict.t ->
    -    cmp:('elt, 'id) Belt_SetDict.cmp -> ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value, 'id) Belt_SetDict.t ->
    +    cmp:('value, 'id) Belt_SetDict.cmp -> ('value, 'id) Belt_SetDict.t
      val intersect :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt, 'id) Belt_SetDict.t ->
    -    cmp:('elt, 'id) Belt_SetDict.cmp -> ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value, 'id) Belt_SetDict.t ->
    +    cmp:('value, 'id) Belt_SetDict.cmp -> ('value, 'id) Belt_SetDict.t
      val diff :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt, 'id) Belt_SetDict.t ->
    -    cmp:('elt, 'id) Belt_SetDict.cmp -> ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value, 'id) Belt_SetDict.t ->
    +    cmp:('value, 'id) Belt_SetDict.cmp -> ('value, 'id) Belt_SetDict.t
      val subset :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt, 'id) Belt_SetDict.t -> cmp:('elt, 'id) Belt_SetDict.cmp -> bool
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value, 'id) Belt_SetDict.t ->
    +    cmp:('value, 'id) Belt_SetDict.cmp -> bool
      val cmp :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt, 'id) Belt_SetDict.t -> cmp:('elt, 'id) Belt_SetDict.cmp -> int
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value, 'id) Belt_SetDict.t -> cmp:('value, 'id) Belt_SetDict.cmp -> int
      val eq :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt, 'id) Belt_SetDict.t -> cmp:('elt, 'id) Belt_SetDict.cmp -> bool
    -  val forEachU : ('elt, 'id) Belt_SetDict.t -> ('elt -> unit [@bs]) -> unit
    -  val forEach : ('elt, 'id) Belt_SetDict.t -> ('elt -> unit) -> unit
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value, 'id) Belt_SetDict.t ->
    +    cmp:('value, 'id) Belt_SetDict.cmp -> bool
    +  val forEachU :
    +    ('value, 'id) Belt_SetDict.t -> ('value -> unit [@bs]) -> unit
    +  val forEach : ('value, 'id) Belt_SetDict.t -> ('value -> unit) -> unit
      val reduceU :
    -    ('elt, 'id) Belt_SetDict.t -> '-> ('-> 'elt -> 'a [@bs]) -> 'a
    -  val reduce : ('elt, 'id) Belt_SetDict.t -> '-> ('-> 'elt -> 'a) -> 'a
    -  val everyU : ('elt, 'id) Belt_SetDict.t -> ('elt -> bool [@bs]) -> bool
    -  val every : ('elt, 'id) Belt_SetDict.t -> ('elt -> bool) -> bool
    -  val someU : ('elt, 'id) Belt_SetDict.t -> ('elt -> bool [@bs]) -> bool
    -  val some : ('elt, 'id) Belt_SetDict.t -> ('elt -> bool) -> bool
    +    ('value, 'id) Belt_SetDict.t -> '-> ('-> 'value -> 'a [@bs]) -> 'a
    +  val reduce :
    +    ('value, 'id) Belt_SetDict.t -> '-> ('-> 'value -> 'a) -> 'a
    +  val everyU : ('value, 'id) Belt_SetDict.t -> ('value -> bool [@bs]) -> bool
    +  val every : ('value, 'id) Belt_SetDict.t -> ('value -> bool) -> bool
    +  val someU : ('value, 'id) Belt_SetDict.t -> ('value -> bool [@bs]) -> bool
    +  val some : ('value, 'id) Belt_SetDict.t -> ('value -> bool) -> bool
      val keepU :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt -> bool [@bs]) -> ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value -> bool [@bs]) -> ('value, 'id) Belt_SetDict.t
      val keep :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt -> bool) -> ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value -> bool) -> ('value, 'id) Belt_SetDict.t
      val partitionU :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt -> bool [@bs]) ->
    -    ('elt, 'id) Belt_SetDict.t * ('elt, 'id) Belt_SetDict.t
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value -> bool [@bs]) ->
    +    ('value, 'id) Belt_SetDict.t * ('value, 'id) Belt_SetDict.t
      val partition :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    ('elt -> bool) -> ('elt, 'id) Belt_SetDict.t * ('elt, 'id) Belt_SetDict.t
    -  val size : ('elt, 'id) Belt_SetDict.t -> int
    -  val toList : ('elt, 'id) Belt_SetDict.t -> 'elt list
    -  val toArray : ('elt, 'id) Belt_SetDict.t -> 'elt array
    -  val minimum : ('elt, 'id) Belt_SetDict.t -> 'elt option
    -  val minUndefined : ('elt, 'id) Belt_SetDict.t -> 'elt Js.undefined
    -  val maximum : ('elt, 'id) Belt_SetDict.t -> 'elt option
    -  val maxUndefined : ('elt, 'id) Belt_SetDict.t -> 'elt Js.undefined
    +    ('value, 'id) Belt_SetDict.t ->
    +    ('value -> bool) ->
    +    ('value, 'id) Belt_SetDict.t * ('value, 'id) Belt_SetDict.t
    +  val size : ('value, 'id) Belt_SetDict.t -> int
    +  val toList : ('value, 'id) Belt_SetDict.t -> 'value list
    +  val toArray : ('value, 'id) Belt_SetDict.t -> 'value array
    +  val minimum : ('value, 'id) Belt_SetDict.t -> 'value option
    +  val minUndefined : ('value, 'id) Belt_SetDict.t -> 'value Js.undefined
    +  val maximum : ('value, 'id) Belt_SetDict.t -> 'value option
    +  val maxUndefined : ('value, 'id) Belt_SetDict.t -> 'value Js.undefined
      val get :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    'elt -> cmp:('elt, 'id) Belt_SetDict.cmp -> 'elt option
    +    ('value, 'id) Belt_SetDict.t ->
    +    'value -> cmp:('value, 'id) Belt_SetDict.cmp -> 'value option
      val getUndefined :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    'elt -> cmp:('elt, 'id) Belt_SetDict.cmp -> 'elt Js.undefined
    +    ('value, 'id) Belt_SetDict.t ->
    +    'value -> cmp:('value, 'id) Belt_SetDict.cmp -> 'value Js.undefined
      val getExn :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    'elt -> cmp:('elt, 'id) Belt_SetDict.cmp -> 'elt
    +    ('value, 'id) Belt_SetDict.t ->
    +    'value -> cmp:('value, 'id) Belt_SetDict.cmp -> 'value
      val split :
    -    ('elt, 'id) Belt_SetDict.t ->
    -    'elt ->
    -    cmp:('elt, 'id) Belt_SetDict.cmp ->
    -    (('elt, 'id) Belt_SetDict.t * ('elt, 'id) Belt_SetDict.t) * bool
    +    ('value, 'id) Belt_SetDict.t ->
    +    'value ->
    +    cmp:('value, 'id) Belt_SetDict.cmp ->
    +    (('value, 'id) Belt_SetDict.t * ('value, 'id) Belt_SetDict.t) * bool
      val checkInvariantInternal : ('a, 'b) Belt_SetDict.t -> unit
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_SetInt.html b/docs/api/type_Belt_SetInt.html index 1f9d5a08ca..dc15e6f73e 100644 --- a/docs/api/type_Belt_SetInt.html +++ b/docs/api/type_Belt_SetInt.html @@ -9,54 +9,56 @@ Belt_SetInt sig
    -  type elt = int
    +  type value = int
      type t
      val empty : Belt_SetInt.t
    -  val ofArray : Belt_SetInt.elt array -> Belt_SetInt.t
    -  val ofSortedArrayUnsafe : Belt_SetInt.elt array -> Belt_SetInt.t
    +  val ofArray : Belt_SetInt.value array -> Belt_SetInt.t
    +  val ofSortedArrayUnsafe : Belt_SetInt.value array -> Belt_SetInt.t
    +  val fromArray : Belt_SetInt.value array -> Belt_SetInt.t
    +  val fromSortedArrayUnsafe : Belt_SetInt.value array -> Belt_SetInt.t
      val isEmpty : Belt_SetInt.t -> bool
    -  val has : Belt_SetInt.t -> Belt_SetInt.elt -> bool
    -  val add : Belt_SetInt.t -> Belt_SetInt.elt -> Belt_SetInt.t
    -  val mergeMany : Belt_SetInt.t -> Belt_SetInt.elt array -> Belt_SetInt.t
    -  val remove : Belt_SetInt.t -> Belt_SetInt.elt -> Belt_SetInt.t
    -  val removeMany : Belt_SetInt.t -> Belt_SetInt.elt array -> Belt_SetInt.t
    +  val has : Belt_SetInt.t -> Belt_SetInt.value -> bool
    +  val add : Belt_SetInt.t -> Belt_SetInt.value -> Belt_SetInt.t
    +  val mergeMany : Belt_SetInt.t -> Belt_SetInt.value array -> Belt_SetInt.t
    +  val remove : Belt_SetInt.t -> Belt_SetInt.value -> Belt_SetInt.t
    +  val removeMany : Belt_SetInt.t -> Belt_SetInt.value array -> Belt_SetInt.t
      val union : Belt_SetInt.t -> Belt_SetInt.t -> Belt_SetInt.t
      val intersect : Belt_SetInt.t -> Belt_SetInt.t -> Belt_SetInt.t
      val diff : Belt_SetInt.t -> Belt_SetInt.t -> Belt_SetInt.t
      val subset : Belt_SetInt.t -> Belt_SetInt.t -> bool
      val cmp : Belt_SetInt.t -> Belt_SetInt.t -> int
      val eq : Belt_SetInt.t -> Belt_SetInt.t -> bool
    -  val forEachU : Belt_SetInt.t -> (Belt_SetInt.elt -> unit [@bs]) -> unit
    -  val forEach : Belt_SetInt.t -> (Belt_SetInt.elt -> unit) -> unit
    +  val forEachU : Belt_SetInt.t -> (Belt_SetInt.value -> unit [@bs]) -> unit
    +  val forEach : Belt_SetInt.t -> (Belt_SetInt.value -> unit) -> unit
      val reduceU :
    -    Belt_SetInt.t -> '-> ('-> Belt_SetInt.elt -> 'a [@bs]) -> 'a
    -  val reduce : Belt_SetInt.t -> '-> ('-> Belt_SetInt.elt -> 'a) -> 'a
    -  val everyU : Belt_SetInt.t -> (Belt_SetInt.elt -> bool [@bs]) -> bool
    -  val every : Belt_SetInt.t -> (Belt_SetInt.elt -> bool) -> bool
    -  val someU : Belt_SetInt.t -> (Belt_SetInt.elt -> bool [@bs]) -> bool
    -  val some : Belt_SetInt.t -> (Belt_SetInt.elt -> bool) -> bool
    +    Belt_SetInt.t -> '-> ('-> Belt_SetInt.value -> 'a [@bs]) -> 'a
    +  val reduce : Belt_SetInt.t -> '-> ('-> Belt_SetInt.value -> 'a) -> 'a
    +  val everyU : Belt_SetInt.t -> (Belt_SetInt.value -> bool [@bs]) -> bool
    +  val every : Belt_SetInt.t -> (Belt_SetInt.value -> bool) -> bool
    +  val someU : Belt_SetInt.t -> (Belt_SetInt.value -> bool [@bs]) -> bool
    +  val some : Belt_SetInt.t -> (Belt_SetInt.value -> bool) -> bool
      val keepU :
    -    Belt_SetInt.t -> (Belt_SetInt.elt -> bool [@bs]) -> Belt_SetInt.t
    -  val keep : Belt_SetInt.t -> (Belt_SetInt.elt -> bool) -> Belt_SetInt.t
    +    Belt_SetInt.t -> (Belt_SetInt.value -> bool [@bs]) -> Belt_SetInt.t
    +  val keep : Belt_SetInt.t -> (Belt_SetInt.value -> bool) -> Belt_SetInt.t
      val partitionU :
        Belt_SetInt.t ->
    -    (Belt_SetInt.elt -> bool [@bs]) -> Belt_SetInt.t * Belt_SetInt.t
    +    (Belt_SetInt.value -> bool [@bs]) -> Belt_SetInt.t * Belt_SetInt.t
      val partition :
        Belt_SetInt.t ->
    -    (Belt_SetInt.elt -> bool) -> Belt_SetInt.t * Belt_SetInt.t
    +    (Belt_SetInt.value -> bool) -> Belt_SetInt.t * Belt_SetInt.t
      val size : Belt_SetInt.t -> int
    -  val toList : Belt_SetInt.t -> Belt_SetInt.elt list
    -  val toArray : Belt_SetInt.t -> Belt_SetInt.elt array
    -  val minimum : Belt_SetInt.t -> Belt_SetInt.elt option
    -  val minUndefined : Belt_SetInt.t -> Belt_SetInt.elt Js.undefined
    -  val maximum : Belt_SetInt.t -> Belt_SetInt.elt option
    -  val maxUndefined : Belt_SetInt.t -> Belt_SetInt.elt Js.undefined
    -  val get : Belt_SetInt.t -> Belt_SetInt.elt -> Belt_SetInt.elt option
    +  val toList : Belt_SetInt.t -> Belt_SetInt.value list
    +  val toArray : Belt_SetInt.t -> Belt_SetInt.value array
    +  val minimum : Belt_SetInt.t -> Belt_SetInt.value option
    +  val minUndefined : Belt_SetInt.t -> Belt_SetInt.value Js.undefined
    +  val maximum : Belt_SetInt.t -> Belt_SetInt.value option
    +  val maxUndefined : Belt_SetInt.t -> Belt_SetInt.value Js.undefined
    +  val get : Belt_SetInt.t -> Belt_SetInt.value -> Belt_SetInt.value option
      val getUndefined :
    -    Belt_SetInt.t -> Belt_SetInt.elt -> Belt_SetInt.elt Js.undefined
    -  val getExn : Belt_SetInt.t -> Belt_SetInt.elt -> Belt_SetInt.elt
    +    Belt_SetInt.t -> Belt_SetInt.value -> Belt_SetInt.value Js.undefined
    +  val getExn : Belt_SetInt.t -> Belt_SetInt.value -> Belt_SetInt.value
      val split :
        Belt_SetInt.t ->
    -    Belt_SetInt.elt -> (Belt_SetInt.t * Belt_SetInt.t) * bool
    +    Belt_SetInt.value -> (Belt_SetInt.t * Belt_SetInt.t) * bool
      val checkInvariantInternal : Belt_SetInt.t -> unit
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_SetString.html b/docs/api/type_Belt_SetString.html index 9a34f3b38b..b34ac33ec8 100644 --- a/docs/api/type_Belt_SetString.html +++ b/docs/api/type_Belt_SetString.html @@ -9,19 +9,21 @@ Belt_SetString sig
    -  type elt = string
    +  type value = string
      type t
      val empty : Belt_SetString.t
    -  val ofArray : Belt_SetString.elt array -> Belt_SetString.t
    -  val ofSortedArrayUnsafe : Belt_SetString.elt array -> Belt_SetString.t
    +  val ofArray : Belt_SetString.value array -> Belt_SetString.t
    +  val ofSortedArrayUnsafe : Belt_SetString.value array -> Belt_SetString.t
    +  val fromArray : Belt_SetString.value array -> Belt_SetString.t
    +  val fromSortedArrayUnsafe : Belt_SetString.value array -> Belt_SetString.t
      val isEmpty : Belt_SetString.t -> bool
    -  val has : Belt_SetString.t -> Belt_SetString.elt -> bool
    -  val add : Belt_SetString.t -> Belt_SetString.elt -> Belt_SetString.t
    +  val has : Belt_SetString.t -> Belt_SetString.value -> bool
    +  val add : Belt_SetString.t -> Belt_SetString.value -> Belt_SetString.t
      val mergeMany :
    -    Belt_SetString.t -> Belt_SetString.elt array -> Belt_SetString.t
    -  val remove : Belt_SetString.t -> Belt_SetString.elt -> Belt_SetString.t
    +    Belt_SetString.t -> Belt_SetString.value array -> Belt_SetString.t
    +  val remove : Belt_SetString.t -> Belt_SetString.value -> Belt_SetString.t
      val removeMany :
    -    Belt_SetString.t -> Belt_SetString.elt array -> Belt_SetString.t
    +    Belt_SetString.t -> Belt_SetString.value array -> Belt_SetString.t
      val union : Belt_SetString.t -> Belt_SetString.t -> Belt_SetString.t
      val intersect : Belt_SetString.t -> Belt_SetString.t -> Belt_SetString.t
      val diff : Belt_SetString.t -> Belt_SetString.t -> Belt_SetString.t
    @@ -29,41 +31,46 @@   val cmp : Belt_SetString.t -> Belt_SetString.t -> int
      val eq : Belt_SetString.t -> Belt_SetString.t -> bool
      val forEachU :
    -    Belt_SetString.t -> (Belt_SetString.elt -> unit [@bs]) -> unit
    -  val forEach : Belt_SetString.t -> (Belt_SetString.elt -> unit) -> unit
    +    Belt_SetString.t -> (Belt_SetString.value -> unit [@bs]) -> unit
    +  val forEach : Belt_SetString.t -> (Belt_SetString.value -> unit) -> unit
      val reduceU :
    -    Belt_SetString.t -> '-> ('-> Belt_SetString.elt -> 'a [@bs]) -> 'a
    +    Belt_SetString.t -> '-> ('-> Belt_SetString.value -> 'a [@bs]) -> 'a
      val reduce :
    -    Belt_SetString.t -> '-> ('-> Belt_SetString.elt -> 'a) -> 'a
    -  val everyU : Belt_SetString.t -> (Belt_SetString.elt -> bool [@bs]) -> bool
    -  val every : Belt_SetString.t -> (Belt_SetString.elt -> bool) -> bool
    -  val someU : Belt_SetString.t -> (Belt_SetString.elt -> bool [@bs]) -> bool
    -  val some : Belt_SetString.t -> (Belt_SetString.elt -> bool) -> bool
    +    Belt_SetString.t -> '-> ('-> Belt_SetString.value -> 'a) -> 'a
    +  val everyU :
    +    Belt_SetString.t -> (Belt_SetString.value -> bool [@bs]) -> bool
    +  val every : Belt_SetString.t -> (Belt_SetString.value -> bool) -> bool
    +  val someU :
    +    Belt_SetString.t -> (Belt_SetString.value -> bool [@bs]) -> bool
    +  val some : Belt_SetString.t -> (Belt_SetString.value -> bool) -> bool
      val keepU :
        Belt_SetString.t ->
    -    (Belt_SetString.elt -> bool [@bs]) -> Belt_SetString.t
    +    (Belt_SetString.value -> bool [@bs]) -> Belt_SetString.t
      val keep :
    -    Belt_SetString.t -> (Belt_SetString.elt -> bool) -> Belt_SetString.t
    +    Belt_SetString.t -> (Belt_SetString.value -> bool) -> Belt_SetString.t
      val partitionU :
        Belt_SetString.t ->
    -    (Belt_SetString.elt -> bool [@bs]) -> Belt_SetString.t * Belt_SetString.t
    +    (Belt_SetString.value -> bool [@bs]) ->
    +    Belt_SetString.t * Belt_SetString.t
      val partition :
        Belt_SetString.t ->
    -    (Belt_SetString.elt -> bool) -> Belt_SetString.t * Belt_SetString.t
    +    (Belt_SetString.value -> bool) -> Belt_SetString.t * Belt_SetString.t
      val size : Belt_SetString.t -> int
    -  val toList : Belt_SetString.t -> Belt_SetString.elt list
    -  val toArray : Belt_SetString.t -> Belt_SetString.elt array
    -  val minimum : Belt_SetString.t -> Belt_SetString.elt option
    -  val minUndefined : Belt_SetString.t -> Belt_SetString.elt Js.undefined
    -  val maximum : Belt_SetString.t -> Belt_SetString.elt option
    -  val maxUndefined : Belt_SetString.t -> Belt_SetString.elt Js.undefined
    +  val toList : Belt_SetString.t -> Belt_SetString.value list
    +  val toArray : Belt_SetString.t -> Belt_SetString.value array
    +  val minimum : Belt_SetString.t -> Belt_SetString.value option
    +  val minUndefined : Belt_SetString.t -> Belt_SetString.value Js.undefined
    +  val maximum : Belt_SetString.t -> Belt_SetString.value option
    +  val maxUndefined : Belt_SetString.t -> Belt_SetString.value Js.undefined
      val get :
    -    Belt_SetString.t -> Belt_SetString.elt -> Belt_SetString.elt option
    +    Belt_SetString.t -> Belt_SetString.value -> Belt_SetString.value option
      val getUndefined :
    -    Belt_SetString.t -> Belt_SetString.elt -> Belt_SetString.elt Js.undefined
    -  val getExn : Belt_SetString.t -> Belt_SetString.elt -> Belt_SetString.elt
    +    Belt_SetString.t ->
    +    Belt_SetString.value -> Belt_SetString.value Js.undefined
    +  val getExn :
    +    Belt_SetString.t -> Belt_SetString.value -> Belt_SetString.value
      val split :
        Belt_SetString.t ->
    -    Belt_SetString.elt -> (Belt_SetString.t * Belt_SetString.t) * bool
    +    Belt_SetString.value -> (Belt_SetString.t * Belt_SetString.t) * bool
      val checkInvariantInternal : Belt_SetString.t -> unit
    end
    \ No newline at end of file diff --git a/docs/api/type_Belt_internalAVLset.html b/docs/api/type_Belt_internalAVLset.html index cf00302ea8..ea125065de 100644 --- a/docs/api/type_Belt_internalAVLset.html +++ b/docs/api/type_Belt_internalAVLset.html @@ -9,14 +9,14 @@ Belt_internalAVLset sig
    -  type 'elt t = 'elt node Js.null
    -  and 'elt node
    -  external leftSet : 'elt node -> 'elt t -> unit = "left" "BS-EXTERNAL"
    -  external left : 'elt node -> 'elt t = "left" "BS-EXTERNAL"
    -  external key : 'elt node -> 'elt = "key" "BS-EXTERNAL"
    -  external rightSet : 'elt node -> 'elt t -> unit = "right" "BS-EXTERNAL"
    -  external right : 'elt node -> 'elt t = "right" "BS-EXTERNAL"
    -  external h : 'elt node -> int = "h" "BS-EXTERNAL"
    +  type 'value t = 'value node Js.null
    +  and 'value node
    +  external value : 'value node -> 'value = "value" "BS-EXTERNAL"
    +  external height : 'value node -> int = "height" "BS-EXTERNAL"
    +  external leftSet : 'value node -> 'value t -> unit = "left" "BS-EXTERNAL"
    +  external left : 'value node -> 'value t = "left" "BS-EXTERNAL"
    +  external rightSet : 'value node -> 'value t -> unit = "right" "BS-EXTERNAL"
    +  external right : 'value node -> 'value t = "right" "BS-EXTERNAL"
      type ('a, 'b) cmp = ('a, 'b) Belt_Id.cmp
      external toOpt : 'Js.null -> 'a option = "#null_to_opt"
      external return : '-> 'Js.null = "%identity"
    @@ -56,9 +56,9 @@   val checkInvariantInternal : 'a t -> unit
      val fillArray : 'a node -> int -> 'a array -> int
      val toArray : 'a t -> 'a array
    -  val ofSortedArrayAux : 'a array -> int -> int -> 'a t
    -  val ofSortedArrayRevAux : 'a array -> int -> int -> 'a t
    -  val ofSortedArrayUnsafe : 'a array -> 'a t
    +  val fromSortedArrayAux : 'a array -> int -> int -> 'a t
    +  val fromSortedArrayRevAux : 'a array -> int -> int -> 'a t
    +  val fromSortedArrayUnsafe : 'a array -> 'a t
      val has : 'a t -> '-> cmp:('a, 'b) Belt_internalAVLset.cmp -> bool
      val cmp : 'a t -> 'a t -> cmp:('a, 'b) Belt_internalAVLset.cmp -> int
      val eq : 'a t -> 'a t -> cmp:('a, 'b) Belt_internalAVLset.cmp -> bool
    @@ -67,7 +67,7 @@   val getUndefined :
        'a t -> '-> cmp:('a, 'b) Belt_internalAVLset.cmp -> 'Js.undefined
      val getExn : 'a t -> '-> cmp:('a, 'b) Belt_internalAVLset.cmp -> 'a
    -  val ofArray : 'a array -> cmp:('a, 'b) Belt_internalAVLset.cmp -> 'a t
    +  val fromArray : 'a array -> cmp:('a, 'b) Belt_internalAVLset.cmp -> 'a t
      val addMutate : cmp:('a, 'b) Belt_internalAVLset.cmp -> 'a t -> '-> 'a t
      val balMutate : 'a node -> 'a node
      val removeMinAuxWithRootMutate : 'a node -> 'a node -> 'a t
    diff --git a/docs/api/type_Belt_internalAVLtree.html b/docs/api/type_Belt_internalAVLtree.html index 211dbcd8a8..6c7750b74e 100644 --- a/docs/api/type_Belt_internalAVLtree.html +++ b/docs/api/type_Belt_internalAVLtree.html @@ -11,17 +11,17 @@ sig
      type ('key, 'a) t = ('key, 'a) node Js.null
      and ('k, 'v) node
    -  external leftSet : ('k, 'v) node -> ('k, 'v) t -> unit = "left"
    -    "BS-EXTERNAL"
    -  external left : ('k, 'v) node -> ('k, 'v) t = "left" "BS-EXTERNAL"
      external keySet : ('k, 'v) node -> '-> unit = "key" "BS-EXTERNAL"
      external key : ('k, 'v) node -> 'k = "key" "BS-EXTERNAL"
      external valueSet : ('k, 'v) node -> '-> unit = "value" "BS-EXTERNAL"
      external value : ('k, 'v) node -> 'v = "value" "BS-EXTERNAL"
    +  external height : ('k, 'v) node -> int = "height" "BS-EXTERNAL"
    +  external leftSet : ('k, 'v) node -> ('k, 'v) t -> unit = "left"
    +    "BS-EXTERNAL"
    +  external left : ('k, 'v) node -> ('k, 'v) t = "left" "BS-EXTERNAL"
      external rightSet : ('k, 'v) node -> ('k, 'v) t -> unit = "right"
        "BS-EXTERNAL"
      external right : ('k, 'v) node -> ('k, 'v) t = "right" "BS-EXTERNAL"
    -  external h : ('k, 'v) node -> int = "h" "BS-EXTERNAL"
      external toOpt : 'Js.null -> 'a option = "#null_to_opt"
      external return : '-> 'Js.null = "%identity"
      type ('k, 'id) cmp = ('k, 'id) Belt_Id.cmp
    @@ -75,9 +75,9 @@   val toArray : ('a, 'b) t -> ('a * 'b) array
      val keysToArray : ('a, 'b) t -> 'a array
      val valuesToArray : ('a, 'b) t -> 'b array
    -  val ofSortedArrayAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    -  val ofSortedArrayRevAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    -  val ofSortedArrayUnsafe : ('a * 'b) array -> ('a, 'b) t
    +  val fromSortedArrayAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    +  val fromSortedArrayRevAux : ('a * 'b) array -> int -> int -> ('a, 'b) t
    +  val fromSortedArrayUnsafe : ('a * 'b) array -> ('a, 'b) t
      val cmpU :
        ('a, 'b) t ->
        ('a, 'c) t ->
    @@ -106,7 +106,7 @@   val getExn :
        ('a, 'b) t -> '-> cmp:('a, 'c) Belt_internalAVLtree.cmp -> 'b
      val has : ('a, 'b) t -> '-> cmp:('a, 'c) Belt_internalAVLtree.cmp -> bool
    -  val ofArray :
    +  val fromArray :
        ('a * 'b) array -> cmp:('a, 'id) Belt_internalAVLtree.cmp -> ('a, 'b) t
      val updateMutate :
        ('a, 'b) t ->
    diff --git a/docs/api/type_Js_null.html b/docs/api/type_Js_null.html index 62188bc519..5b3cdf80d0 100644 --- a/docs/api/type_Js_null.html +++ b/docs/api/type_Js_null.html @@ -11,7 +11,7 @@ sig
      type 'a t = 'Js.null
      external return : '-> 'Js_null.t = "%identity"
    -  external test : 'Js_null.t -> bool = "#is_nil"
    +  val test : 'Js_null.t -> bool
      external empty : 'Js_null.t = "#null"
      external getUnsafe : 'Js_null.t -> 'a = "%identity"
      val getExn : 'Js_null.t -> 'a
    @@ -20,4 +20,5 @@   val fromOption : 'a option -> 'Js_null.t
      val from_opt : 'a option -> 'Js_null.t
      external toOption : 'Js_null.t -> 'a option = "#null_to_opt"
    +  external to_opt : 'Js_null.t -> 'a option = "#null_to_opt"
    end
    \ No newline at end of file diff --git a/docs/api/type_Js_null_undefined.html b/docs/api/type_Js_null_undefined.html index 8adbe5044e..bc492adcff 100644 --- a/docs/api/type_Js_null_undefined.html +++ b/docs/api/type_Js_null_undefined.html @@ -17,7 +17,10 @@   val bind :
        'Js_null_undefined.t -> ('-> 'b [@bs]) -> 'Js_null_undefined.t
      val iter : 'Js_null_undefined.t -> ('-> unit [@bs]) -> unit
    +  val fromOption : 'a option -> 'Js_null_undefined.t
      val from_opt : 'a option -> 'Js_null_undefined.t
    +  external toOption : 'Js_null_undefined.t -> 'a option
    +    = "#null_undefined_to_opt"
      external to_opt : 'Js_null_undefined.t -> 'a option
        = "#null_undefined_to_opt"
    end
    \ No newline at end of file diff --git a/docs/api/type_Js_undefined.html b/docs/api/type_Js_undefined.html index 1865c07293..dd92f5e12f 100644 --- a/docs/api/type_Js_undefined.html +++ b/docs/api/type_Js_undefined.html @@ -11,8 +11,8 @@ sig
      type 'a t = 'Js.undefined
      external return : '-> 'Js_undefined.t = "%identity"
    -  external test : 'Js_undefined.t -> bool = "#is_undef"
    -  external testAny : '-> bool = "#is_undef"
    +  val test : 'Js_undefined.t -> bool
    +  val testAny : '-> bool
      external empty : 'Js_undefined.t = "#undefined"
      external getUnsafe : 'Js_undefined.t -> 'a = "%identity"
      val getExn : 'Js_undefined.t -> 'a
    diff --git a/jscomp/release.sh b/jscomp/release.sh index d4890d9420..8eba5291c7 100755 --- a/jscomp/release.sh +++ b/jscomp/release.sh @@ -1,6 +1,6 @@ #!/bin/sh set -e -rm ../lib/js/*.js +rm -f ../lib/js/*.js git clean -dfx . ../lib make clean make themes diff --git a/lib/bsb.darwin b/lib/bsb.darwin new file mode 100755 index 0000000000..40a2df3e8f Binary files /dev/null and b/lib/bsb.darwin differ diff --git a/lib/bsb_helper.darwin b/lib/bsb_helper.darwin new file mode 100755 index 0000000000..15abfaf93f Binary files /dev/null and b/lib/bsb_helper.darwin differ diff --git a/lib/bsc.darwin b/lib/bsc.darwin new file mode 100755 index 0000000000..24f9f9ee76 Binary files /dev/null and b/lib/bsc.darwin differ diff --git a/lib/bsppx.darwin b/lib/bsppx.darwin new file mode 100755 index 0000000000..824da3e143 Binary files /dev/null and b/lib/bsppx.darwin differ diff --git a/lib/reactjs_jsx_ppx_2.darwin b/lib/reactjs_jsx_ppx_2.darwin new file mode 100755 index 0000000000..53d30b8a8a Binary files /dev/null and b/lib/reactjs_jsx_ppx_2.darwin differ diff --git a/lib/refmt.darwin b/lib/refmt.darwin new file mode 100755 index 0000000000..1d2354eb1f Binary files /dev/null and b/lib/refmt.darwin differ diff --git a/scripts/build_util.js b/scripts/build_util.js index ba21be84e8..e2538438c2 100644 --- a/scripts/build_util.js +++ b/scripts/build_util.js @@ -4,9 +4,9 @@ var child_process = require('child_process') var fs = require('fs') var path = require('path') var os = require('os') -var root = path.join(__dirname,'..') +var root = path.join(__dirname, '..') var dest_bin = path.join(root, 'lib') -var dest_lib = path.join(root,'lib','ocaml') +var dest_lib = path.join(root, 'lib', 'ocaml') var jscomp = path.join(root, 'jscomp') @@ -16,24 +16,24 @@ var jscomp = path.join(root, 'jscomp') /* * It is weird reaname cause Busy resource or lock error */ -function copyFile(file,target){ - var stat = fs.statSync(file) - fs.createReadStream(file).pipe( - fs.createWriteStream(target, - {mode : stat.mode})) - +function copyFile(file, target) { + var stat = fs.statSync(file) + fs.createReadStream(file).pipe( + fs.createWriteStream(target, + { mode: stat.mode })) + } /** - * @param {string} from - * @param {string} to + * @param {string} from + * @param {string} to */ -function renameAsync(from,to){ - console.log(from , '----->', to) - // @ts-ignore - fs.rename(from,to) - // fs.renameSync(from,to) +function renameAsync(from, to) { + console.log(from, '----->', to) + // @ts-ignore + fs.rename(from, to) + // fs.renameSync(from,to) } @@ -41,64 +41,76 @@ function renameAsync(from,to){ * @param {string} from * @param {string} to */ -function poor_copy_sync(from,to){ - console.log(from , '----->', to) - fs.renameSync(from,to) - // fs.renameSync(from,to) +function poor_copy_sync(from, to) { + console.log(from, '----->', to) + fs.renameSync(from, to) + // fs.renameSync(from,to) } /** - * @param {string} dir + * @param {string} dir * @param {string} dest_lib */ -function install_directory(dir,dest_lib){ - var files = fs.readdirSync(dir) - files.forEach(function(file){ - var installed_fmt = ['.cmt','.cmti', '.cmj','.ml','.mli','.cmi'] - var format_file = path.parse(file) - if(format_file && - (installed_fmt.indexOf(format_file.ext) !== -1) - ){ - var from = path.join(dir,file) - var to = path.join(dest_lib,file) - renameAsync(from,to) - } - }) +function install_directory(dir, dest_lib) { + var files = fs.readdirSync(dir) + files.forEach(function (file) { + var installed_fmt = ['.cmt', '.cmti', '.cmj', '.ml', '.mli', '.cmi'] + var format_file = path.parse(file) + if (format_file && + (installed_fmt.indexOf(format_file.ext) !== -1) + ) { + var from = path.join(dir, file) + var to = path.join(dest_lib, file) + renameAsync(from, to) + } + }) } -function install(){ - if(!fs.existsSync(dest_bin)){ - fs.mkdirSync(dest_bin) - } - if(!fs.existsSync(dest_lib)){ - fs.mkdirSync(dest_lib) - } - - - - var jscomp_runtime = path.join(jscomp,'runtime') - - var files = fs.readdirSync(jscomp_runtime) - files.forEach(function(file){ - var format_file = path.parse(file) - var special_files = ['js', 'js_unsafe', 'js_internal', 'js_null', 'js_undefined', 'js_typed_array', 'caml_exceptions', 'js_float'] - var installed_fmt = ['.cmt','.cmti', '.cmj'] - if( - format_file && - ((special_files.indexOf(format_file.name) !== -1) - || - (installed_fmt.indexOf(format_file.ext) !== -1)) - ){ - var from = path.join(jscomp_runtime,file) - var to = path.join(dest_lib,file) - renameAsync(from,to) +function install() { + if (!fs.existsSync(dest_bin)) { + fs.mkdirSync(dest_bin) } - }) + if (!fs.existsSync(dest_lib)) { + fs.mkdirSync(dest_lib) + } + + - install_directory(path.join(jscomp,'stdlib'), dest_lib) - install_directory(path.join(jscomp,'others'), dest_lib) + var jscomp_runtime = path.join(jscomp, 'runtime') + + var files = fs.readdirSync(jscomp_runtime) + files.forEach(function (file) { + var format_file = path.parse(file) + var special_files = [ + 'js', + 'js_unsafe', + 'js_internal', + 'caml_exceptions', + 'js_null', + 'js_undefined', + 'js_exn', + 'js_int', + 'js_float', + 'js_typed_array' + ] + var installed_fmt = ['.cmt', '.cmti', '.cmj'] + if ( + format_file && + ((special_files.indexOf(format_file.name) !== -1) + || + (installed_fmt.indexOf(format_file.ext) !== -1)) + // Always copy cmt* cmj* + ) { + var from = path.join(jscomp_runtime, file) + var to = path.join(dest_lib, file) + renameAsync(from, to) + } + }) + + install_directory(path.join(jscomp, 'stdlib'), dest_lib) + install_directory(path.join(jscomp, 'others'), dest_lib) } -exports.install = install; +exports.install = install; exports.poor_copy_sync = poor_copy_sync;