Skip to content

Fix typo in let-binding.mdx: %private -> %%private #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pages/docs/manual/latest/let-binding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ If you need _real_ mutation, e.g. passing a value around, have it modified by ma

Private let bindings are introduced in the release [7.2](https://rescript-lang.org/blog/bucklescript-release-7-2).

In the module system, everything is public by default,
the only way to hide some values is by providing a separate signature to
In the module system, everything is public by default,
the only way to hide some values is by providing a separate signature to
list public fields and their types:

```res
Expand All @@ -162,7 +162,7 @@ module A: {
let b = 4
}
```
`%private` gives you an option to mark private fields directly
`%%private` gives you an option to mark private fields directly

```res
module A = {
Expand All @@ -171,15 +171,15 @@ module A = {
}
```

`%private` also applies to file level modules, so in some cases,
`%%private` also applies to file level modules, so in some cases,
users do not need to provide a separate interface file just to hide some particular values.

Note interface files are still recommended as a general best practice since they give you better
separate compilation units and also they're better for documentation.
Note interface files are still recommended as a general best practice since they give you better
separate compilation units and also they're better for documentation.

Still, `%private` is useful in the following scenarios:
Still, `%%private` is useful in the following scenarios:

- Code generators. Some code generators want to hide some values but it is sometimes very hard or time consuming for code generators to synthesize the types for public fields.

- Quick prototyping. During prototyping, we still want to hide some values, but the interface file is not stable yet, `%private` provide you such convenience.
- Quick prototyping. During prototyping, we still want to hide some values, but the interface file is not stable yet, `%%private` provide you such convenience.