Skip to content

Commit ff17c45

Browse files
Sync docs for belt_MutableMapInt.mli
1 parent 7867f9f commit ff17c45

File tree

1 file changed

+27
-33
lines changed

1 file changed

+27
-33
lines changed

jscomp/others/belt_MutableMapInt.mli

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
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+
(* ```res prelude
27+
type key = int
28+
type t<'a>
29+
```
30+
*)
31+
2632
# 28 "others/mapm.cppo.mli"
2733
type key = int
2834
# 32 "others/mapm.cppo.mli"
@@ -37,41 +43,34 @@ val has: 'a t -> key -> bool
3743

3844
val cmpU: 'a t -> 'a t -> ('a -> 'a -> int [@bs]) -> int
3945
val cmp: 'a t -> 'a t -> ('a -> 'a -> int) -> int
40-
(** `cmp m1 m2 cmp`
41-
First compare by size, if size is the same,
42-
compare by key, value pair
43-
*)
46+
(** `cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by
47+
key, value pair. *)
4448

4549
val eqU: 'a t -> 'a t -> ('a -> 'a -> bool [@bs]) -> bool
4650
val eq: 'a t -> 'a t -> ('a -> 'a -> bool ) -> bool
47-
(** `eq m1 m2 cmp` *)
51+
(** `eq(m1, m2, cmp)` *)
4852

4953
val forEachU: 'a t -> (key -> 'a -> unit [@bs]) -> unit
5054
val forEach: 'a t -> (key -> 'a -> unit) -> unit
51-
(** `forEach m f` applies `f` to all bindings in map `m`.
52-
`f` receives the key as first argument, and the associated value
53-
as second argument.
54-
The application order of `f` is in increasing order. *)
55+
(** `forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the
56+
key as first argument, and the associated value as second argument. The
57+
application order of `f` is in increasing order. *)
5558

5659
val reduceU: 'a t -> 'b -> ('b -> key -> 'a -> 'b [@bs]) -> 'b
5760
val reduce: 'a t -> 'b -> ('b -> key -> 'a -> 'b ) -> 'b
58-
(** `reduce m a f` computes `(f kN dN ... (f k1 d1 a)...)`,
59-
where `k1 ... kN` are the keys of all bindings in `m`
60-
(in increasing order), and `d1 ... dN` are the associated data. *)
61+
(** `reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...
62+
kN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`
63+
are the associated data. *)
6164

6265
val everyU: 'a t -> (key -> 'a -> bool [@bs]) -> bool
6366
val every: 'a t -> (key -> 'a -> bool) -> bool
64-
(** `every m p` checks if all the bindings of the map
65-
satisfy the predicate `p`.
66-
The application order of `p` is unspecified.
67-
*)
67+
(** `every(m, p)` checks if all the bindings of the map satisfy the predicate
68+
`p`. The application order of `p` is unspecified. *)
6869

6970
val someU: 'a t -> (key -> 'a -> bool [@bs]) -> bool
7071
val some: 'a t -> (key -> 'a -> bool) -> bool
71-
(** `some m p` checks if at least one binding of the map
72-
satisfy the predicate `p`.
73-
The application order of `p` is unspecified.
74-
*)
72+
(** `some(m, p)` checks if at least one binding of the map satisfy the
73+
predicate `p`. The application order of `p` is unspecified. *)
7574

7675

7776

@@ -81,7 +80,6 @@ val toList: 'a t -> (key * 'a) list
8180
(** In increasing order *)
8281

8382
val toArray: 'a t -> (key * 'a) array
84-
(** In increasing order *)
8583

8684
val fromArray: (key * 'a) array -> 'a t
8785
val keysToArray: 'a t -> key array
@@ -99,9 +97,7 @@ val getUndefined: 'a t -> key -> 'a Js.undefined
9997
val getWithDefault: 'a t -> key -> 'a -> 'a
10098
val getExn: 'a t -> key -> 'a
10199
val checkInvariantInternal: _ t -> unit
102-
(**
103-
**raise** when invariant is not held
104-
*)
100+
(** Raise when invariant is not held. *)
105101

106102

107103

@@ -110,26 +106,24 @@ val checkInvariantInternal: _ t -> unit
110106
(*TODO: add functional `merge, partition, keep, split`*)
111107

112108
val remove: 'a t -> key -> unit
113-
(** `remove m x` do the in-place modification *)
109+
(** `remove(m, x)` do the in-place modification. *)
114110

115111
val removeMany: 'a t -> key array -> unit
116112

117113
val set: 'a t -> key -> 'a -> unit
118-
(** `set m x y` do the in-place modification, return
119-
`m` for chaining. If `x` was already bound
120-
in `m`, its previous binding disappears. *)
114+
(** `set(m, x, y)` do the in-place modification, return `m` for chaining. If
115+
`x` was already bound in `m`, its previous binding disappears. *)
121116

122117
val updateU: 'a t -> key -> ('a option -> 'a option [@bs]) -> unit
123118
val update: 'a t -> key -> ('a option -> 'a option) -> unit
124119

125120

126121
val mapU: 'a t -> ('a -> 'b [@bs]) -> 'b t
127122
val map: 'a t -> ('a -> 'b) -> 'b t
128-
(** `map m f` returns a map with same domain as `m`, where the
129-
associated value `a` of all bindings of `m` has been
130-
replaced by the result of the application of `f` to `a`.
131-
The bindings are passed to `f` in increasing order
132-
with respect to the ordering over the type of the keys. *)
123+
(** `map(m, f)` returns a map with same domain as `m`, where the associated
124+
value a of all bindings of `m` has been replaced by the result of the
125+
application of `f` to `a`. The bindings are passed to `f` in increasing
126+
order with respect to the ordering over the type of the keys. *)
133127

134128
val mapWithKeyU: 'a t -> (key -> 'a -> 'b [@bs]) -> 'b t
135129
val mapWithKey: 'a t -> (key -> 'a -> 'b) -> 'b t

0 commit comments

Comments
 (0)