@@ -559,7 +559,7 @@ <h1><a href="https://github.com/bucklescript/bucklescript">BuckleScript</a> User
559
559
< li > < a href ="#_fixed_arguments_with_arbitrary_json_literal_since_1_7_0 "> Fixed Arguments with arbitrary JSON literal (@since 1.7.0)</ a > </ li >
560
560
</ ul >
561
561
</ li >
562
- < li > < a href ="#_binding_to_nodejs_special_variables_bs_node "> Binding to NodeJS special variables: bs.node</ a > </ li >
562
+ < li > < a href ="#_binding_to_nodejs_special_variables_a_href_api_node_html_bs_node_a "> Binding to NodeJS special variables: < a href =" ../api/Node.html " > bs.node</ a > </ a > </ li >
563
563
< li > < a href ="#_binding_to_callbacks_high_order_function "> Binding to callbacks (high-order function)</ a >
564
564
< ul class ="sectlevel3 ">
565
565
< li > < a href ="#__bs_for_explicit_uncurried_callback "> [@bs] for explicit uncurried callback</ a > </ li >
@@ -1272,7 +1272,7 @@ <h3 id="_an_example_with_multiple_modules"><a class="anchor" href="#_an_example_
1272
1272
< div class ="colist arabic ">
1273
1273
< ol >
1274
1274
< li >
1275
- < p > < code > Js</ code > module is a built-in module shipped with BuckleScript</ p >
1275
+ < p > < a href =" ../api/Js.html " > < code > Js</ code > </ a > module is a built-in module shipped with BuckleScript</ p >
1276
1276
</ li >
1277
1277
</ ol >
1278
1278
</ div >
@@ -2355,7 +2355,7 @@ <h4 id="_fixed_arguments_with_arbitrary_json_literal_since_1_7_0"><a class="anch
2355
2355
</ div >
2356
2356
</ div >
2357
2357
< div class ="sect2 ">
2358
- < h3 id ="_binding_to_nodejs_special_variables_bs_node "> < a class ="anchor " href ="#_binding_to_nodejs_special_variables_bs_node "> </ a > Binding to NodeJS special variables: bs.node</ h3 >
2358
+ < h3 id ="_binding_to_nodejs_special_variables_a_href_api_node_html_bs_node_a "> < a class ="anchor " href ="#_binding_to_nodejs_special_variables_a_href_api_node_html_bs_node_a "> </ a > Binding to NodeJS special variables: < a href =" ../api/Node.html " > bs.node</ a > </ h3 >
2359
2359
< div class ="paragraph ">
2360
2360
< p > NodeJS has several file local variables: < code > < em > dirname</ code > , < code > </ em > filename</ code > , < code > _module</ code > , and < code > require</ code > .
2361
2361
Their semantics are more like macros instead of functions.</ p >
@@ -3504,7 +3504,7 @@ <h3 id="_return_value_checking_since_1_5_1"><a class="anchor" href="#_return_val
3504
3504
< pre class ="pygments highlight "> < code data-lang ="ocaml "> < span class ="tok-k "> type</ span > < span class ="tok-n "> element</ span >
3505
3505
< span class ="tok-k "> type</ span > < span class ="tok-n "> dom</ span >
3506
3506
< span class ="tok-k "> external</ span > < span class ="tok-n "> getElementById</ span > < span class ="tok-o "> :</ span > < span class ="tok-kt "> string</ span > < span class ="tok-o "> -></ span > < span class ="tok-n "> element</ span > < span class ="tok-n "> option</ span > < span class ="tok-o "> =</ span > < span class ="tok-s2 "> ""</ span >
3507
- < span class ="tok-o "> [@@</ span > < span class ="tok-n "> bs</ span > < span class ="tok-o "> .</ span > < span class ="tok-n "> send</ span > < span class ="tok-o "> .</ span > < span class ="tok-n "> pipe</ span > < span class ="tok-o "> :</ span > < span class ="tok-n "> dom</ span > < span class ="tok-o "> ]</ span > < span class ="tok-o "> [@@</ span > < span class ="tok-n "> bs</ span > < span class ="tok-o "> .</ span > < span class ="tok-n "> return</ span > < span class ="tok-n "> null_to_opt </ span > < span class ="tok-o "> ]</ span > < b class ="conum "> (1)</ b >
3507
+ < span class ="tok-o "> [@@</ span > < span class ="tok-n "> bs</ span > < span class ="tok-o "> .</ span > < span class ="tok-n "> send</ span > < span class ="tok-o "> .</ span > < span class ="tok-n "> pipe</ span > < span class ="tok-o "> :</ span > < span class ="tok-n "> dom</ span > < span class ="tok-o "> ]</ span > < span class ="tok-o "> [@@</ span > < span class ="tok-n "> bs</ span > < span class ="tok-o "> .</ span > < span class ="tok-n "> return</ span > < span class ="tok-n "> nullable </ span > < span class ="tok-o "> ]</ span > < b class ="conum "> (1)</ b >
3508
3508
3509
3509
< span class ="tok-k "> let</ span > < span class ="tok-n "> test</ span > < span class ="tok-n "> dom</ span > < span class ="tok-o "> =</ span >
3510
3510
< span class ="tok-k "> let</ span > < span class ="tok-n "> elem</ span > < span class ="tok-o "> =</ span > < span class ="tok-n "> dom</ span > < span class ="tok-o "> |></ span > < span class ="tok-n "> getElementById</ span > < span class ="tok-s2 "> "haha"</ span > < span class ="tok-k "> in</ span >
@@ -3516,7 +3516,7 @@ <h3 id="_return_value_checking_since_1_5_1"><a class="anchor" href="#_return_val
3516
3516
< div class ="colist arabic ">
3517
3517
< ol >
3518
3518
< li >
3519
- < p > < code > null_to_opt </ code > attribute will automatically convert null to < code > option</ code > </ p >
3519
+ < p > < code > nullable </ code > attribute will automatically convert null and undefined to < code > option</ code > </ p >
3520
3520
</ li >
3521
3521
</ ol >
3522
3522
</ div >
@@ -3525,26 +3525,18 @@ <h3 id="_return_value_checking_since_1_5_1"><a class="anchor" href="#_return_val
3525
3525
< div class ="content ">
3526
3526
< pre class ="pygments highlight "> < code data-lang ="js "> < span class ="tok-kd "> function</ span > < span class ="tok-nx "> test</ span > < span class ="tok-p "> (</ span > < span class ="tok-nx "> dom</ span > < span class ="tok-p "> )</ span > < span class ="tok-p "> {</ span >
3527
3527
< span class ="tok-kd "> var</ span > < span class ="tok-nx "> elem</ span > < span class ="tok-o "> =</ span > < span class ="tok-nx "> dom</ span > < span class ="tok-p "> .</ span > < span class ="tok-nx "> getElementById</ span > < span class ="tok-p "> (</ span > < span class ="tok-s2 "> "haha"</ span > < span class ="tok-p "> );</ span >
3528
- < span class ="tok-k "> if</ span > < span class ="tok-p "> (</ span > < span class ="tok-nx "> elem</ span > < span class ="tok-o "> !==</ span > < span class ="tok-kc "> null</ span > < span class ="tok-p "> )</ span > < span class ="tok-p "> {</ span > < b class ="conum "> (1)</ b >
3528
+ < span class ="tok-k "> if</ span > < span class ="tok-p "> (</ span > < span class ="tok-nx "> elem</ span > < span class ="tok-o "> ==</ span > < span class ="tok-kc "> null</ span > < span class ="tok-p "> )</ span > < span class ="tok-p "> {</ span >
3529
+ < span class ="tok-k "> return</ span > < span class ="tok-mi "> 1</ span > < span class ="tok-p "> ;</ span >
3530
+ < span class ="tok-p "> }</ span > < span class ="tok-k "> else</ span > < span class ="tok-p "> {</ span >
3529
3531
< span class ="tok-nx "> console</ span > < span class ="tok-p "> .</ span > < span class ="tok-nx "> log</ span > < span class ="tok-p "> (</ span > < span class ="tok-nx "> elem</ span > < span class ="tok-p "> );</ span >
3530
3532
< span class ="tok-k "> return</ span > < span class ="tok-mi "> 2</ span > < span class ="tok-p "> ;</ span >
3531
3533
< span class ="tok-p "> }</ span >
3532
- < span class ="tok-k "> else</ span > < span class ="tok-p "> {</ span >
3533
- < span class ="tok-k "> return</ span > < span class ="tok-mi "> 1</ span > < span class ="tok-p "> ;</ span >
3534
- < span class ="tok-p "> }</ span >
3535
3534
< span class ="tok-p "> }</ span > </ code > </ pre >
3536
3535
</ div >
3537
3536
</ div >
3538
- < div class ="colist arabic ">
3539
- < ol >
3540
- < li >
3541
- < p > nullable checking without boxing due to compiler optimizations</ p >
3542
- </ li >
3543
- </ ol >
3544
- </ div >
3545
3537
< div class ="paragraph ">
3546
- < p > Currently 4 directives are supported: < code > null_to_opt</ code > , < code > undefined_to_opt</ code > ,
3547
- < code > null_undefined_to_opt </ code > and < code > identity</ code > .</ p >
3538
+ < p > Currently 3 directives are supported: < code > null_to_opt</ code > , < code > undefined_to_opt</ code > ,
3539
+ < code > nullable </ code > and < code > identity</ code > .</ p >
3548
3540
</ div >
3549
3541
< div class ="admonitionblock note ">
3550
3542
< table >
@@ -3554,7 +3546,7 @@ <h3 id="_return_value_checking_since_1_5_1"><a class="anchor" href="#_return_val
3554
3546
</ td >
3555
3547
< td class ="content ">
3556
3548
< div class ="paragraph ">
3557
- < p > < code > null_to_opt</ code > , < code > undefined_to_opt</ code > and < code > null_undefined_to_opt </ code > will < strong > semantically</ strong >
3549
+ < p > < code > null_to_opt</ code > , < code > undefined_to_opt</ code > and < code > nullable </ code > will < strong > semantically</ strong >
3558
3550
convert a nullable value to < code > option</ code > which is a boxed value, but the compiler will
3559
3551
do smart optimizations to < strong > remove such boxing overhead</ strong > when the returned value is destructed
3560
3552
in the same routine.</ p >
@@ -3785,7 +3777,7 @@ <h3 id="_regex_support"><a class="anchor" href="#_regex_support"></a>Regex suppo
3785
3777
< div class ="title "> Note</ div >
3786
3778
</ td >
3787
3779
< td class ="content ">
3788
- < code > Js.Re.t</ code > can be accessed and manipulated using the functions available in the < code > Js.Re</ code > module.
3780
+ < code > Js.Re.t</ code > can be accessed and manipulated using the functions available in the < a href =" ../api/Js.Re.html " > < code > Js.Re</ code > </ a > module.
3789
3781
</ td >
3790
3782
</ tr >
3791
3783
</ table >
@@ -3916,7 +3908,7 @@ <h3 id="_raise_js_style_exception"><a class="anchor" href="#_raise_js_style_exce
3916
3908
</ div >
3917
3909
</ div >
3918
3910
< div class ="paragraph ">
3919
- < p > Please consult module < a href ="https://bucklescript.github.io/bucklescript /api/Js.Exn.html "> < code > Js.Exn</ code > </ a > for more details</ p >
3911
+ < p > Please consult module < a href =".. /api/Js.Exn.html "> < code > Js.Exn</ code > </ a > for more details</ p >
3920
3912
</ div >
3921
3913
</ div >
3922
3914
</ div >
@@ -4045,31 +4037,31 @@ <h3 id="_stable_ish_submodules"><a class="anchor" href="#_stable_ish_submodules"
4045
4037
< div class ="ulist ">
4046
4038
< ul >
4047
4039
< li >
4048
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Null.html "> Js.Null</ a > </ p >
4040
+ < p > < a href =".. /api/Js.Null.html "> Js.Null</ a > </ p >
4049
4041
</ li >
4050
4042
< li >
4051
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Undefined.html "> Js.Undefined</ a > </ p >
4043
+ < p > < a href =".. /api/Js.Undefined.html "> Js.Undefined</ a > </ p >
4052
4044
</ li >
4053
4045
< li >
4054
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Null_undefined.html "> Js.Null_undefined</ a > </ p >
4046
+ < p > < a href =".. /api/Js.Null_undefined.html "> Js.Null_undefined</ a > </ p >
4055
4047
</ li >
4056
4048
< li >
4057
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Array.html "> Js.Array</ a > </ p >
4049
+ < p > < a href =".. /api/Js.Array.html "> Js.Array</ a > </ p >
4058
4050
</ li >
4059
4051
< li >
4060
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Date.html "> Js.Date</ a > </ p >
4052
+ < p > < a href =".. /api/Js.Date.html "> Js.Date</ a > </ p >
4061
4053
</ li >
4062
4054
< li >
4063
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Math.html "> Js.Math</ a > </ p >
4055
+ < p > < a href =".. /api/Js.Math.html "> Js.Math</ a > </ p >
4064
4056
</ li >
4065
4057
< li >
4066
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Re.html "> Js.Re</ a > </ p >
4058
+ < p > < a href =".. /api/Js.Re.html "> Js.Re</ a > </ p >
4067
4059
</ li >
4068
4060
< li >
4069
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.String.html "> Js.String</ a > </ p >
4061
+ < p > < a href =".. /api/Js.String.html "> Js.String</ a > </ p >
4070
4062
</ li >
4071
4063
< li >
4072
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Typed_array.html "> Js.Typed_array</ a > </ p >
4064
+ < p > < a href =".. /api/Js.Typed_array.html "> Js.Typed_array</ a > </ p >
4073
4065
</ li >
4074
4066
</ ul >
4075
4067
</ div >
@@ -4082,13 +4074,13 @@ <h3 id="_experimental_incomplete_submodules"><a class="anchor" href="#_experimen
4082
4074
< div class ="ulist ">
4083
4075
< ul >
4084
4076
< li >
4085
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Boolean.html "> Js.Boolean</ a > </ p >
4077
+ < p > < a href =".. /api/Js.Boolean.html "> Js.Boolean</ a > </ p >
4086
4078
</ li >
4087
4079
< li >
4088
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Dict.html "> Js.Dict</ a > </ p >
4080
+ < p > < a href =".. /api/Js.Dict.html "> Js.Dict</ a > </ p >
4089
4081
</ li >
4090
4082
< li >
4091
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js.Obj.html "> Js.Obj</ a > </ p >
4083
+ < p > < a href =".. /api/Js.Obj.html "> Js.Obj</ a > </ p >
4092
4084
</ li >
4093
4085
</ ul >
4094
4086
</ div >
@@ -4101,28 +4093,28 @@ <h3 id="_very_experimental_internal_submodules"><a class="anchor" href="#_very_e
4101
4093
< div class ="ulist ">
4102
4094
< ul >
4103
4095
< li >
4104
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js_float.html "> Js_float</ a > </ p >
4096
+ < p > < a href =".. /api/Js_float.html "> Js_float</ a > </ p >
4105
4097
</ li >
4106
4098
< li >
4107
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js_int.html "> Js_int</ a > </ p >
4099
+ < p > < a href =".. /api/Js_int.html "> Js_int</ a > </ p >
4108
4100
</ li >
4109
4101
< li >
4110
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js_int64.html "> Js_int64</ a > </ p >
4102
+ < p > < a href =".. /api/Js_int64.html "> Js_int64</ a > </ p >
4111
4103
</ li >
4112
4104
< li >
4113
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js_json.html "> Js.Json</ a > </ p >
4105
+ < p > < a href =".. /api/Js_json.html "> Js.Json</ a > </ p >
4114
4106
</ li >
4115
4107
< li >
4116
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js_nativeint.html "> Js_nativeint</ a > </ p >
4108
+ < p > < a href =".. /api/Js_nativeint.html "> Js_nativeint</ a > </ p >
4117
4109
</ li >
4118
4110
< li >
4119
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js_primitive.html "> Js_primitive</ a > </ p >
4111
+ < p > < a href =".. /api/Js_primitive.html "> Js_primitive</ a > </ p >
4120
4112
</ li >
4121
4113
< li >
4122
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js_types.html "> Js.Types</ a > </ p >
4114
+ < p > < a href =".. /api/Js_types.html "> Js.Types</ a > </ p >
4123
4115
</ li >
4124
4116
< li >
4125
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Js_unsafe.html "> Js_unsafe</ a > </ p >
4117
+ < p > < a href =".. /api/Js_unsafe.html "> Js_unsafe</ a > </ p >
4126
4118
</ li >
4127
4119
</ ul >
4128
4120
</ div >
@@ -4133,29 +4125,29 @@ <h3 id="_very_experimental_internal_submodules"><a class="anchor" href="#_very_e
4133
4125
< h2 id ="_node_module "> < a class ="anchor " href ="#_node_module "> </ a > Node module</ h2 >
4134
4126
< div class ="sectionbody ">
4135
4127
< div class ="paragraph ">
4136
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Node.html "> Node</ a > </ p >
4128
+ < p > < a href =".. /api/Node.html "> Node</ a > </ p >
4137
4129
</ div >
4138
4130
< div class ="sect2 ">
4139
4131
< h3 id ="_submodules "> < a class ="anchor " href ="#_submodules "> </ a > Submodules</ h3 >
4140
4132
< div class ="ulist ">
4141
4133
< ul >
4142
4134
< li >
4143
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Node_buffer.html "> Node.Buffer</ a > </ p >
4135
+ < p > < a href =".. /api/Node_buffer.html "> Node.Buffer</ a > </ p >
4144
4136
</ li >
4145
4137
< li >
4146
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Node_child_process.html "> Node.Child_process</ a > </ p >
4138
+ < p > < a href =".. /api/Node_child_process.html "> Node.Child_process</ a > </ p >
4147
4139
</ li >
4148
4140
< li >
4149
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Node_fs.html "> Node.Fs</ a > </ p >
4141
+ < p > < a href =".. /api/Node_fs.html "> Node.Fs</ a > </ p >
4150
4142
</ li >
4151
4143
< li >
4152
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Node_module.html "> Node.Module</ a > </ p >
4144
+ < p > < a href =".. /api/Node_module.html "> Node.Module</ a > </ p >
4153
4145
</ li >
4154
4146
< li >
4155
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Node_path.html "> Node.Path</ a > </ p >
4147
+ < p > < a href =".. /api/Node_path.html "> Node.Path</ a > </ p >
4156
4148
</ li >
4157
4149
< li >
4158
- < p > < a href ="https://bucklescript.github.io/bucklescript /api/Node_process.html "> Node.Process</ a > </ p >
4150
+ < p > < a href =".. /api/Node_process.html "> Node.Process</ a > </ p >
4159
4151
</ li >
4160
4152
</ ul >
4161
4153
</ div >
@@ -5715,7 +5707,7 @@ <h3 id="_simple_ocaml_type"><a class="anchor" href="#_simple_ocaml_type"></a>Sim
5715
5707
</ div >
5716
5708
</ div >
5717
5709
< div class ="listingblock ">
5718
- < div class ="title "> Js.Boolean module</ div >
5710
+ < div class ="title "> < a href =" ../api/ Js.Boolean.html " > Js.Boolean </ a > module</ div >
5719
5711
< div class ="content ">
5720
5712
< pre > val to_js_boolean: bool -> Js.boolean</ pre >
5721
5713
</ div >
@@ -5727,7 +5719,7 @@ <h3 id="_simple_ocaml_type"><a class="anchor" href="#_simple_ocaml_type"></a>Sim
5727
5719
< p > Either < code > 'a</ code > or < code > null</ code > . < code > Js.Null.empty</ code > represents < code > null</ code > too.</ p >
5728
5720
</ div >
5729
5721
< div class ="listingblock ">
5730
- < div class ="title "> Js.Null module</ div >
5722
+ < div class ="title "> < a href =" ../api/ Js.Null.html " > Js.Null </ a > module</ div >
5731
5723
< div class ="content ">
5732
5724
< pre class ="pygments highlight "> < code data-lang ="ocaml "> < span class ="tok-k "> val</ span > < span class ="tok-n "> to_opt</ span > < span class ="tok-o "> :</ span > < span class ="tok-k "> '</ span > < span class ="tok-n "> a</ span > < span class ="tok-n "> t</ span > < span class ="tok-o "> -></ span > < span class ="tok-k "> '</ span > < span class ="tok-n "> a</ span > < span class ="tok-n "> option</ span >
5733
5725
< span class ="tok-k "> val</ span > < span class ="tok-n "> from_opt</ span > < span class ="tok-o "> :</ span > < span class ="tok-k "> '</ span > < span class ="tok-n "> a</ span > < span class ="tok-n "> option</ span > < span class ="tok-o "> -></ span > < span class ="tok-k "> '</ span > < span class ="tok-n "> a</ span > < span class ="tok-n "> t</ span >
@@ -6033,7 +6025,9 @@ <h3 id="_contributing_to_the_documentation"><a class="anchor" href="#_contributi
6033
6025
< div class ="sect2 ">
6034
6026
< h3 id ="_contributing_to_the_api_reference "> < a class ="anchor " href ="#_contributing_to_the_api_reference "> </ a > Contributing to the API reference</ h3 >
6035
6027
< div class ="paragraph ">
6036
- < p > The API reference is generated from doc comments in the source code. Here’s a good example: < a href ="https://github.com/bucklescript/bucklescript/blob/master/jscomp/others/js_re.mli#L146-L161 " class ="bare "> https://github.com/bucklescript/bucklescript/blob/master/jscomp/others/js_re.mli#L146-L161</ a > </ p >
6028
+ < p > The API reference is generated from doc comments in the source code.
6029
+ < a href ="https://github.com/bucklescript/bucklescript/blob/99650/jscomp/others/js_re.mli#L146-L161 "> Here</ a > 's
6030
+ a good example</ p >
6037
6031
</ div >
6038
6032
< div class ="paragraph ">
6039
6033
< p > Some tips and guidelines:</ p >
0 commit comments