@@ -11,7 +11,7 @@ There is a comprehensive [Cheat-sheet](#cheat-sheet) at the end.
11
11
12
12
## The Basics
13
13
14
- Define named functions with a [ let binding] ( let-binding.md ) , parenthesis ` () ` ,
14
+ Define named functions with a [ let binding] ( let-binding.md ) , parentheses ` () ` ,
15
15
and an arrow ` => ` :
16
16
17
17
``` reason
@@ -42,12 +42,12 @@ have "no arguments". This is commonly used when a function has side-effects.
42
42
The unit argument looks like ` () ` :
43
43
44
44
``` reason
45
- let launchMissle = () => {
45
+ let launchMissile = () => {
46
46
someSideEffects();
47
- print_endline("Missles have been launched!");
47
+ print_endline("Missiles have been launched!");
48
48
};
49
49
50
- launchMissle ();
50
+ launchMissile ();
51
51
```
52
52
53
53
## Named Arguments
@@ -216,7 +216,7 @@ fn(~data=x, ());
216
216
```
217
217
218
218
Reason provides a shorthand syntax for the pattern above. Prefixing a named
219
- argument's value with a question mark at the call site, will pass whatever is
219
+ argument's value with a question mark at the call site will pass whatever is
220
220
inside of the ` Some() ` , but if the value is ` None ` , then the named argument
221
221
will not be supplied at all.
222
222
@@ -236,7 +236,7 @@ values too._
236
236
237
237
#### Referencing Previous Arguments
238
238
239
- When defining default values previous arguments may be used:
239
+ When defining default values, previous arguments may be used:
240
240
241
241
``` reason
242
242
let add = (a, ~b, ~c=a+1, ~d=b+1, ()) => a + b + c + d;
@@ -247,7 +247,7 @@ add(1, ~b=1, ~c=10, ()); /* 14 */
247
247
248
248
## No Var-args
249
249
250
- This is no way to define a function that accepts a variable number of arguments
250
+ There is no way to define a function that accepts a variable number of arguments
251
251
in Reason. A workaround can be to accept a list as the final argument.
252
252
253
253
## Cheat-sheet
0 commit comments