You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike normal functions, when created, it comes with a unique identity (guaranteed
179
-
by the type system).
180
+
by the type system).
180
181
<p>
181
182
182
-
It can be created using function <ahref="Belt_Id.html#VALcomparableU"><codeclass="code">Belt_Id.comparableU</code></a> or<ahref="Belt_Id.html#VALcomparable"><codeclass="code">Belt_Id.comparable</code></a>.
183
+
It can be created using function <ahref="Belt_Id.html#VALcomparableU"><codeclass="code">Belt_Id.comparableU</code></a> or<ahref="Belt_Id.html#VALcomparable"><codeclass="code">Belt_Id.comparable</code></a>.
183
184
<p>
184
185
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
186
187
mismatch if they use different comparison function<br>
<pre><spanid="VALcmp"><spanclass="keyword">val</span> cmp</span> : <codeclass="type">(t -> t -> int [@bs])</code></pre></div><codeclass="code">end</code><codeclass="code">) -> </code><codeclass="type"><ahref="Belt_Id.Comparable.html">Comparable</a></code><codeclass="type"> with type t = M.t</code></div></pre><divclass="info">
<pre><spanid="VALcmp"><spanclass="keyword">val</span> cmp</span> : <codeclass="type">t -> t -> int</code></pre></div><codeclass="code">end</code><codeclass="code">) -> </code><codeclass="type"><ahref="Belt_Id.Comparable.html">Comparable</a></code><codeclass="type"> with type t = M.t</code></div></pre><divclass="info">
211
+
<divclass="not-examples">
212
+
213
+
</div>
214
+
</div>
194
215
<pre><spanid="VALcomparableU"><spanclass="keyword">val</span> comparableU</span> : <codeclass="type">cmp:('a -> 'a -> int [@bs]) -> (module Belt_Id.Comparable with type t = 'a)</code></pre>
195
216
<pre><spanid="VALcomparable"><spanclass="keyword">val</span> comparable</span> : <codeclass="type">cmp:('a -> 'a -> int) -> (module Belt_Id.Comparable with type t = 'a)</code></pre>
Unlike normal functions, when created, it comes with a unique identity (guaranteed
209
-
by the type system).
230
+
by the type system).
210
231
<p>
211
232
212
233
It can be created using function <ahref="Belt_Id.html#VALhashableU"><codeclass="code">Belt_Id.hashableU</code></a> or <ahref="Belt_Id.html#VALhashable"><codeclass="code">Belt_Id.hashable</code></a>.
213
234
<p>
214
235
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
216
237
mismatch if they use different comparison function<br>
<pre><spanid="VALhash"><spanclass="keyword">val</span> hash</span> : <codeclass="type">(t -> int [@bs])</code></pre>
251
+
<pre><spanid="VALeq"><spanclass="keyword">val</span> eq</span> : <codeclass="type">(t -> t -> bool [@bs])</code></pre></div><codeclass="code">end</code><codeclass="code">) -> </code><codeclass="type"><ahref="Belt_Id.Hashable.html">Hashable</a></code><codeclass="type"> with type t = M.t</code></div></pre><divclass="info">
<pre><spanid="VALeq"><spanclass="keyword">val</span> eq</span> : <codeclass="type">t -> t -> bool</code></pre></div><codeclass="code">end</code><codeclass="code">) -> </code><codeclass="type"><ahref="Belt_Id.Hashable.html">Hashable</a></code><codeclass="type"> with type t = M.t</code></div></pre><divclass="info">
263
+
<divclass="not-examples">
264
+
265
+
</div>
266
+
</div>
224
267
<pre><spanid="VALhashableU"><spanclass="keyword">val</span> hashableU</span> : <codeclass="type">hash:('a -> int [@bs]) -><br> eq:('a -> 'a -> bool [@bs]) -> (module Belt_Id.Hashable with type t = 'a)</code></pre>
225
268
<pre><spanid="VALhashable"><spanclass="keyword">val</span> hashable</span> : <codeclass="type">hash:('a -> int) -><br> eq:('a -> 'a -> bool) -> (module Belt_Id.Hashable with type t = 'a)</code></pre></body></html>
0 commit comments