Skip to content

Commit fee86a9

Browse files
authored
Update function.md
1 parent c46fe8c commit fee86a9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/function.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ There is a comprehensive [Cheat-sheet](#cheat-sheet) at the end.
1111

1212
## The Basics
1313

14-
Define named functions with a [let binding](let-binding.md), parenthesis `()`,
14+
Define named functions with a [let binding](let-binding.md), parentheses `()`,
1515
and an arrow `=>`:
1616

1717
```reason
@@ -42,12 +42,12 @@ have "no arguments". This is commonly used when a function has side-effects.
4242
The unit argument looks like `()`:
4343

4444
```reason
45-
let launchMissle = () => {
45+
let launchMissile = () => {
4646
someSideEffects();
47-
print_endline("Missles have been launched!");
47+
print_endline("Missiles have been launched!");
4848
};
4949
50-
launchMissle();
50+
launchMissile();
5151
```
5252

5353
## Named Arguments
@@ -216,7 +216,7 @@ fn(~data=x, ());
216216
```
217217

218218
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
220220
inside of the `Some()`, but if the value is `None`, then the named argument
221221
will not be supplied at all.
222222

@@ -236,7 +236,7 @@ values too._
236236

237237
#### Referencing Previous Arguments
238238

239-
When defining default values previous arguments may be used:
239+
When defining default values, previous arguments may be used:
240240

241241
```reason
242242
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 */
247247

248248
## No Var-args
249249

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
251251
in Reason. A workaround can be to accept a list as the final argument.
252252

253253
## Cheat-sheet

0 commit comments

Comments
 (0)