forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJs.Vector.html
184 lines (143 loc) · 10.6 KB
/
Js.Vector.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="../api_static/tomorrow-night.css">
<link rel="stylesheet" href="../api_static/style.css" type="text/css">
<script src="../api_static//highlight.pack.js"></script>
<script src="../api_static//script.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<meta charset="utf8">
<link rel="previous" href="Js.List.html">
<title> Js.Vector </title></head>
<body>
<nav class="module-index"><ul><li><a href="Bs.html">Bs</a></li>
<li><a href="Bs_dyn.html">Bs_dyn</a></li>
<li><a href="Bs_dyn_lib.html">Bs_dyn_lib</a></li>
<li><a href="Dom.html">Dom</a></li>
<li><a href="Dom_storage.html">Dom_storage</a></li>
<li><a href="Js.html">Js</a></li>
<li><a href="Js_array.html">Js_array</a></li>
<li><a href="Js_boolean.html">Js_boolean</a></li>
<li><a href="Js_cast.html">Js_cast</a></li>
<li><a href="Js_date.html">Js_date</a></li>
<li><a href="Js_dict.html">Js_dict</a></li>
<li><a href="Js_exn.html">Js_exn</a></li>
<li><a href="Js_float.html">Js_float</a></li>
<li><a href="Js_global.html">Js_global</a></li>
<li><a href="Js_int.html">Js_int</a></li>
<li><a href="Js_int64.html">Js_int64</a></li>
<li><a href="Js_internal.html">Js_internal</a></li>
<li><a href="Js_json.html">Js_json</a></li>
<li><a href="Js_list.html">Js_list</a></li>
<li><a href="Js_math.html">Js_math</a></li>
<li><a href="Js_nativeint.html">Js_nativeint</a></li>
<li><a href="Js_null.html">Js_null</a></li>
<li><a href="Js_null_undefined.html">Js_null_undefined</a></li>
<li><a href="Js_obj.html">Js_obj</a></li>
<li><a href="Js_option.html">Js_option</a></li>
<li><a href="Js_primitive.html">Js_primitive</a></li>
<li><a href="Js_promise.html">Js_promise</a></li>
<li><a href="Js_re.html">Js_re</a></li>
<li><a href="Js_result.html">Js_result</a></li>
<li><a href="Js_string.html">Js_string</a></li>
<li><a href="Js_typed_array.html">Js_typed_array</a></li>
<li><a href="Js_types.html">Js_types</a></li>
<li><a href="Js_undefined.html">Js_undefined</a></li>
<li><a href="Js_unsafe.html">Js_unsafe</a></li>
<li><a href="Js_vector.html">Js_vector</a></li>
<li><a href="Node.html">Node</a></li>
<li><a href="Node_buffer.html">Node_buffer</a></li>
<li><a href="Node_child_process.html">Node_child_process</a></li>
<li><a href="Node_fs.html">Node_fs</a></li>
<li><a href="Node_module.html">Node_module</a></li>
<li><a href="Node_path.html">Node_path</a></li>
<li><a href="Node_process.html">Node_process</a></li></ul></nav>
<div class="navbar"><a class="pre" href="Js.List.html" title="Js.List">Previous</a>
<a class="up" href="Js.html" title="Js">Up</a>
</div>
<h1>Module <a href="type_Js.Vector.html">Js.Vector</a></h1>
<pre><span class="keyword">module</span> Vector: <code class="type"><a href="Js_vector.html">Js_vector</a></code></pre><hr width="100%">
<div class="type-declaration">
<pre><span id="TYPEt"><span class="keyword">type</span> <code class="type">'a</code> t</span> = <code class="type">'a array</code> </pre>
</div>
<pre><span id="VALfilterInPlace"><span class="keyword">val</span> filterInPlace</span> : <code class="type">('a -> bool [@bs]) -> 'a <a href="Js_vector.html#TYPEt">t</a> -> unit</code></pre><div class="info ">
<div class="not-examples">
</div>
</div>
<div class="param_info"><code class="code">p</code> : predicate</div>
<div class="param_info"><code class="code">a</code> : array</div>
<pre><span id="VALempty"><span class="keyword">val</span> empty</span> : <code class="type">'a <a href="Js_vector.html#TYPEt">t</a> -> unit</code></pre>
<pre><span id="VALpushBack"><span class="keyword">val</span> pushBack</span> : <code class="type">'a -> 'a <a href="Js_vector.html#TYPEt">t</a> -> unit</code></pre>
<pre><span id="VALcopy"><span class="keyword">val</span> copy</span> : <code class="type">'a <a href="Js_vector.html#TYPEt">t</a> -> 'a <a href="Js_vector.html#TYPEt">t</a></code></pre><div class="info ">
<div class="not-examples">
shallow copy<br>
</div>
</div>
<pre><span id="VALmemByRef"><span class="keyword">val</span> memByRef</span> : <code class="type">'a -> 'a <a href="Js_vector.html#TYPEt">t</a> -> bool</code></pre><div class="info ">
<div class="not-examples">
Find by JS (===) equality<br>
</div>
</div>
<pre><span id="VALiter"><span class="keyword">val</span> iter</span> : <code class="type">('a -> unit [@bs]) -> 'a <a href="Js_vector.html#TYPEt">t</a> -> unit</code></pre>
<pre><span id="VALiteri"><span class="keyword">val</span> iteri</span> : <code class="type">(int -> 'a -> unit [@bs]) -> 'a <a href="Js_vector.html#TYPEt">t</a> -> unit</code></pre>
<pre><span id="VALofList"><span class="keyword">val</span> ofList</span> : <code class="type">'a list -> 'a <a href="Js_vector.html#TYPEt">t</a></code></pre>
<pre><span id="VALtoList"><span class="keyword">val</span> toList</span> : <code class="type">'a <a href="Js_vector.html#TYPEt">t</a> -> 'a list</code></pre>
<pre><span id="VALmap"><span class="keyword">val</span> map</span> : <code class="type">('a -> 'b [@bs]) -> 'a <a href="Js_vector.html#TYPEt">t</a> -> 'b <a href="Js_vector.html#TYPEt">t</a></code></pre>
<pre><span id="VALmapi"><span class="keyword">val</span> mapi</span> : <code class="type">(int -> 'a -> 'b [@bs]) -> 'a <a href="Js_vector.html#TYPEt">t</a> -> 'b <a href="Js_vector.html#TYPEt">t</a></code></pre>
<pre><span id="VALfoldLeft"><span class="keyword">val</span> foldLeft</span> : <code class="type">('a -> 'b -> 'a [@bs]) -> 'a -> 'b <a href="Js_vector.html#TYPEt">t</a> -> 'a</code></pre>
<pre><span id="VALfoldRight"><span class="keyword">val</span> foldRight</span> : <code class="type">('b -> 'a -> 'a [@bs]) -> 'b <a href="Js_vector.html#TYPEt">t</a> -> 'a -> 'a</code></pre>
<pre><span id="VALlength"><span class="keyword">val</span> length</span> : <code class="type">'a <a href="Js_vector.html#TYPEt">t</a> -> int</code></pre><div class="info ">
<div class="not-examples">
Return the length (number of elements) of the given array.<br>
</div>
</div>
<pre><span id="VALget"><span class="keyword">val</span> get</span> : <code class="type">'a <a href="Js_vector.html#TYPEt">t</a> -> int -> 'a</code></pre><div class="info ">
<div class="not-examples">
<code class="code">Array.get a n</code> returns the element number <code class="code">n</code> of array <code class="code">a</code>.
The first element has number 0.
The last element has number <code class="code">Array.length a - 1</code>.
You can also write <code class="code">a.(n)</code> instead of <code class="code">Array.get a n</code>.
<p>
Raise <code class="code">Invalid_argument "index out of bounds"</code>
if <code class="code">n</code> is outside the range 0 to <code class="code">(Array.length a - 1)</code>.<br>
</div>
</div>
<pre><span id="VALset"><span class="keyword">val</span> set</span> : <code class="type">'a <a href="Js_vector.html#TYPEt">t</a> -> int -> 'a -> unit</code></pre><div class="info ">
<div class="not-examples">
<code class="code">Array.set a n x</code> modifies array <code class="code">a</code> in place, replacing
element number <code class="code">n</code> with <code class="code">x</code>.
You can also write <code class="code">a.(n) <- x</code> instead of <code class="code">Array.set a n x</code>.
<p>
Raise <code class="code">Invalid_argument "index out of bounds"</code>
if <code class="code">n</code> is outside the range 0 to <code class="code">Array.length a - 1</code>.<br>
</div>
</div>
<pre><span id="VALmake"><span class="keyword">val</span> make</span> : <code class="type">int -> 'a -> 'a <a href="Js_vector.html#TYPEt">t</a></code></pre><div class="info ">
<div class="not-examples">
<code class="code">Array.make n x</code> returns a fresh array of length <code class="code">n</code>,
initialized with <code class="code">x</code>.
All the elements of this new array are initially
physically equal to <code class="code">x</code> (in the sense of the <code class="code">==</code> predicate).
Consequently, if <code class="code">x</code> is mutable, it is shared among all elements
of the array, and modifying <code class="code">x</code> through one of the array entries
will modify all other entries at the same time.
<p>
Raise <code class="code">Invalid_argument</code> if <code class="code">n < 0</code> or <code class="code">n > Sys.max_array_length</code>.
If the value of <code class="code">x</code> is a floating-point number, then the maximum
size is only <code class="code">Sys.max_array_length / 2</code>.<br>
</div>
</div>
<pre><span id="VALinit"><span class="keyword">val</span> init</span> : <code class="type">int -> (int -> 'a [@bs]) -> 'a <a href="Js_vector.html#TYPEt">t</a></code></pre><div class="info ">
<div class="not-examples">
<div class="tag"> <b>Raises</b> <code>RangeError</code> when <code class="code">n</code> is negative<br>
</div>
</div>
</div>
<div class="param_info"><code class="code">n</code> : size</div>
<pre><span id="VALappend"><span class="keyword">val</span> append</span> : <code class="type">'a -> 'a <a href="Js_vector.html#TYPEt">t</a> -> 'a <a href="Js_vector.html#TYPEt">t</a></code></pre><div class="info ">
<div class="not-examples">
<code class="code">append x a</code> returns a fresh array with x appended to a<br>
</div>
</div>
<pre><span id="VALunsafe_get"><span class="keyword">val</span> unsafe_get</span> : <code class="type">'a <a href="Js_vector.html#TYPEt">t</a> -> int -> 'a</code></pre>
<pre><span id="VALunsafe_set"><span class="keyword">val</span> unsafe_set</span> : <code class="type">'a <a href="Js_vector.html#TYPEt">t</a> -> int -> 'a -> unit</code></pre></body></html>