Skip to content

Commit 294b2c1

Browse files
committed
[Docs] Fix typos
1 parent fcc4831 commit 294b2c1

11 files changed

+167
-167
lines changed

docs/blog/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,12 @@ <h1>Bloomberg announcing BuckleScript 1.0</h1>
423423
</div>
424424
<div id="content">
425425
<div class="paragraph">
426-
<p>The BuckleScript announcement can be found on the <a href="https://www.techatbloomberg.com/blog/bucklescript-1-0-release-arrived/">Tech at Bloomberg blog</a></p>
426+
<p>The BuckleScript announcement can be found on the <a href="https://www.techatbloomberg.com/blog/bucklescript-1-0-release-arrived/">Tech at Bloomberg blog</a></p>
427427
</div>
428428
</div>
429429
<div id="footer">
430430
<div id="footer-text">
431431
</div>
432432
</div>
433433
</body>
434-
</html>
434+
</html>

docs/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta name="generator" content="Asciidoctor 1.5.4">
8-
<title>Developer experience</title>
8+
<title>BuckleScript</title>
99
</head>
1010
<body class="article">
1111
<div id="header">
@@ -93,4 +93,4 @@ <h4 id="_enjoy">Enjoy!</h4>
9393
</div>
9494
</div>
9595
</body>
96-
</html>
96+
</html>

site/docsource/Build-system-support.adoc

+23-23
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ inlining, arity inference and other information.
1515

1616
=== BuckleScript build system: `bsb`
1717

18-
BuckleScript proivdes a native build tool on top of Google's https://github.com/ninja-build/ninja/releases[ninja-build].
19-
It is designed for a fast feedback loop (typically 100ms feedback loop) and works cross platform.
18+
BuckleScript provides a native build tool on top of Google's https://github.com/ninja-build/ninja/releases[ninja-build].
19+
It is designed for a fast feedback loop (typically 100ms feedback loop) and works cross platform.
2020

2121
// [INFO]
2222
// ======
2323
// Currently for non-Windows users, they need to install ninja first (version >= 1.7.1).
24-
// Please don't be confused with the npm ninja,
24+
// Please don't be confused with the npm ninja,
2525
// we are using Google's https://github.com/ninja-build/ninja/releases[ninja-build].
2626
// ======
2727

28-
`bsb` can be running in any subdirectory. It is a schema based build tool and the schema is
28+
`bsb` can be running in any subdirectory. It is a schema based build tool and the schema is
2929
http://bloomberg.github.io/bucklescript/docson/#build-schema.json[available]. It is strongly recommended to **check out the http://bloomberg.github.io/bucklescript/docson/#build-schema.json[schema]**
3030
after you finish reading the tutorials below.
3131

32-
If your editor supports JSON schema validation and auto-completion like https://code.visualstudio.com/docs/languages/json[VSCode],
32+
If your editor supports JSON schema validation and auto-completion like https://code.visualstudio.com/docs/languages/json[VSCode],
3333
below is a configuration to help you get auto-completion and validation for free:
3434

3535
.settings.json
36-
[source,js]
36+
[source,js]
3737
------------
3838
{
3939
"json.schemas": [
@@ -45,20 +45,20 @@ below is a configuration to help you get auto-completion and validation for free
4545
}
4646
],
4747
// ....
48-
}
48+
}
4949
------------
5050

51-
The build system is installed as `bsb.exe` in `bs-platform/bin/bsb.exe`. Due to a known issue in npm,
52-
we create a JS wrapper (which is accessible in `.bin` too) so the user can call
53-
either `bsb` (slightly higher latency but symlinked into `.bin`) or `bsb.exe`
51+
The build system is installed as `bsb.exe` in `bs-platform/bin/bsb.exe`. Due to a known issue in npm,
52+
we create a JS wrapper (which is accessible in `.bin` too) so the user can call
53+
either `bsb` (slightly higher latency but symlinked into `.bin`) or `bsb.exe`
5454

5555

5656
Here is a *minimal* configuration:
5757

5858
.bsconfig.json
5959
[source,js]
6060
-----------
61-
{
61+
{
6262
"name": "test", // package name, required <1>
6363
"sources": "src" // <2>
6464
}
@@ -68,8 +68,8 @@ Here is a *minimal* configuration:
6868

6969

7070
The entry point is `bsb`.
71-
It will check if there is already `build.ninja` in the build directory,
72-
and if not or it needs to be regenerated it will generate the file `build.ninja`
71+
It will check if there is already `build.ninja` in the build directory,
72+
and if not or it needs to be regenerated it will generate the file `build.ninja`
7373
and delegate the hard work to `ninja`.
7474

7575

@@ -96,7 +96,7 @@ The directory layout (after building) would be
9696
└── test
9797
-----------
9898
<1> Will generate amdjs modules if flags are turned on
99-
<2> Will generate goog modules if flags are turned on
99+
<2> Will generate goog modules if flags are turned on
100100

101101
We wrap `bsb.exe` as `bsb` so that it will work across different platforms.
102102

@@ -106,7 +106,7 @@ We wrap `bsb.exe` as `bsb` so that it will work across different platforms.
106106
bsb // <1>
107107
bsb -w // <2>
108108
--------------------
109-
<1> Do the plain build
109+
<1> Do the plain build
110110
<2> Do the plain build and watch
111111

112112

@@ -145,7 +145,7 @@ List your dependency in `bs-dependencies` and install it via `npm install` as be
145145
}
146146
-----------
147147

148-
After your `npm install`,
148+
After your `npm install`,
149149
[source,sh]
150150
----------
151151
bsb -clean-world // <1>
@@ -166,7 +166,7 @@ bsb -clean-world -make-world -w
166166
==== Mark your directory as dev only
167167

168168

169-
Note sometimes, you have directories which are just tests that you don't need your dependency
169+
Note sometimes, you have directories which are just tests that you don't need your dependency
170170
to build. In that case you can mark it as dev only:
171171

172172
.bsconfig.json
@@ -242,7 +242,7 @@ Now, we have a repo https://github.com/bobzhang/bucklescript-have-tea[bucklescri
242242
[source,js]
243243
-----------
244244
{
245-
"name" : "bucklescript-have-tea",
245+
"name" : "bucklescript-have-tea",
246246
"version" : "0.1.0",
247247
"dependencies" : { "bucklescript-tea" : "^0.1.2" }, // <1>
248248
"peerDependencies" : { "bs-platform" : "^1.7.0" } //<2>
@@ -251,7 +251,7 @@ Now, we have a repo https://github.com/bobzhang/bucklescript-have-tea[bucklescri
251251
<1> List `bucklescript-tea` as dependency
252252
<2> List `bs-platform` as peer dependency
253253

254-
Suppose you are in `bucklescript-have-tea` top directory,
254+
Suppose you are in `bucklescript-have-tea` top directory,
255255

256256
[source,sh]
257257
----------
@@ -268,17 +268,17 @@ You can also change the `package-specs` to have another module format, for examp
268268
[source,js]
269269
----------
270270
{
271-
... ,
271+
... ,
272272
"package-specs" : ["amdjs", "commonjs"],
273273
...
274274
}
275275
----------
276276

277-
Rerun the command
277+
Rerun the command
278278

279279
[source,sh]
280280
----------
281-
bsb -clean-world -make-world
281+
bsb -clean-world -make-world
282282
----------
283283

284284
You will get both `commonjs` and `amdjs` support. In the end, we suggest you http://bloomberg.github.io/bucklescript/docson/#build-schema.json[check out the schema] and enjoy the build!
@@ -288,7 +288,7 @@ You will get both `commonjs` and `amdjs` support. In the end, we suggest you htt
288288
=== Build using Make
289289
[WARNING]
290290
========
291-
`bsb` is the officially recommended build system. This section is included here only for people who
291+
`bsb` is the officially recommended build system. This section is included here only for people who
292292
are _curious_ about how the build works.
293293
========
294294

site/docsource/Differences-from-js_of_ocaml.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ however, there are some areas where we view things differently from
1313
refer readers to some of the original informal
1414
https://github.com/ocsigen/js_of_ocaml/issues/338[discussions].
1515

16-
* Js_of_ocaml takes lowlevel bytecode from OCaml compiler, BuckleScript
17-
takes the highlevel rawlambda representation from OCaml compiler
18-
* Js_of_ocaml focuses more on existing OCaml eco-system(opam) while
16+
* Js_of_ocaml takes low-level bytecode from OCaml compiler, BuckleScript
17+
takes the high-level rawlambda representation from OCaml compiler
18+
* Js_of_ocaml focuses more on existing OCaml ecosystem(opam) while
1919
BuckleScript's major goal is to target npm
2020
* Js_of_ocaml and BuckleScript have slightly different runtime encoding
2121
in several places, for example, BuckleScript encodes OCaml Array as JS

site/docsource/Exception-handling.adoc

+23-23
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,35 @@ To catch Js exception on OCaml side, we categorize all JS exceptions to belong t
88

99
[source,ocaml]
1010
--------------
11-
let example1 () =
12-
match Js.Json.exnParse {| {"x" }|} with
13-
| exception Js.Exn.Error err ->
11+
let example1 () =
12+
match Js.Json.exnParse {| {"x" }|} with
13+
| exception Js.Exn.Error err ->
1414
Js.log @@ Js.Exn.stack err;
1515
None
16-
| v -> Some v
16+
| v -> Some v
1717
18-
let example2 () =
19-
try Some (Js.Json.exnParse {| {"x"}|}) with
18+
let example2 () =
19+
try Some (Js.Json.exnParse {| {"x"}|}) with
2020
Js.Exn.Error _ -> None
2121
--------------
2222

2323
The exception definition of `Js.Exn.Error` is as below:
2424

2525
[source,ocaml]
2626
--------------
27-
type t =
27+
type t =
2828
< stack : string Js.undefined ;
29-
message : string Js.undefined ;
29+
message : string Js.undefined ;
3030
name : string Js.undefined;
3131
fileName : string Js.undefined
3232
> Js.t
3333
34-
exception Error of t
34+
exception Error of t
3535
--------------
3636

3737
### Raise JS style exception
3838

39-
We provide such functions
39+
We provide such functions
4040

4141
[source,ocaml]
4242
--------------
@@ -55,28 +55,28 @@ Please consult module `Js.Error` for more details
5555

5656
## `bs.open`: Type safe external data-source handling (@@since 1.7.0)
5757

58-
There are some cases, the data-source could either come from JS land or OCaml land, it is very hard to give precise type information.
58+
There are some cases, the data-source could either come from JS land or OCaml land, it is very hard to give precise type information.
5959
For example, for an external promise whose creation could come from JS API, its failed value caused by `Promise.reject` could be in any shape.
6060

61-
BuckleScript provides a solution to filter out OCaml structured exception data from the mixed data source,
62-
it preserves the type safety while allow uesrs to deal with mixed source.
61+
BuckleScript provides a solution to filter out OCaml structured exception data from the mixed data source,
62+
it preserves the type safety while allow users to deal with mixed source.
6363

64-
It makes use of OCaml's extensible variant, so that uers can pack mix value of type `exn` with JS data-source
64+
It makes use of OCaml's extensible variant, so that users can pack mix value of type `exn` with JS data-source
6565

6666
.Example
6767
[source,ocaml]
6868
--------------
6969
let handleData = function [@bs.open]
7070
| Invalid_argument _ -> 0
71-
| Not_found -> 1
72-
| Sys_error _ -> 2
71+
| Not_found -> 1
72+
| Sys_error _ -> 2
7373
7474
val handleData : 'a -> int option // <1>
7575
--------------
7676
<1> For any input source, as long as it matches the exception pattern (nested pattern match supported), the matched value is returned, otherwise return None.
7777

7878

79-
### Use cases
79+
### Use cases
8080

8181
Take promise for example:
8282

@@ -85,12 +85,12 @@ Take promise for example:
8585
let v = Promise.reject Not_found
8686
let handlePromiseFaiure = function [@bs.open]
8787
| Not_found -> Js.log "Not found"; (Promise.resolve ())
88-
89-
let () =
90-
v
91-
|> Promise.catch (fun error ->
92-
match handlePromiseFaiure error with
93-
| Some x -> x
88+
89+
let () =
90+
v
91+
|> Promise.catch (fun error ->
92+
match handlePromiseFaiure error with
93+
| Some x -> x
9494
| None -> raise UnhandledPromise
9595
)
9696
--------------

site/docsource/FAQ.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
How does IO work in the browser?::
7-
In general, it is very hard to simulate IO in the browser, we recommend users write bindings to NodeJS directly for server side, or use `Js.log` in client side, see disucssions in {issues}/748[#748]
7+
In general, it is very hard to simulate IO in the browser, we recommend users write bindings to NodeJS directly for server side, or use `Js.log` in client side, see discussions in {issues}/748[#748]
88

99
The compiler does not build?::
1010
In production mode, the compiler is a single file in
@@ -70,7 +70,7 @@ Error: The type of this expression, ([ `Arity_1 of '_a ], '_a) Js.fn,
7070
contains type variables that cannot be generalized
7171
--------
7272
73-
The issue here isn't that the function is polymorphic. You can use (and probably have used) polymorphic uncurried functions without any problem as inline callbacks. But you can't export them. The issue here is the combination of using the uncurried calling convention, polymorphism and exporting (by default). It's an unfortunate limitation partly due to how OCaml's type system incorporates side-effects, and partly due to how BuckleScript handles uncurrying. The simplest solution is in most cases to just not export it, by adding an interface to the module. Alternatively, if you really, really need to export it, you can do so in its curried form, and then wrap it in an uncurried lanbda at the call site. E.g.:
73+
The issue here isn't that the function is polymorphic. You can use (and probably have used) polymorphic uncurried functions without any problem as inline callbacks. But you can't export them. The issue here is the combination of using the uncurried calling convention, polymorphism and exporting (by default). It's an unfortunate limitation partly due to how OCaml's type system incorporates side-effects, and partly due to how BuckleScript handles uncurrying. The simplest solution is in most cases to just not export it, by adding an interface to the module. Alternatively, if you really, really need to export it, you can do so in its curried form, and then wrap it in an uncurried lambda at the call site. E.g.:
7474
7575
[source]
7676
--------

site/docsource/Get_started.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ hello>tree -d .
3131
To enter watch mode, you can run `npm run watch`,
3232
then you can edit `src/demo.ml` and see it compiled on the fly, and changes are updated on `lib/js/src/demo.js`
3333

34-
If you happen to use VSCode as editor, we provide `.vscode/tasks.json` as well, type `Tasks>build`, it will enter watch mode, the great thing is that VSCode comes with
35-
a `Problems` panel which has a much nicer UI.
34+
If you happen to use VSCode as editor, we provide `.vscode/tasks.json` as well, type `Tasks>build`, it will enter watch mode, the great thing is that VSCode comes with
35+
a `Problems` panel which has a much nicer UI.
3636

37-
Currently there are not too many project templates, you can contribute more project templates here https://github.com/bloomberg/bucklescript/tree/master/jscomp/bsb/templates[here],
37+
Currently there are not too many project templates, you can contribute more project templates here https://github.com/bloomberg/bucklescript/tree/master/jscomp/bsb/templates[here],
3838

3939
### First example by hand without samples
4040

site/docsource/Manual.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ include::./Dev-mode-How-to.adoc[]
9292
include::./Differences-from-js_of_ocaml.adoc[]
9393

9494
[appendix]
95-
== Library API documentation
95+
== Library API documentation
9696

97-
There is a small Library comes with `bs-platform`, its documentation is
98-
http://bloomberg.github.io/bucklescript/api/[available].
97+
There is a small library that comes with `bs-platform`, its documentation is
98+
http://bloomberg.github.io/bucklescript/api/[here].
9999

100100

101101
[appendix]

0 commit comments

Comments
 (0)