Skip to content

Commit 64fe7f7

Browse files
authored
Add precision to function as shared data type (#260)
1 parent a25a419 commit 64fe7f7

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

pages/docs/manual/latest/function.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ canonical: "/docs/manual/latest/function"
88

99
_Cheat sheet for the full function syntax at the end_.
1010

11-
Functions are declared with an arrow and return an expression.
11+
ReScript functions are declared with an arrow and return an expression, just like JS functions. They compile to clean JS functions too.
1212

1313
<CodeTab labels={["ReScript", "JS Output"]}>
1414

pages/docs/manual/latest/shared-data-types.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Unlike most compiled-to-js languages, in ReScript, **you don't need to write dat
2020
- Boolean.
2121
- Record. Record compiles to JS object. Therefore you can also treat JS objects as records. If they're too dynamic, consider modeling them on the ReScript side as a hashmap/dictionary [`Js.Dict`](api/js/dict) or a ReScript object.
2222
- Object. ReScript objects are JavaScript objects, vice-versa.
23+
- Function. They compile to clean JS functions.
2324
- Unit. The `unit` type, which has a single value `()`, compiles to `undefined` too. Likewise, you can treat an incoming JS `undefined` as `()`.
2425

2526
<!-- TODO: talk about poly variant -->

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ canonical: "/docs/manual/latest/function"
88

99
_Cheat sheet for the full function syntax at the end_.
1010

11-
Functions are declared with an arrow and return an expression.
11+
ReScript functions are declared with an arrow and return an expression, just like JS functions. They compile to clean JS functions too.
1212

1313
<CodeTab labels={["Reason (Old Syntax)", "ML (Older Syntax)", "JS Output"]}>
1414

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Unlike most compiled-to-js languages, in ReScript, **you don't need to write dat
2020
- Boolean.
2121
- Record. Record compiles to JS object. Therefore you can also treat JS objects as records. If they're too dynamic, consider modeling them on the ReScript side as a hashmap/dictionary [`Js.Dict`](api/js/dict) or a ReScript object.
2222
- Object. ReScript objects are JavaScript objects, vice-versa.
23+
- Function. They compile to clean JS functions.
2324
- Unit. The `unit` type, which has a single value `()`, compiles to `undefined` too. Likewise, you can treat an incoming JS `undefined` as `()`.
2425

2526
<!-- TODO: talk about poly variant -->

0 commit comments

Comments
 (0)