Skip to content

Commit 6619da4

Browse files
authored
Merge pull request rescript-lang#2804 from BuckleScript/remove_deprecated_api
remove deprecated API
2 parents f5a25e5 + 8bb7043 commit 6619da4

File tree

112 files changed

+333
-514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+333
-514
lines changed

jscomp/core/js_runtime_modules.ml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ let format = "Caml_format"
3434
let string = "Caml_string"
3535
let bytes = "Caml_bytes"
3636
let float = "Caml_float"
37+
let hash_primitive = "Caml_hash_primitive"
3738
let hash = "Caml_hash"
3839
let oo = "Caml_oo"
3940
let curry = "Curry"

jscomp/core/lam_dispatch_primitive.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ let translate loc (prim_name : string)
796796
| "caml_hash_mix_string"
797797
| "caml_hash_mix_int"
798798
| "caml_hash_final_mix"
799-
799+
-> call Js_runtime_modules.hash_primitive
800800
| "caml_hash"
801801
-> call Js_runtime_modules.hash
802802
| "caml_weak_set"

jscomp/others/belt_HashMap.ml

-2
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ let fromArray (type a) (type identity) arr ~id:(id:(a,identity) id) =
213213
done ;
214214
v
215215

216-
let ofArray = fromArray
217-
218216
let mergeMany h arr =
219217
let hash, eq = Belt_Id.getHashInternal ( C.hash h) , Belt_Id.getEqInternal (C.eq h) in
220218
let len = A.length arr in

jscomp/others/belt_HashMap.mli

-2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,4 @@ val mergeMany: ('key, 'value, 'id ) t -> ('key * 'value) array -> unit
154154
val getBucketHistogram: _ t -> int array
155155
val logStats: _ t -> unit
156156

157-
val ofArray: ('key * 'value) array -> id:('key,'id) id -> ('key, 'value, 'id ) t
158-
[@@ocaml.deprecated "Use fromArray instead"]
159157

jscomp/others/belt_HashMapInt.ml

-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ let fromArray arr =
196196
done ;
197197
v
198198

199-
let ofArray = fromArray
200-
201199
(* TOOD: optimize heuristics for resizing *)
202200
let mergeMany h arr =
203201
let len = A.length arr in

jscomp/others/belt_HashMapInt.mli

-2
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,3 @@ val mergeMany: 'a t -> (key * 'a) array -> unit
4747
val getBucketHistogram: _ t -> int array
4848
val logStats: _ t -> unit
4949

50-
val ofArray: (key * 'a) array -> 'a t
51-
[@@ocaml.deprecated "Use fromArray instead"]

jscomp/others/belt_HashMapString.ml

-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,6 @@ let fromArray arr =
196196
done ;
197197
v
198198

199-
let ofArray = fromArray
200-
201199
(* TOOD: optimize heuristics for resizing *)
202200
let mergeMany h arr =
203201
let len = A.length arr in

jscomp/others/belt_HashMapString.mli

-2
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,3 @@ val mergeMany: 'a t -> (key * 'a) array -> unit
4747
val getBucketHistogram: _ t -> int array
4848
val logStats: _ t -> unit
4949

50-
val ofArray: (key * 'a) array -> 'a t
51-
[@@ocaml.deprecated "Use fromArray instead"]

jscomp/others/belt_HashSet.ml

-2
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ let fromArray (type a) (type identity) arr ~(id:(a,identity) id) =
186186
done ;
187187
v
188188

189-
let ofArray = fromArray
190-
191189
let mergeMany h arr =
192190
let eq, hash = C.eq h, C.hash h in
193191
let len = A.length arr in

jscomp/others/belt_HashSet.mli

-3
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ val logStats: _ t -> unit
116116

117117
val toArray: ('a,'id) t -> 'a array
118118

119-
val ofArray: 'a array -> id:('a,'id) id -> ('a,'id) t
120-
[@@ocaml.deprecated "Use fromArray instead"]
121-
122119
val fromArray: 'a array -> id:('a,'id) id -> ('a,'id) t
123120

124121
val mergeMany: ('a,'id) t -> 'a array -> unit

jscomp/others/belt_HashSetInt.ml

-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ let fromArray arr =
146146
done ;
147147
v
148148

149-
let ofArray = fromArray
150-
151149
(* TOOD: optimize heuristics for resizing *)
152150
let mergeMany h arr =
153151
let len = A.length arr in

jscomp/others/belt_HashSetInt.mli

-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ val logStats: t -> unit
6666

6767
val toArray: t -> key array
6868

69-
val ofArray: key array -> t
70-
[@@ocaml.deprecated "Use fromArray instead"]
71-
7269
val fromArray: key array -> t
7370

7471
val mergeMany: t -> key array -> unit

jscomp/others/belt_HashSetString.ml

-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ let fromArray arr =
147147
done ;
148148
v
149149

150-
let ofArray = fromArray
151-
152150
(* TOOD: optimize heuristics for resizing *)
153151
let mergeMany h arr =
154152
let len = A.length arr in

jscomp/others/belt_HashSetString.mli

-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ val logStats: t -> unit
6666

6767
val toArray: t -> key array
6868

69-
val ofArray: key array -> t
70-
[@@ocaml.deprecated "Use fromArray instead"]
71-
7269
val fromArray: key array -> t
7370

7471
val mergeMany: t -> key array -> unit

jscomp/others/belt_List.ml

-2
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,6 @@ let rec fromArrayAux a i res =
401401
let fromArray a =
402402
fromArrayAux a (A.length a - 1) []
403403

404-
let ofArray = fromArray
405-
406404
let toArray ( x : _ t) =
407405
let len = length x in
408406
let arr = A.makeUninitializedUnsafe len in

jscomp/others/belt_List.mli

+1-2
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ val mapWithIndex: 'a t -> (int -> 'a -> 'b) -> 'b t
264264
]}
265265
*)
266266

267-
val ofArray: 'a array -> 'a t
268-
[@@ocaml.deprecated "Use fromArray instead"]
267+
269268

270269
val fromArray: 'a array -> 'a t
271270
(** [fromArray arr] converts the given array to a list

jscomp/others/belt_Map.ml

-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ let fromArray (type k) (type idx) data ~(id : (k,idx) id) =
4545
let cmp = M.cmp in
4646
S.t ~cmp ~data:(Dict.fromArray ~cmp data)
4747

48-
let ofArray = fromArray
49-
5048
let remove m x =
5149
let cmp, odata = m |. S.(cmp, data) in
5250
let newData = Dict.remove odata x ~cmp in

jscomp/others/belt_Map.mli

-2
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ val toList: ('k, 'v, 'id) t -> ('k * 'v) list
208208
{b See} {!toArray}
209209
*)
210210

211-
val ofArray: ('k * 'v) array -> id:('k,'id) id -> ('k,'v,'id) t
212-
[@@ocaml.deprecated "Use fromArray instead"]
213211

214212
val fromArray: ('k * 'v) array -> id:('k,'id) id -> ('k,'v,'id) t
215213
(** [fromArray kvs ~id]

jscomp/others/belt_MapDict.ml

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ type ('key, 'id) cmp = ('key, 'id) Belt_Id.cmp
3131

3232
let empty = N.empty
3333
let fromArray = N.fromArray
34-
let ofArray = N.fromArray
3534
let isEmpty = N.isEmpty
3635
let cmp = N.cmp
3736
let cmpU = N.cmpU

jscomp/others/belt_MapDict.mli

-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ val toList: ('k, 'a, 'id) t -> ('k * 'a) list
9595

9696
val toArray: ('k, 'a, 'id) t -> ('k * 'a) array
9797

98-
val ofArray: ('k * 'a) array -> cmp:('k,'id) cmp -> ('k,'a,'id) t
99-
[@@ocaml.deprecated "Use fromArray instead"]
10098

10199
val fromArray: ('k * 'a) array -> cmp:('k,'id) cmp -> ('k,'a,'id) t
102100

jscomp/others/belt_MapInt.ml

-1
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,3 @@ let split = I.split
164164
let mergeU = I.mergeU
165165
let merge = I.merge
166166
let fromArray = I.fromArray
167-
let ofArray = I.fromArray

jscomp/others/belt_MapInt.mli

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 4 "map.cppo.mli"
22
type key = int
3-
# 8
3+
# 8 "map.cppo.mli"
44
type 'value t
55
(** The type of maps from type [key] to type ['value]. *)
66

@@ -49,8 +49,6 @@ val toList: 'v t -> (key * 'v) list
4949

5050
val toArray: 'v t -> (key * 'v) array
5151

52-
val ofArray: (key * 'v) array -> 'v t
53-
[@@ocaml.deprecated "Use fromArray instead"]
5452

5553
val fromArray: (key * 'v) array -> 'v t
5654

@@ -121,8 +119,6 @@ val merge:
121119

122120
val mergeMany: 'v t -> (key * 'v) array -> 'v t
123121

124-
[@@ocaml.deprecated "Use mergeMany instead"]
125-
val mergeArray: 'v t -> (key * 'v) array -> 'v t
126122

127123
val keepU:
128124
'v t ->

jscomp/others/belt_MapString.ml

-1
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,3 @@ let split = I.split
164164
let mergeU = I.mergeU
165165
let merge = I.merge
166166
let fromArray = I.fromArray
167-
let ofArray = I.fromArray

jscomp/others/belt_MapString.mli

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 2 "map.cppo.mli"
22
type key = string
3-
# 8
3+
# 8 "map.cppo.mli"
44
type 'value t
55
(** The type of maps from type [key] to type ['value]. *)
66

@@ -49,8 +49,6 @@ val toList: 'v t -> (key * 'v) list
4949

5050
val toArray: 'v t -> (key * 'v) array
5151

52-
val ofArray: (key * 'v) array -> 'v t
53-
[@@ocaml.deprecated "Use fromArray instead"]
5452

5553
val fromArray: (key * 'v) array -> 'v t
5654

@@ -121,8 +119,6 @@ val merge:
121119

122120
val mergeMany: 'v t -> (key * 'v) array -> 'v t
123121

124-
[@@ocaml.deprecated "Use mergeMany instead"]
125-
val mergeArray: 'v t -> (key * 'v) array -> 'v t
126122

127123
val keepU:
128124
'v t ->

jscomp/others/belt_MutableMap.ml

+1-3
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ let fromArray (type k) (type identity) data ~(id : (k,identity) id)=
220220
let module M = (val id ) in
221221
let cmp = M.cmp in
222222
S.t ~cmp ~data:(N.fromArray ~cmp data)
223-
224-
let ofArray = fromArray
225-
223+
226224
let set m e v =
227225
let oldRoot = S.data m in
228226
let newRoot = N.updateMutate ~cmp:(S.cmp m) oldRoot e v in

jscomp/others/belt_MutableMap.mli

-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ val checkInvariantInternal: _ t -> unit
113113
{b raise} when invariant is not held
114114
*)
115115

116-
val ofArray: ('k * 'a) array -> id:('k,'id) id -> ('k,'a,'id) t
117-
[@@ocaml.deprecated "Use fromArray instead"]
118116

119117
(****************************************************************************)
120118

jscomp/others/belt_MutableMapInt.ml

-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ let removeMany (type key) (type id) (d : _ t) xs =
158158
let fromArray xs =
159159
t ~data:(I.fromArray xs)
160160

161-
let ofArray = fromArray
162-
163161
let cmpU d0 d1 f =
164162
I.cmpU (data d0) (data d1) f
165163
let cmp d0 d1 f = cmpU d0 d1 (fun[@bs] a b -> f a b)

jscomp/others/belt_MutableMapInt.mli

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
* along with this program; if not, write to the Free Software
2424
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2525

26-
# 28
26+
# 28 "mapm.cppo.mli"
2727
type key = int
28-
# 32
28+
# 32 "mapm.cppo.mli"
2929
type 'a t
3030

3131

@@ -81,8 +81,6 @@ val toList: 'a t -> (key * 'a) list
8181
(** In increasing order *)
8282
val toArray: 'a t -> (key * 'a) array
8383

84-
val ofArray: (key * 'a) array -> 'a t
85-
[@@ocaml.deprecated "Use fromArray instead"]
8684

8785
val fromArray: (key * 'a) array -> 'a t
8886
val keysToArray: 'a t -> key array

jscomp/others/belt_MutableMapString.ml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 5 "mapm.cppo.ml"
22
module I = Belt_internalMapString
33
type key = string
4-
# 10
4+
# 10 "mapm.cppo.ml"
55
module N = Belt_internalAVLtree
66
module A = Belt_Array
77

@@ -158,8 +158,6 @@ let removeMany (type key) (type id) (d : _ t) xs =
158158
let fromArray xs =
159159
t ~data:(I.fromArray xs)
160160

161-
let ofArray = fromArray
162-
163161
let cmpU d0 d1 f =
164162
I.cmpU (data d0) (data d1) f
165163
let cmp d0 d1 f = cmpU d0 d1 (fun[@bs] a b -> f a b)

jscomp/others/belt_MutableMapString.mli

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
* along with this program; if not, write to the Free Software
2424
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2525

26-
# 26
26+
# 26 "mapm.cppo.mli"
2727
type key = string
28-
# 32
28+
# 32 "mapm.cppo.mli"
2929
type 'a t
3030

3131

@@ -81,8 +81,6 @@ val toList: 'a t -> (key * 'a) list
8181
(** In increasing order *)
8282
val toArray: 'a t -> (key * 'a) array
8383

84-
val ofArray: (key * 'a) array -> 'a t
85-
[@@ocaml.deprecated "Use fromArray instead"]
8684

8785
val fromArray: (key * 'a) array -> 'a t
8886
val keysToArray: 'a t -> key array

jscomp/others/belt_MutableQueue.ml

-1
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,3 @@ let fromArray arr =
220220
done ;
221221
q
222222

223-
let ofArray = fromArray

jscomp/others/belt_MutableQueue.mli

-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ val clear: 'a t -> unit
3030
val isEmpty: 'a t -> bool
3131
(** @return [true] if the given queue is empty, [false] otherwise. *)
3232

33-
val ofArray: 'a array -> 'a t
34-
[@@ocaml.deprecated "Use fromArray instead"]
35-
3633
val fromArray: 'a array -> 'a t
3734
(** [fromArray a] is equivalent to [Array.forEach a (add q a)] *)
3835

jscomp/others/belt_MutableSet.ml

+1-4
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ let fromSortedArrayUnsafe (type value) (type identity) xs ~(id : (value,identity
224224
let module M = (val id) in
225225
S.t ~data:(N.fromSortedArrayUnsafe xs) ~cmp:M.cmp
226226

227-
let ofSortedArrayUnsafe = fromSortedArrayUnsafe
228-
229227
let checkInvariantInternal d =
230228
N.checkInvariantInternal (S.data d)
231229

@@ -235,8 +233,7 @@ let fromArray (type value) (type identity) data ~(id : (value,identity) id) =
235233
let cmp = M.cmp in
236234
S.t ~cmp ~data:(N.fromArray ~cmp data)
237235

238-
let ofArray = fromArray
239-
236+
240237
let cmp d0 d1 =
241238
N.cmp ~cmp:(S.cmp d0) (S.data d0) (S.data d1)
242239

jscomp/others/belt_MutableSet.mli

-4
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,4 @@ val checkInvariantInternal: _ t -> unit
148148
2. It is not really significantly more *)
149149

150150

151-
val ofArray: 'k array -> id:('k, 'id) id -> ('k, 'id) t
152-
[@@ocaml.deprecated "Use fromArray instead"]
153151

154-
val ofSortedArrayUnsafe: 'value array -> id:('value, 'id) id -> ('value,'id) t
155-
[@@ocaml.deprecated "Use fromSortedArrayUnsafe instead"]

jscomp/others/belt_MutableSetInt.ml

-4
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ let toArray d =
220220
let fromSortedArrayUnsafe xs =
221221
t ~data:(N.fromSortedArrayUnsafe xs)
222222

223-
let ofSortedArrayUnsafe = fromSortedArrayUnsafe
224-
225223
let checkInvariantInternal d =
226224
N.checkInvariantInternal (data d)
227225

@@ -230,8 +228,6 @@ let checkInvariantInternal d =
230228
let fromArray xs =
231229
t ~data:(I.fromArray xs)
232230

233-
let ofArray = fromArray
234-
235231
let cmp d0 d1 =
236232
I.cmp (data d0) (data d1)
237233
let eq d0 d1 =

jscomp/others/belt_MutableSetInt.mli

-5
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ val make: unit -> t
4646
val fromArray: value array -> t
4747
val fromSortedArrayUnsafe: value array -> t
4848

49-
val ofArray: value array -> t
50-
[@@ocaml.deprecated "Use fromArray instead"]
51-
val ofSortedArrayUnsafe: value array -> t
52-
[@@ocaml.deprecated "Use fromSortedArrayUnsafe instead"]
53-
5449
val copy: t -> t
5550
val isEmpty: t -> bool
5651
val has: t -> value -> bool

0 commit comments

Comments
 (0)