Skip to content

Commit 38481f2

Browse files
committed
Fix typos
1 parent c539dd2 commit 38481f2

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

pages/docs/manual/v8.0.0/interop-cheatsheet.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ var result3 = Caml_option.nullable_to_opt(10);
111111
[@bs.send] external filter: (array('a), 'a => 'b) => array('b) = "filter";
112112
[|1, 2, 3|]
113113
->map(a => a + 1)
114-
->filter(a => mod(a, 2) == 0)
114+
->filter(a => a mod 2 == 0)
115115
->Js.log;
116116
```
117117
```js

pages/docs/manual/v8.0.0/module.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ module type Comparable = {
388388

389389
module MakeSet = (Item: Comparable) => {
390390
// let's use a list as our naive backing data structure
391-
type backingType = list<Item.t>;
391+
type backingType = list(Item.t);
392392
let empty = [];
393393
let add = (currentSet: backingType, newItem: Item.t): backingType =>
394394
// if item exists

pages/docs/manual/v8.0.0/overview.mdx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ canonical: "https://rescript-lang.org/docs/manual/latest/overview"
3131

3232
### String & Character
3333

34-
| JavaScript | Us |
35-
| --------------------------| --------------------- |
36-
| `"Hello world!"` | Same |
37-
| `'Hello world!'` | Strings must use `"` |
38-
| `"hello " + "world"` | `"hello " ++ "world"` |
39-
| `` `hello ${message}` `` | Same |
34+
| JavaScript | Us |
35+
| --------------------------| ----------------------- |
36+
| `"Hello world!"` | Same |
37+
| `'Hello world!'` | Strings must use `"` |
38+
| `"hello " + "world"` | `"hello " ++ "world"` |
39+
| `` `hello ${message}` `` | <code>{j&#124;Hello $(message)&#124;j}</code>|
4040

4141
### Boolean
4242

@@ -57,7 +57,7 @@ canonical: "https://rescript-lang.org/docs/manual/latest/overview"
5757
| `3.1415` | Same |
5858
| `3 + 4` | Same |
5959
| `3.0 + 4.5` | `3.0 +. 4.5` |
60-
| `5 % 3` | `mod(5, 3)` |
60+
| `5 % 3` | `5 mod 3` |
6161

6262
\* JS has no distinction between integer and float.
6363

@@ -75,7 +75,7 @@ canonical: "https://rescript-lang.org/docs/manual/latest/overview"
7575

7676
| JavaScript | Us |
7777
| --------------------- | ---------------------------------- |
78-
| `[1, 2, 3]` | Same |
78+
| `[1, 2, 3]` | `[|1, 2, 3|]` |
7979
| `myArray[1] = 10` | Same |
8080
| `[1, "Bob", true]` | `(1, "Bob", true)` \* |
8181

@@ -142,7 +142,7 @@ canonical: "https://rescript-lang.org/docs/manual/latest/overview"
142142
| JavaScript | Us |
143143
| ----------------------------- | --------------------------------------------- |
144144
| `const {a, b} = data` | `let {a, b} = data` |
145-
| `const [a, b] = data` | <code>let [a, b] = data</code> \* |
145+
| `const [a, b] = data` | <code>let [&#124;a, b&#124;] = data</code> \* |
146146
| `const {a: aa, b: bb} = data` | `let {a: aa, b: bb} = data` |
147147

148148
\* Gives good compiler warning that `data` might not be of length 2.
@@ -168,10 +168,10 @@ canonical: "https://rescript-lang.org/docs/manual/latest/overview"
168168

169169
### Exception
170170

171-
| JavaScript | Us |
172-
| ----------------------------------------------- | ------------------------------------------ |
173-
| `throw new SomeError(...)` | `raise(SomeError(...))` |
174-
| `try {a} catch (Err) {...} finally {...}` | <code>try a catch { &#124; Err => ...}</code> \* |
171+
| JavaScript | Us |
172+
| ----------------------------------------- | ------------------------------------------ |
173+
| `throw new SomeError(...)` | `raise(SomeError(...))` |
174+
| `try {a} catch (Err) {...} finally {...}` | <code>try a catch { &#124; Err => ...}</code> \* |
175175

176176
\* No finally.
177177

@@ -211,7 +211,7 @@ The last expression of a block delimited by `{}` implicitly returns (including f
211211
Feature | Example | JavaScript Output
212212
--------------------------------|--------------------------------------|----------------------
213213
String | `"Hello"` | `"Hello"`
214-
String Interpolation | `` `Hello ${message}` `` | `"Hello " + message`
214+
String Interpolation | <code>{j&#124;Hello $(message)&#124;j}</code> | `"Hello " + message`
215215
Character (disrecommended) | `'x'` | `120` (char code)
216216
Integer | `23`, `-23` | `23`, `-23`
217217
Float | `23.0`, `-23.0` | `23.0`, `-23.0`
@@ -226,7 +226,7 @@ Boolean operation | `!`, `&&`, <code>&#124;&#124;</code> | `!`, `&
226226
Shallow and deep Equality | `===`, `==` | `===`, `==`
227227
List (disrecommended) | `[1, 2, 3]` | `{hd: 1, tl: {hd: 2, tl: {hd: 3, tl: 0}}}`
228228
List Prepend | `[a1, a2, ...oldList]` | `{hd: a1, tl: {hd: a2, tl: theRest}}`
229-
Array | `[1, 2, 3]` | `[1, 2, 3]`
229+
Array | <code>[&#124;1, 2, 3&#124;]</code> | `[1, 2, 3]`
230230
Record | `type t = {b: int}; let a = {b: 10}` | `var a = {b: 10}`
231231
Multiline Comment | `/* Comment here */` | Not in output
232232
Single line Comment | `// Comment here` | Not in output

pages/docs/manual/v8.0.0/pattern-matching-destructuring.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ let message = switch (person1) {
240240
"Hey, still going to the party on Saturday?"
241241
| Teacher({name}) =>
242242
// this is matched only if `name` isn't "Joe"
243-
{j|Hello ${name}.|j}
243+
{j|Hello $(name).|j}
244244
| Student({name, reportCard: {passing: true, gpa}}) =>
245245
"Congrats " ++ name + ", nice GPA of " ++ Js.Float.toString(gpa) ++ " you got there!"
246246
| Student({
@@ -251,7 +251,7 @@ let message = switch (person1) {
251251
| Student({status: Sick}) =>
252252
"How are you feeling?"
253253
| Student({name}) =>
254-
{j|Good luck next semester ${name}!|j}
254+
{j|Good luck next semester $(name)!|j}
255255
};
256256
```
257257
```js

pages/docs/manual/v8.0.0/pipe.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ You'd use them like this:
111111
<CodeTab labels={["Reason (Old Syntax)", "JS Output"]}>
112112

113113
```re
114-
let result = Js.Array2.filter(Js.Array2.map([|1, 2, 3|], a => a + 1), a => mod(a, 2) == 0);
114+
let result = Js.Array2.filter(Js.Array2.map([|1, 2, 3|], a => a + 1), a => a mod 2 == 0);
115115

116116
send(setWaitDuration(asyncRequest(), 4000));
117117
```

pages/docs/manual/v8.0.0/primitive-types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ There's a special syntax for string that allows
5353
```re
5454
let greeting = {j|Hello
5555
World
56-
${name}
56+
$(name)
5757
|j}
5858
```
5959
```js

pages/docs/manual/v8.0.0/shared-data-types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ReScript's built-in values of type `string`, `float`, `array` and a few others h
1111
This means that if you receive e.g. a string from the JS side, you can use it **without conversion** on the ReScript side, and vice-versa.
1212

1313
**Shared, bidirectionally usable types**:
14-
- String. Backtick strings like `` `hello ${personName}` `` support interpolation. Normal `"hello"` strings don't.
14+
- String. Backtick strings like `` `hello $(personName)` `` support interpolation. Normal `"hello"` strings don't.
1515
- Float. ReScript floats are JS numbers, vice-versa.
1616
- Array. In addition to the [JS Array API](/apis/latest/js/array), we provide our own [Belt.Array](/apis/latest/belt/array#set) API too.
1717
- Tuple. Compiles to a JS array. You can treat a fixed-sized, heterogenous JS array as ReScript tuple too.

0 commit comments

Comments
 (0)