Skip to content

Commit 30dc28d

Browse files
Sync docs for belt_MutableMapString.mli
1 parent 9a49a37 commit 30dc28d

File tree

1 file changed

+28
-33
lines changed

1 file changed

+28
-33
lines changed

jscomp/others/belt_MutableMapString.mli

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,15 @@
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 = string
28+
type t<'a>
29+
```
30+
*)
31+
2632
# 26 "others/mapm.cppo.mli"
2733
type key = string
34+
2835
# 32 "others/mapm.cppo.mli"
2936
type 'a t
3037

@@ -37,41 +44,34 @@ val has: 'a t -> key -> bool
3744

3845
val cmpU: 'a t -> 'a t -> ('a -> 'a -> int [@bs]) -> int
3946
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-
*)
47+
(** `cmp(m1, m2, cmp)` First compare by size, if size is the same, compare by
48+
key, value pair. *)
4449

4550
val eqU: 'a t -> 'a t -> ('a -> 'a -> bool [@bs]) -> bool
4651
val eq: 'a t -> 'a t -> ('a -> 'a -> bool ) -> bool
47-
(** `eq m1 m2 cmp` *)
52+
(** `eq(m1, m2, cmp)` *)
4853

4954
val forEachU: 'a t -> (key -> 'a -> unit [@bs]) -> unit
5055
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. *)
56+
(** `forEach(m, f)` applies `f` to all bindings in map `m`. `f` receives the
57+
key as first argument, and the associated value as second argument. The
58+
application order of `f` is in increasing order. *)
5559

5660
val reduceU: 'a t -> 'b -> ('b -> key -> 'a -> 'b [@bs]) -> 'b
5761
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. *)
62+
(** `reduce(m, a, f), computes`(f(kN, dN) ... (f(k1, d1, a))...)`, where`k1 ...
63+
kN`are the keys of all bindings in`m`(in increasing order), and`d1 ... dN`
64+
are the associated data. *)
6165

6266
val everyU: 'a t -> (key -> 'a -> bool [@bs]) -> bool
6367
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-
*)
68+
(** `every(m, p)` checks if all the bindings of the map satisfy the predicate
69+
`p`. The application order of `p` is unspecified. *)
6870

6971
val someU: 'a t -> (key -> 'a -> bool [@bs]) -> bool
7072
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-
*)
73+
(** `some(m, p)` checks if at least one binding of the map satisfy the
74+
predicate `p`. The application order of `p` is unspecified. *)
7575

7676

7777

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

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

8685
val fromArray: (key * 'a) array -> 'a t
8786
val keysToArray: 'a t -> key array
@@ -99,9 +98,7 @@ val getUndefined: 'a t -> key -> 'a Js.undefined
9998
val getWithDefault: 'a t -> key -> 'a -> 'a
10099
val getExn: 'a t -> key -> 'a
101100
val checkInvariantInternal: _ t -> unit
102-
(**
103-
**raise** when invariant is not held
104-
*)
101+
(** Raise when invariant is not held. *)
105102

106103

107104

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

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

115112
val removeMany: 'a t -> key array -> unit
116113

117114
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. *)
115+
(** `set(m, x, y)` do the in-place modification, return `m` for chaining. If
116+
`x` was already bound in `m`, its previous binding disappears. *)
121117

122118
val updateU: 'a t -> key -> ('a option -> 'a option [@bs]) -> unit
123119
val update: 'a t -> key -> ('a option -> 'a option) -> unit
124120

125121

126122
val mapU: 'a t -> ('a -> 'b [@bs]) -> 'b t
127123
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. *)
124+
(** `map(m, f)` returns a map with same domain as `m`, where the associated
125+
value a of all bindings of `m` has been replaced by the result of the
126+
application of `f` to `a`. The bindings are passed to `f` in increasing
127+
order with respect to the ordering over the type of the keys. *)
133128

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

0 commit comments

Comments
 (0)