Skip to content

Commit 52f64e8

Browse files
authored
Merge pull request #2634 from chenglou/whatever
Revert the uncurried doc categorization changes
2 parents bc63f2b + 053110d commit 52f64e8

Some content is hidden

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

60 files changed

+1171
-1453
lines changed

jscomp/others/belt_Array.mli

Lines changed: 73 additions & 95 deletions
Large diffs are not rendered by default.

jscomp/others/belt_HashMap.mli

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
For example:
3232
{[
33-
type t = int
33+
type t = int
3434
module I0 =
3535
(val Belt.Id.hashableU
3636
~hash:(fun[\@bs] (a : t) -> a & 0xff_ff)
@@ -75,13 +75,13 @@ module Int = Belt_HashMapInt
7575

7676

7777
(** Specalized when key type is [string], more efficient
78-
than the gerneic type *)
78+
than the gerneic type *)
7979
module String = Belt_HashMapString
8080

8181

8282

8383

84-
type ('key,'value,'id) t
84+
type ('key,'value,'id) t
8585
(** The type of hash tables from type ['key] to type ['value]. *)
8686

8787
type ('a, 'id) id = ('a, 'id) Belt_Id.hashable
@@ -93,30 +93,32 @@ val make: hintSize:int -> id:('key, 'id) id -> ('key,'value,'id) t
9393
val clear: ('key, 'value, 'id ) t -> unit
9494
(** Empty a hash table. *)
9595

96-
val isEmpty: _ t -> bool
96+
val isEmpty: _ t -> bool
9797

9898
val set: ('key, 'value, 'id ) t -> 'key -> 'value -> unit
9999
(** [set tbl k v] if [k] does not exist,
100100
add the binding [k,v], otherwise, update the old value with the new
101101
[v]
102102
*)
103-
103+
104104
val copy: ('key, 'value, 'id ) t -> ('key, 'value, 'id ) t
105-
105+
106106
val get: ('key, 'value, 'id ) t -> 'key -> 'value option
107107

108-
108+
109109
val has: ('key, 'value, 'id ) t -> 'key -> bool
110110
(** [has tbl x] checks if [x] is bound in [tbl]. *)
111111

112112
val remove: ('key, 'value, 'id ) t -> 'key -> unit
113113

114+
val forEachU: ('key, 'value, 'id ) t -> ('key -> 'value -> unit [@bs]) -> unit
114115
val forEach: ('key, 'value, 'id ) t -> ('key -> 'value -> unit) -> unit
115116
(** [forEach tbl f] applies [f] to all bindings in table [tbl].
116117
[f] receives the key as first argument, and the associated value
117118
as second argument. Each binding is presented exactly once to [f].
118119
*)
119120

121+
val reduceU: ('key, 'value, 'id ) t -> 'c -> ('c -> 'key -> 'value -> 'c [@bs]) -> 'c
120122
val reduce: ('key, 'value, 'id ) t -> 'c -> ('c -> 'key -> 'value -> 'c) -> 'c
121123
(** [reduce tbl init f] computes
122124
[(f kN dN ... (f k1 d1 init)...)],
@@ -131,10 +133,11 @@ val reduce: ('key, 'value, 'id ) t -> 'c -> ('c -> 'key -> 'value -> 'c) -> 'c
131133
*)
132134

133135

136+
val keepMapInPlaceU: ('key, 'value, 'id ) t -> ('key -> 'value -> 'value option [@bs]) -> unit
134137
val keepMapInPlace: ('key, 'value, 'id ) t -> ('key -> 'value -> 'value option ) -> unit
135138

136139

137-
val size: _ t -> int
140+
val size: _ t -> int
138141
(** [size tbl] returns the number of bindings in [tbl].
139142
It takes constant time. *)
140143

@@ -143,23 +146,14 @@ val size: _ t -> int
143146

144147

145148

146-
val toArray: ('key, 'value, 'id ) t -> ('key * 'value) array
147-
val keysToArray: ('key, _, _) t -> 'key array
148-
val valuesToArray: (_,'value,_) t -> 'value array
149-
val fromArray: ('key * 'value) array -> id:('key,'id) id -> ('key, 'value, 'id ) t
149+
val toArray: ('key, 'value, 'id ) t -> ('key * 'value) array
150+
val keysToArray: ('key, _, _) t -> 'key array
151+
val valuesToArray: (_,'value,_) t -> 'value array
152+
val fromArray: ('key * 'value) array -> id:('key,'id) id -> ('key, 'value, 'id ) t
150153
val mergeMany: ('key, 'value, 'id ) t -> ('key * 'value) array -> unit
151154
val getBucketHistogram: _ t -> int array
152155
val logStats: _ t -> unit
153156

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

157-
158-
(** {1 Uncurried version} *)
159-
160-
161-
val forEachU: ('key, 'value, 'id ) t -> ('key -> 'value -> unit [@bs]) -> unit
162-
163-
val reduceU: ('key, 'value, 'id ) t -> 'c -> ('c -> 'key -> 'value -> 'c [@bs]) -> 'c
164-
165-
val keepMapInPlaceU: ('key, 'value, 'id ) t -> ('key -> 'value -> 'value option [@bs]) -> unit

jscomp/others/belt_HashMapInt.mli

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,40 @@ type key = int
33

44

55
# 10 "hashmap.cppo.mli"
6-
type 'b t
6+
type 'b t
77

88

9-
val make: hintSize:int -> 'b t
9+
val make: hintSize:int -> 'b t
1010

1111
val clear: 'b t -> unit
1212

1313
val isEmpty: _ t -> bool
14-
14+
1515
val set: 'a t -> key -> 'a -> unit
1616
(** [setDone tbl k v] if [k] does not exist,
1717
add the binding [k,v], otherwise, update the old value with the new
1818
[v]
1919
*)
20+
2021

21-
22-
val copy: 'a t -> 'a t
22+
val copy: 'a t -> 'a t
2323
val get: 'a t -> key -> 'a option
2424

2525
val has: 'b t -> key -> bool
2626

2727
val remove: 'a t -> key -> unit
2828

29+
val forEachU: 'b t -> (key -> 'b -> unit [@bs]) -> unit
2930
val forEach: 'b t -> (key -> 'b -> unit) -> unit
3031

32+
val reduceU: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
3133
val reduce: 'b t -> 'c -> ('c -> key -> 'b -> 'c) -> 'c
3234

35+
val keepMapInPlaceU: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit
3336
val keepMapInPlace: 'a t -> (key -> 'a -> 'a option) -> unit
3437

35-
36-
val size: _ t -> int
38+
39+
val size: _ t -> int
3740

3841

3942
val toArray: 'a t -> (key * 'a) array
@@ -46,11 +49,3 @@ val logStats: _ t -> unit
4649

4750
val ofArray: (key * 'a) array -> 'a t
4851
[@@ocaml.deprecated "Use fromArray instead"]
49-
50-
51-
(** {1 Uncurried version} *)
52-
53-
54-
val forEachU: 'b t -> (key -> 'b -> unit [@bs]) -> unit
55-
val reduceU: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
56-
val keepMapInPlaceU: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit

jscomp/others/belt_HashMapString.mli

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,40 @@ type key = string
33

44

55
# 10 "hashmap.cppo.mli"
6-
type 'b t
6+
type 'b t
77

88

9-
val make: hintSize:int -> 'b t
9+
val make: hintSize:int -> 'b t
1010

1111
val clear: 'b t -> unit
1212

1313
val isEmpty: _ t -> bool
14-
14+
1515
val set: 'a t -> key -> 'a -> unit
1616
(** [setDone tbl k v] if [k] does not exist,
1717
add the binding [k,v], otherwise, update the old value with the new
1818
[v]
1919
*)
20+
2021

21-
22-
val copy: 'a t -> 'a t
22+
val copy: 'a t -> 'a t
2323
val get: 'a t -> key -> 'a option
2424

2525
val has: 'b t -> key -> bool
2626

2727
val remove: 'a t -> key -> unit
2828

29+
val forEachU: 'b t -> (key -> 'b -> unit [@bs]) -> unit
2930
val forEach: 'b t -> (key -> 'b -> unit) -> unit
3031

32+
val reduceU: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
3133
val reduce: 'b t -> 'c -> ('c -> key -> 'b -> 'c) -> 'c
3234

35+
val keepMapInPlaceU: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit
3336
val keepMapInPlace: 'a t -> (key -> 'a -> 'a option) -> unit
3437

35-
36-
val size: _ t -> int
38+
39+
val size: _ t -> int
3740

3841

3942
val toArray: 'a t -> (key * 'a) array
@@ -46,11 +49,3 @@ val logStats: _ t -> unit
4649

4750
val ofArray: (key * 'a) array -> 'a t
4851
[@@ocaml.deprecated "Use fromArray instead"]
49-
50-
51-
(** {1 Uncurried version} *)
52-
53-
54-
val forEachU: 'b t -> (key -> 'b -> unit [@bs]) -> unit
55-
val reduceU: 'b t -> 'c -> ('c -> key -> 'b -> 'c [@bs]) -> 'c
56-
val keepMapInPlaceU: 'a t -> (key -> 'a -> 'a option [@bs]) -> unit

jscomp/others/belt_HashSet.mli

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
For example:
3232
{[
33-
type t = int
33+
type t = int
3434
module I0 =
3535
(val Belt.Id.hashableU
3636
~hash:(fun[\@bs] (a : t) -> a & 0xff_ff)
@@ -74,7 +74,7 @@
7474
module Int = Belt_HashSetInt
7575

7676
(** Specalized when key type is [string], more efficient
77-
than the gerneic type *)
77+
than the gerneic type *)
7878
module String = Belt_HashSetString
7979

8080
(* TODO: add a poly module
@@ -83,8 +83,8 @@ module String = Belt_HashSetString
8383
- generic equal handles JS data structure
8484
- eq/hash consistent
8585
*)
86-
87-
type ('a, 'id) t
86+
87+
type ('a, 'id) t
8888

8989
(** The type of hash tables from type ['a] to type ['b]. *)
9090

@@ -102,31 +102,27 @@ val has: ('a, 'id) t -> 'a -> bool
102102

103103
val remove: ('a, 'id) t -> 'a -> unit
104104

105+
val forEachU: ('a, 'id) t -> ('a -> unit [@bs]) -> unit
105106
val forEach: ('a, 'id) t -> ('a -> unit) -> unit
106107
(** Order unspecified. *)
107108

109+
val reduceU: ('a, 'id) t -> 'c -> ('c -> 'a -> 'c [@bs]) -> 'c
108110
val reduce: ('a, 'id) t -> 'c -> ('c -> 'a -> 'c) -> 'c
109111
(** Order unspecified. *)
110112

111-
val size: ('a, 'id) t -> int
113+
val size: ('a, 'id) t -> int
112114

113115
val logStats: _ t -> unit
114116

115-
val toArray: ('a,'id) t -> 'a array
117+
val toArray: ('a,'id) t -> 'a array
116118

117-
val ofArray: 'a array -> id:('a,'id) id -> ('a,'id) t
119+
val ofArray: 'a array -> id:('a,'id) id -> ('a,'id) t
118120
[@@ocaml.deprecated "Use fromArray instead"]
119121

120-
val fromArray: 'a array -> id:('a,'id) id -> ('a,'id) t
122+
val fromArray: 'a array -> id:('a,'id) id -> ('a,'id) t
121123

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

124126
val getBucketHistogram: _ t -> int array
125127

126128

127-
(** {1 Uncurried version} *)
128-
129-
130-
val forEachU: ('a, 'id) t -> ('a -> unit [@bs]) -> unit
131-
132-
val reduceU: ('a, 'id) t -> 'c -> ('c -> 'a -> 'c [@bs]) -> 'c

jscomp/others/belt_HashSetInt.mli

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# 2 "hashset.cppo.mli"
33
(* Copyright (C) 2017 Authors of BuckleScript
4-
*
4+
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
77
* the Free Software Foundation, either version 3 of the License, or
@@ -19,7 +19,7 @@
1919
* but WITHOUT ANY WARRANTY; without even the implied warranty of
2020
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2121
* GNU Lesser General Public License for more details.
22-
*
22+
*
2323
* You should have received a copy of the GNU Lesser General Public License
2424
* along with this program; if not, write to the Free Software
2525
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
@@ -40,43 +40,37 @@ type key = int
4040
# 44 "hashset.cppo.mli"
4141
type t
4242

43-
val make: hintSize:int -> t
43+
val make: hintSize:int -> t
4444

4545
val clear: t -> unit
4646

4747
val isEmpty: t -> bool
48-
48+
4949
val add: t -> key -> unit
5050

5151
val copy: t -> t
52-
52+
5353
val has: t -> key -> bool
54-
54+
5555
val remove: t -> key -> unit
5656

57+
val forEachU: t -> (key -> unit [@bs]) -> unit
5758
val forEach: t -> (key -> unit) -> unit
58-
59+
60+
val reduceU: t -> 'c -> ( 'c -> key -> 'c [@bs]) -> 'c
5961
val reduce: t -> 'c -> ( 'c -> key -> 'c) -> 'c
60-
61-
val size: t -> int
62+
63+
val size: t -> int
6264

6365
val logStats: t -> unit
6466

65-
val toArray: t -> key array
67+
val toArray: t -> key array
6668

67-
val ofArray: key array -> t
69+
val ofArray: key array -> t
6870
[@@ocaml.deprecated "Use fromArray instead"]
6971

70-
val fromArray: key array -> t
72+
val fromArray: key array -> t
7173

7274
val mergeMany: t -> key array -> unit
7375

7476
val getBucketHistogram: t -> int array
75-
76-
77-
(** {1 Uncurried version} *)
78-
79-
80-
val forEachU: t -> (key -> unit [@bs]) -> unit
81-
82-
val reduceU: t -> 'c -> ( 'c -> key -> 'c [@bs]) -> 'c

0 commit comments

Comments
 (0)