Skip to content

Commit 9b55b6e

Browse files
committed
Match functions from Belt_Option
2 parents db3f192 + 234bc0f commit 9b55b6e

File tree

497 files changed

+33059
-29919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

497 files changed

+33059
-29919
lines changed

Diff for: .travis.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ env:
88
- BS_TRAVIS_CI=1
99
node_js:
1010
- 6
11-
script: npm run coveralls
11+
12+
# script: npm run coveralls
13+
# if we turn on this script, we should make
14+
# sure `npm test` is executed
1215
#
1316
# - 6
1417
# This delays notification
1518

16-
# Not a very reliable service..
19+
# Not a very reliable service..
1720

1821
# FIXME: instrumentation takes too much time
1922

Diff for: CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Currently all tests are in `jscomp/test` directory and you should either add/mod
105105
- Run the tests:
106106
`mocha -R list jscomp/test/your_test_file.js`
107107
To build libs, tests and run all tests:
108-
`make libs && make -C test all && npm test`
108+
`make libs && make -C jscomp/test all && npm test`
109109

110110
- See the coverage: `npm run cover`
111111

Diff for: Changes.md

+31-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11

2+
# 2.2.3
3+
4+
Features:
5+
- #2646,#2622 Adding Belt.Option
6+
- #2342, #2624 (|.) pipe syntax for t first convention
7+
- #2589 Expose Id.MakeComparable functor
8+
- #2587 Added production ready settings for react theme
9+
- * remove refmt syntax version 2
10+
11+
Performances:
12+
- #2438 using concrete predicates for integer comparison
13+
- #2584 better handling of if then else common sub expression
14+
15+
Fixes:
16+
- #2303 defining or using a module named "Block" causes runtime errors
17+
- #2616,#2612,#2554 better error message
18+
- #2352 return value of assignment expression
19+
- #2413 no break generated after return statement in some code branches
20+
- #2633 [@bs.string] in FFI
21+
- #2608 short-circuiting of && fails due to extraction of variable
22+
- #2559 fix Bytes.create semantics
23+
- #2638, bsb -w on windows freez
24+
- #2448, js_int.ml not installed on windows
25+
226
# 2.2.2
327

428
Features:
@@ -12,7 +36,7 @@ Fixes:
1236

1337
# 2.2.0
1438
Features:
15-
- A beta release for the new stdlib called Belt
39+
- A beta release for the new stdlib called Belt
1640
- #2436, #2381, #2377, #2353 bs.deriving abstract support
1741

1842

@@ -25,7 +49,7 @@ Fixes:
2549
- #2399, turn partial application warnings to error in react template
2650
- #2465 build on FreeBSD
2751
- #2450 ignore bsb.lock
28-
- #2356 ship build-schema.json
52+
- #2356 ship build-schema.json
2953
- #2489, #2464 capitalize names in combination of '/'
3054
- #2459 subdirs:true by default for templates
3155
- #2428, fix trailing space on react-jsx
@@ -35,11 +59,11 @@ Fixes:
3559
Features:
3660
- #2282, #2280,#2272,#2271,#2270,#2262,#2260,#2255,#2253
3761
Automatically derive js converter between ocaml and Js values
38-
see docs: https://bucklescript.github.io/bucklescript/Manual.html#_mapping_between_js_values_and_ocaml_values_since_2_1_0
39-
- #2238, #2225, #2221
62+
see docs: https://bucklescript.github.io/bucklescript/Manual.html#_mapping_between_js_values_and_ocaml_values_since_2_1_0
63+
- #2238, #2225, #2221
4064
Make the compiler relocatable
4165
prebuilt compiler (this release for Mac/Win)
42-
- #2276 update reason syntax@d0d18
66+
- #2276 update reason syntax@d0d18
4367
- #2229 improve error message with regard to `@bs`
4468
- #2266, add Js_global.(encode|decode)URI(Component) bindings
4569
- #2220 make watcher mode in linux accept ninja progress animation
@@ -69,7 +93,7 @@ Features
6993

7094
# 1.10.3
7195
Features:
72-
- #2112, introduced a key `suffix`, so that user can
96+
- #2112, introduced a key `suffix`, so that user can
7397
choose `suffix : ".bs.js"`
7498
- #2138, in combination of `.bs.js` suffix and `in-source` build,
7599
bsb is able to remove staled build artifact
@@ -78,7 +102,7 @@ Features:
78102
it in reason syntax
79103
- #2096, clorized ninja build output
80104

81-
- #2120 better error message in the location of `{json||json}`
105+
- #2120 better error message in the location of `{json||json}`
82106
- #2123 avoid namespace leaking in types
83107
- #2130 make Sys module not break React Native bindings
84108
- #2159, #2165 enhance user expereince of bsb (less verbose, status bar when failed)

Diff for: Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ libs:
1616
$(MAKE) -C jscomp/runtime -j8 all
1717
$(MAKE) -C jscomp/others -j8 all
1818
$(MAKE) -C jscomp/stdlib -j8 all
19-
19+
2020

2121
DEST=lib/ocaml
2222
RUNTIME=jscomp/runtime
@@ -26,6 +26,8 @@ OTHERS=jscomp/others
2626
# scripts/build_uitil.js
2727
# function install
2828
# scripts/build_util.install
29+
30+
# ATTENTION: syncup build_util.install for windows
2931
install:
3032
@echo "Installation"
3133
cp $(RUNTIME)/*.cmt* $(RUNTIME)/*.cmj* $(RUNTIME)/js.ml $(RUNTIME)/js.cmi \

Diff for: docs/api/Belt.Array.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<li><a href="Belt_MutableSetInt.html">Belt_MutableSetInt</a></li>
3333
<li><a href="Belt_MutableSetString.html">Belt_MutableSetString</a></li>
3434
<li><a href="Belt_MutableStack.html">Belt_MutableStack</a></li>
35+
<li><a href="Belt_Option.html">Belt_Option</a></li>
3536
<li><a href="Belt_Range.html">Belt_Range</a></li>
3637
<li><a href="Belt_Set.html">Belt_Set</a></li>
3738
<li><a href="Belt_SetDict.html">Belt_SetDict</a></li>
@@ -102,7 +103,7 @@ <h1>Module <a href="type_Belt.Array.html">Belt.Array</a></h1>
102103
<a href="Belt.Array.html"><code class="code">Belt.Array</code></a>
103104
<p>
104105

105-
<b>mutable array</b>: Utililites functions<br>
106+
<b>mutable array</b>: Utilities functions<br>
106107

107108
</div>
108109

Diff for: docs/api/Belt.HashMap.html

+8-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script src="../api_static//script.js"></script>
88
<script>hljs.initHighlightingOnLoad();</script>
99
<meta charset="utf8">
10-
<link rel="previous" href="Belt.HashSet.html">
10+
<link rel="previous" href="Belt.HashSet.html"><link rel="next" href="Belt.Option.html">
1111
<title> Belt.HashMap </title></head>
1212
<body>
1313
<nav class="module-index"><ul><li><a href="Belt.html">Belt</a></li>
@@ -32,6 +32,7 @@
3232
<li><a href="Belt_MutableSetInt.html">Belt_MutableSetInt</a></li>
3333
<li><a href="Belt_MutableSetString.html">Belt_MutableSetString</a></li>
3434
<li><a href="Belt_MutableStack.html">Belt_MutableStack</a></li>
35+
<li><a href="Belt_Option.html">Belt_Option</a></li>
3536
<li><a href="Belt_Range.html">Belt_Range</a></li>
3637
<li><a href="Belt_Set.html">Belt_Set</a></li>
3738
<li><a href="Belt_SetDict.html">Belt_SetDict</a></li>
@@ -93,15 +94,16 @@
9394
<li><a href="Node_process.html">Node_process</a></li></ul></nav>
9495
<div class="navbar"><a class="pre" href="Belt.HashSet.html" title="Belt.HashSet">Previous</a>
9596
&nbsp;<a class="up" href="Belt.html" title="Belt">Up</a>
96-
&nbsp;</div>
97+
&nbsp;<a class="post" href="Belt.Option.html" title="Belt.Option">Next</a>
98+
</div>
9799
<h1>Module <a href="type_Belt.HashMap.html">Belt.HashMap</a></h1>
98100

99101
<pre><span class="keyword">module</span> HashMap: <code class="type"><a href="Belt_HashMap.html">Belt_HashMap</a></code></pre><div class="info module top">
100102
<div class="not-examples">
101103
<a href="Belt.HashMap.html"><code class="code">Belt.HashMap</code></a>
102104
<p>
103105

104-
The toplevel provides generic <b>mutable</b> hash map operations.
106+
The top level provides generic <b>mutable</b> hash map operations.
105107
<p>
106108

107109
It also has two specialized inner modules
@@ -224,7 +226,8 @@ <h1>Module <a href="type_Belt.HashMap.html">Belt.HashMap</a></h1>
224226
<pre><span id="VALtoArray"><span class="keyword">val</span> toArray</span> : <code class="type">('key, 'value, 'id) <a href="Belt_HashMap.html#TYPEt">t</a> -> ('key * 'value) array</code></pre>
225227
<pre><span id="VALkeysToArray"><span class="keyword">val</span> keysToArray</span> : <code class="type">('key, 'a, 'b) <a href="Belt_HashMap.html#TYPEt">t</a> -> 'key array</code></pre>
226228
<pre><span id="VALvaluesToArray"><span class="keyword">val</span> valuesToArray</span> : <code class="type">('a, 'value, 'b) <a href="Belt_HashMap.html#TYPEt">t</a> -> 'value array</code></pre>
227-
<pre><span id="VALofArray"><span class="keyword">val</span> ofArray</span> : <code class="type">('key * 'value) array -><br> id:('key, 'id) <a href="Belt_HashMap.html#TYPEid">id</a> -> ('key, 'value, 'id) <a href="Belt_HashMap.html#TYPEt">t</a></code></pre>
229+
<pre><span id="VALfromArray"><span class="keyword">val</span> fromArray</span> : <code class="type">('key * 'value) array -><br> id:('key, 'id) <a href="Belt_HashMap.html#TYPEid">id</a> -> ('key, 'value, 'id) <a href="Belt_HashMap.html#TYPEt">t</a></code></pre>
228230
<pre><span id="VALmergeMany"><span class="keyword">val</span> mergeMany</span> : <code class="type">('key, 'value, 'id) <a href="Belt_HashMap.html#TYPEt">t</a> -> ('key * 'value) array -> unit</code></pre>
229231
<pre><span id="VALgetBucketHistogram"><span class="keyword">val</span> getBucketHistogram</span> : <code class="type">('a, 'b, 'c) <a href="Belt_HashMap.html#TYPEt">t</a> -> int array</code></pre>
230-
<pre><span id="VALlogStats"><span class="keyword">val</span> logStats</span> : <code class="type">('a, 'b, 'c) <a href="Belt_HashMap.html#TYPEt">t</a> -> unit</code></pre></body></html>
232+
<pre><span id="VALlogStats"><span class="keyword">val</span> logStats</span> : <code class="type">('a, 'b, 'c) <a href="Belt_HashMap.html#TYPEt">t</a> -> unit</code></pre>
233+
<pre><span id="VALofArray"><span class="keyword">val</span> ofArray</span> : <code class="type">('key * 'value) array -><br> id:('key, 'id) <a href="Belt_HashMap.html#TYPEid">id</a> -> ('key, 'value, 'id) <a href="Belt_HashMap.html#TYPEt">t</a></code></pre></body></html>

Diff for: docs/api/Belt.HashSet.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<li><a href="Belt_MutableSetInt.html">Belt_MutableSetInt</a></li>
3333
<li><a href="Belt_MutableSetString.html">Belt_MutableSetString</a></li>
3434
<li><a href="Belt_MutableStack.html">Belt_MutableStack</a></li>
35+
<li><a href="Belt_Option.html">Belt_Option</a></li>
3536
<li><a href="Belt_Range.html">Belt_Range</a></li>
3637
<li><a href="Belt_Set.html">Belt_Set</a></li>
3738
<li><a href="Belt_SetDict.html">Belt_SetDict</a></li>
@@ -102,7 +103,7 @@ <h1>Module <a href="type_Belt.HashSet.html">Belt.HashSet</a></h1>
102103
<a href="Belt.HashSet.html"><code class="code">Belt.HashSet</code></a>
103104
<p>
104105

105-
The toplevel provides generic <b>mutable</b> hash set operations.
106+
The top level provides generic <b>mutable</b> hash set operations.
106107
<p>
107108

108109
It also has two specialized inner modules
@@ -167,5 +168,6 @@ <h1>Module <a href="type_Belt.HashSet.html">Belt.HashSet</a></h1>
167168
<pre><span id="VALlogStats"><span class="keyword">val</span> logStats</span> : <code class="type">('a, 'b) <a href="Belt_HashSet.html#TYPEt">t</a> -> unit</code></pre>
168169
<pre><span id="VALtoArray"><span class="keyword">val</span> toArray</span> : <code class="type">('a, 'id) <a href="Belt_HashSet.html#TYPEt">t</a> -> 'a array</code></pre>
169170
<pre><span id="VALofArray"><span class="keyword">val</span> ofArray</span> : <code class="type">'a array -> id:('a, 'id) <a href="Belt_HashSet.html#TYPEid">id</a> -> ('a, 'id) <a href="Belt_HashSet.html#TYPEt">t</a></code></pre>
171+
<pre><span id="VALfromArray"><span class="keyword">val</span> fromArray</span> : <code class="type">'a array -> id:('a, 'id) <a href="Belt_HashSet.html#TYPEid">id</a> -> ('a, 'id) <a href="Belt_HashSet.html#TYPEt">t</a></code></pre>
170172
<pre><span id="VALmergeMany"><span class="keyword">val</span> mergeMany</span> : <code class="type">('a, 'id) <a href="Belt_HashSet.html#TYPEt">t</a> -> 'a array -> unit</code></pre>
171173
<pre><span id="VALgetBucketHistogram"><span class="keyword">val</span> getBucketHistogram</span> : <code class="type">('a, 'b) <a href="Belt_HashSet.html#TYPEt">t</a> -> int array</code></pre></body></html>

Diff for: docs/api/Belt.Id.html

+55-12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<li><a href="Belt_MutableSetInt.html">Belt_MutableSetInt</a></li>
3333
<li><a href="Belt_MutableSetString.html">Belt_MutableSetString</a></li>
3434
<li><a href="Belt_MutableStack.html">Belt_MutableStack</a></li>
35+
<li><a href="Belt_Option.html">Belt_Option</a></li>
3536
<li><a href="Belt_Range.html">Belt_Range</a></li>
3637
<li><a href="Belt_Set.html">Belt_Set</a></li>
3738
<li><a href="Belt_SetDict.html">Belt_SetDict</a></li>
@@ -101,12 +102,12 @@ <h1>Module <a href="type_Belt.Id.html">Belt.Id</a></h1>
101102
<a href="Belt.Id.html"><code class="code">Belt.Id</code></a>
102103
<p>
103104

104-
Provide utiliites to create identified comparators or hashes for
105-
data structures used below.
105+
Provide utilities to create identified comparators or hashes for
106+
data structures used below.
106107
<p>
107108

108-
It create a unique identifer per module of
109-
functions so that different data structures with slightly different
109+
It create a unique identifier per module of
110+
functions so that different data structures with slightly different
110111
comparison functions won't mix<br>
111112

112113
</div>
@@ -122,7 +123,7 @@ <h1>Module <a href="type_Belt.Id.html">Belt.Id</a></h1>
122123
<code class="code">('a, 'id) hash</code>
123124
<p>
124125

125-
Its runtime represenation is a <code class="code">hash</code> function, but signed with a
126+
Its runtime represenation is a <code class="code">hash</code> function, but signed with a
126127
type parameter, so that different hash functions type mismatch<br>
127128

128129
</div>
@@ -138,7 +139,7 @@ <h1>Module <a href="type_Belt.Id.html">Belt.Id</a></h1>
138139
<code class="code">('a, 'id) eq</code>
139140
<p>
140141

141-
Its runtime represenation is an <code class="code">eq</code> function, but signed with a
142+
Its runtime represenation is an <code class="code">eq</code> function, but signed with a
142143
type parameter, so that different hash functions type mismatch<br>
143144

144145
</div>
@@ -154,7 +155,7 @@ <h1>Module <a href="type_Belt.Id.html">Belt.Id</a></h1>
154155
<code class="code">('a,'id) cmp</code>
155156
<p>
156157

157-
Its runtime representation is a <code class="code">cmp</code> function, but signed with a
158+
Its runtime representation is a <code class="code">cmp</code> function, but signed with a
158159
type parameter, so that different hash functions type mismatch<br>
159160

160161
</div>
@@ -176,13 +177,13 @@ <h1>Module <a href="type_Belt.Id.html">Belt.Id</a></h1>
176177
<p>
177178

178179
Unlike normal functions, when created, it comes with a unique identity (guaranteed
179-
by the type system).
180+
by the type system).
180181
<p>
181182

182-
It can be created using function <a href="Belt_Id.html#VALcomparableU"><code class="code">Belt_Id.comparableU</code></a> or<a href="Belt_Id.html#VALcomparable"><code class="code">Belt_Id.comparable</code></a>.
183+
It can be created using function <a href="Belt_Id.html#VALcomparableU"><code class="code">Belt_Id.comparableU</code></a> or<a href="Belt_Id.html#VALcomparable"><code class="code">Belt_Id.comparable</code></a>.
183184
<p>
184185

185-
The idea of a unique identity when created is that it makes sure two sets would type
186+
The idea of a unique identity when created is that it makes sure two sets would type
186187
mismatch if they use different comparison function<br>
187188

188189
</div>
@@ -191,6 +192,26 @@ <h1>Module <a href="type_Belt.Id.html">Belt.Id</a></h1>
191192

192193

193194

195+
<pre><span class="keyword">module</span> <a href="Belt_Id.MakeComparableU.html">MakeComparableU</a>: <div class="sig_block"><code class="code">functor (</code><code class="code">M</code><code class="code"> : </code><code class="code">sig</code><div class="sig_block"><div class="type-declaration">
196+
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> </pre>
197+
</div>
198+
199+
200+
<pre><span id="VALcmp"><span class="keyword">val</span> cmp</span> : <code class="type">(t -> t -> int [@bs])</code></pre></div><code class="code">end</code><code class="code">) -&gt; </code><code class="type"><a href="Belt_Id.Comparable.html">Comparable</a></code><code class="type"> with type t = M.t</code></div></pre> <div class="info">
201+
<div class="not-examples">
202+
203+
</div>
204+
</div>
205+
<pre><span class="keyword">module</span> <a href="Belt_Id.MakeComparable.html">MakeComparable</a>: <div class="sig_block"><code class="code">functor (</code><code class="code">M</code><code class="code"> : </code><code class="code">sig</code><div class="sig_block"><div class="type-declaration">
206+
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> </pre>
207+
</div>
208+
209+
210+
<pre><span id="VALcmp"><span class="keyword">val</span> cmp</span> : <code class="type">t -> t -> int</code></pre></div><code class="code">end</code><code class="code">) -&gt; </code><code class="type"><a href="Belt_Id.Comparable.html">Comparable</a></code><code class="type"> with type t = M.t</code></div></pre> <div class="info">
211+
<div class="not-examples">
212+
213+
</div>
214+
</div>
194215
<pre><span id="VALcomparableU"><span class="keyword">val</span> comparableU</span> : <code class="type">cmp:('a -> 'a -> int [@bs]) -> (module Belt_Id.Comparable with type t = 'a)</code></pre>
195216
<pre><span id="VALcomparable"><span class="keyword">val</span> comparable</span> : <code class="type">cmp:('a -> 'a -> int) -> (module Belt_Id.Comparable with type t = 'a)</code></pre>
196217
<pre><span class="keyword">module type</span> <a href="Belt_Id.Hashable.html">Hashable</a> = <code class="code">sig</code> <a href="Belt_Id.Hashable.html">..</a> <code class="code">end</code></pre> <div class="info">
@@ -206,13 +227,13 @@ <h1>Module <a href="type_Belt.Id.html">Belt.Id</a></h1>
206227
<p>
207228

208229
Unlike normal functions, when created, it comes with a unique identity (guaranteed
209-
by the type system).
230+
by the type system).
210231
<p>
211232

212233
It can be created using function <a href="Belt_Id.html#VALhashableU"><code class="code">Belt_Id.hashableU</code></a> or <a href="Belt_Id.html#VALhashable"><code class="code">Belt_Id.hashable</code></a>.
213234
<p>
214235

215-
The idea of a unique identity when created is that it makes sure two hash sets would type
236+
The idea of a unique identity when created is that it makes sure two hash sets would type
216237
mismatch if they use different comparison function<br>
217238

218239
</div>
@@ -221,5 +242,27 @@ <h1>Module <a href="type_Belt.Id.html">Belt.Id</a></h1>
221242

222243

223244

245+
<pre><span class="keyword">module</span> <a href="Belt_Id.MakeHashableU.html">MakeHashableU</a>: <div class="sig_block"><code class="code">functor (</code><code class="code">M</code><code class="code"> : </code><code class="code">sig</code><div class="sig_block"><div class="type-declaration">
246+
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> </pre>
247+
</div>
248+
249+
250+
<pre><span id="VALhash"><span class="keyword">val</span> hash</span> : <code class="type">(t -> int [@bs])</code></pre>
251+
<pre><span id="VALeq"><span class="keyword">val</span> eq</span> : <code class="type">(t -> t -> bool [@bs])</code></pre></div><code class="code">end</code><code class="code">) -&gt; </code><code class="type"><a href="Belt_Id.Hashable.html">Hashable</a></code><code class="type"> with type t = M.t</code></div></pre> <div class="info">
252+
<div class="not-examples">
253+
254+
</div>
255+
</div>
256+
<pre><span class="keyword">module</span> <a href="Belt_Id.MakeHashable.html">MakeHashable</a>: <div class="sig_block"><code class="code">functor (</code><code class="code">M</code><code class="code"> : </code><code class="code">sig</code><div class="sig_block"><div class="type-declaration">
257+
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type"></code>t</span> </pre>
258+
</div>
259+
260+
261+
<pre><span id="VALhash"><span class="keyword">val</span> hash</span> : <code class="type">t -> int</code></pre>
262+
<pre><span id="VALeq"><span class="keyword">val</span> eq</span> : <code class="type">t -> t -> bool</code></pre></div><code class="code">end</code><code class="code">) -&gt; </code><code class="type"><a href="Belt_Id.Hashable.html">Hashable</a></code><code class="type"> with type t = M.t</code></div></pre> <div class="info">
263+
<div class="not-examples">
264+
265+
</div>
266+
</div>
224267
<pre><span id="VALhashableU"><span class="keyword">val</span> hashableU</span> : <code class="type">hash:('a -> int [@bs]) -><br> eq:('a -> 'a -> bool [@bs]) -> (module Belt_Id.Hashable with type t = 'a)</code></pre>
225268
<pre><span id="VALhashable"><span class="keyword">val</span> hashable</span> : <code class="type">hash:('a -> int) -><br> eq:('a -> 'a -> bool) -> (module Belt_Id.Hashable with type t = 'a)</code></pre></body></html>

0 commit comments

Comments
 (0)