@grain/stdlib 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/array.md +491 -491
- package/bigint.md +198 -198
- package/buffer.gr +66 -1
- package/buffer.md +395 -272
- package/bytes.gr +1 -0
- package/bytes.md +200 -199
- package/char.md +125 -125
- package/exception.md +9 -9
- package/float32.md +195 -195
- package/float64.md +195 -195
- package/fs.md +115 -115
- package/hash.md +16 -16
- package/int16.md +155 -155
- package/int32.gr +1 -1
- package/int32.md +207 -207
- package/int64.gr +1 -1
- package/int64.md +207 -207
- package/int8.md +155 -155
- package/json.md +59 -59
- package/list.md +347 -347
- package/map.md +222 -222
- package/marshal.md +12 -12
- package/number.gr +119 -5
- package/number.md +503 -261
- package/option.md +141 -141
- package/package.json +1 -1
- package/path.md +90 -90
- package/pervasives.md +238 -238
- package/priorityqueue.md +112 -112
- package/queue.md +117 -117
- package/random.md +37 -37
- package/range.md +36 -36
- package/rational.md +107 -107
- package/regex.md +91 -91
- package/result.md +102 -102
- package/runtime/atof/decimal.md +6 -6
- package/runtime/compare.md +7 -7
- package/runtime/dataStructures.md +178 -178
- package/runtime/equal.md +7 -7
- package/runtime/exception.md +15 -15
- package/runtime/malloc.md +9 -9
- package/runtime/numbers.md +269 -269
- package/runtime/string.md +17 -17
- package/runtime/unsafe/conv.md +6 -6
- package/runtime/unsafe/memory.md +10 -10
- package/runtime/utf8.md +31 -31
- package/runtime/wasi.md +9 -9
- package/set.md +211 -211
- package/stack.md +122 -122
- package/string.md +228 -228
- package/uint16.md +148 -148
- package/uint32.md +192 -192
- package/uint64.md +192 -192
- package/uint8.md +148 -148
- package/uri.md +77 -77
- package/wasi/file.md +269 -269
- package/wasi/process.md +21 -21
- package/wasi/random.md +9 -9
- package/wasi/time.md +12 -12
package/pervasives.md
CHANGED
|
@@ -33,15 +33,15 @@ Inverts the given Boolean value.
|
|
|
33
33
|
|
|
34
34
|
Parameters:
|
|
35
35
|
|
|
36
|
-
|param|type|description|
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
| param | type | description |
|
|
37
|
+
| ------ | ------ | ----------- |
|
|
38
|
+
| `bool` | `Bool` | The operand |
|
|
39
39
|
|
|
40
40
|
Returns:
|
|
41
41
|
|
|
42
|
-
|type|description|
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
| type | description |
|
|
43
|
+
| ------ | ------------------ |
|
|
44
|
+
| `Bool` | The inverted value |
|
|
45
45
|
|
|
46
46
|
Examples:
|
|
47
47
|
|
|
@@ -71,16 +71,16 @@ If the first operand is `true`, returns the value of the second operand.
|
|
|
71
71
|
|
|
72
72
|
Parameters:
|
|
73
73
|
|
|
74
|
-
|param|type|description|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
| param | type | description |
|
|
75
|
+
| ------- | ------ | ------------------ |
|
|
76
|
+
| `left` | `Bool` | The first operand |
|
|
77
|
+
| `right` | `Bool` | The second operand |
|
|
78
78
|
|
|
79
79
|
Returns:
|
|
80
80
|
|
|
81
|
-
|type|description|
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
| type | description |
|
|
82
|
+
| ------ | ------------------------------------------------------------------------------- |
|
|
83
|
+
| `Bool` | The first operand if it is `false` or the value of the second operand otherwise |
|
|
84
84
|
|
|
85
85
|
### Pervasives.**(||)**
|
|
86
86
|
|
|
@@ -100,16 +100,16 @@ If the first operand is `false`, returns the value of the second operand.
|
|
|
100
100
|
|
|
101
101
|
Parameters:
|
|
102
102
|
|
|
103
|
-
|param|type|description|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
| param | type | description |
|
|
104
|
+
| ------- | ------ | ------------------ |
|
|
105
|
+
| `left` | `Bool` | The first operand |
|
|
106
|
+
| `right` | `Bool` | The second operand |
|
|
107
107
|
|
|
108
108
|
Returns:
|
|
109
109
|
|
|
110
|
-
|type|description|
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
| type | description |
|
|
111
|
+
| ------ | ------------------------------------------------------------------------------ |
|
|
112
|
+
| `Bool` | The first operand if it is `true` or the value of the second operand otherwise |
|
|
113
113
|
|
|
114
114
|
### Pervasives.**(==)**
|
|
115
115
|
|
|
@@ -127,16 +127,16 @@ so it also works for comparing things like tuples and lists.
|
|
|
127
127
|
|
|
128
128
|
Parameters:
|
|
129
129
|
|
|
130
|
-
|param|type|description|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
| param | type | description |
|
|
131
|
+
| -------- | ---- | ------------------ |
|
|
132
|
+
| `value1` | `a` | The first operand |
|
|
133
|
+
| `value2` | `a` | The second operand |
|
|
134
134
|
|
|
135
135
|
Returns:
|
|
136
136
|
|
|
137
|
-
|type|description|
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
| type | description |
|
|
138
|
+
| ------ | ---------------------------------------------------------------- |
|
|
139
|
+
| `Bool` | `true` if the values are structurally equal or `false` otherwise |
|
|
140
140
|
|
|
141
141
|
### Pervasives.**(!=)**
|
|
142
142
|
|
|
@@ -154,16 +154,16 @@ so it also works for comparing things like tuples and lists.
|
|
|
154
154
|
|
|
155
155
|
Parameters:
|
|
156
156
|
|
|
157
|
-
|param|type|description|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
| param | type | description |
|
|
158
|
+
| -------- | ---- | ------------------ |
|
|
159
|
+
| `value1` | `a` | The first operand |
|
|
160
|
+
| `value2` | `a` | The second operand |
|
|
161
161
|
|
|
162
162
|
Returns:
|
|
163
163
|
|
|
164
|
-
|type|description|
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
| type | description |
|
|
165
|
+
| ------ | ---------------------------------------------------------------- |
|
|
166
|
+
| `Bool` | `false` if the values are structurally equal or `true` otherwise |
|
|
167
167
|
|
|
168
168
|
### Pervasives.**is**
|
|
169
169
|
|
|
@@ -181,16 +181,16 @@ Use this operator if you don’t need or want structural equality.
|
|
|
181
181
|
|
|
182
182
|
Parameters:
|
|
183
183
|
|
|
184
|
-
|param|type|description|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
| param | type | description |
|
|
185
|
+
| ------- | ---- | ------------------ |
|
|
186
|
+
| `left` | `a` | The first operand |
|
|
187
|
+
| `right` | `a` | The second operand |
|
|
188
188
|
|
|
189
189
|
Returns:
|
|
190
190
|
|
|
191
|
-
|type|description|
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
| type | description |
|
|
192
|
+
| ------ | -------------------------------------------------------------- |
|
|
193
|
+
| `Bool` | `true` if the values are physically equal or `false` otherwise |
|
|
194
194
|
|
|
195
195
|
### Pervasives.**isnt**
|
|
196
196
|
|
|
@@ -208,16 +208,16 @@ Use this operator if you don’t need or want structural equality.
|
|
|
208
208
|
|
|
209
209
|
Parameters:
|
|
210
210
|
|
|
211
|
-
|param|type|description|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
| param | type | description |
|
|
212
|
+
| -------- | ---- | ------------------ |
|
|
213
|
+
| `value1` | `a` | The first operand |
|
|
214
|
+
| `value2` | `a` | The second operand |
|
|
215
215
|
|
|
216
216
|
Returns:
|
|
217
217
|
|
|
218
|
-
|type|description|
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
| type | description |
|
|
219
|
+
| ------ | -------------------------------------------------------------- |
|
|
220
|
+
| `Bool` | `false` if the values are physically equal or `true` otherwise |
|
|
221
221
|
|
|
222
222
|
### Pervasives.**(<)**
|
|
223
223
|
|
|
@@ -234,16 +234,16 @@ Checks if the first operand is less than the second operand.
|
|
|
234
234
|
|
|
235
235
|
Parameters:
|
|
236
236
|
|
|
237
|
-
|param|type|description|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
| param | type | description |
|
|
238
|
+
| ------ | -------- | ------------------ |
|
|
239
|
+
| `num1` | `Number` | The first operand |
|
|
240
|
+
| `num2` | `Number` | The second operand |
|
|
241
241
|
|
|
242
242
|
Returns:
|
|
243
243
|
|
|
244
|
-
|type|description|
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
| type | description |
|
|
245
|
+
| ------ | -------------------------------------------------------------------------------- |
|
|
246
|
+
| `Bool` | `true` if the first operand is less than the second operand or `false` otherwise |
|
|
247
247
|
|
|
248
248
|
### Pervasives.**(>)**
|
|
249
249
|
|
|
@@ -260,16 +260,16 @@ Checks if the first operand is greater than the second operand.
|
|
|
260
260
|
|
|
261
261
|
Parameters:
|
|
262
262
|
|
|
263
|
-
|param|type|description|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
263
|
+
| param | type | description |
|
|
264
|
+
| ------ | -------- | ------------------ |
|
|
265
|
+
| `num1` | `Number` | The first operand |
|
|
266
|
+
| `num2` | `Number` | The second operand |
|
|
267
267
|
|
|
268
268
|
Returns:
|
|
269
269
|
|
|
270
|
-
|type|description|
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
| type | description |
|
|
271
|
+
| ------ | ----------------------------------------------------------------------------------- |
|
|
272
|
+
| `Bool` | `true` if the first operand is greater than the second operand or `false` otherwise |
|
|
273
273
|
|
|
274
274
|
### Pervasives.**(<=)**
|
|
275
275
|
|
|
@@ -286,16 +286,16 @@ Checks if the first operand is less than or equal to the second operand.
|
|
|
286
286
|
|
|
287
287
|
Parameters:
|
|
288
288
|
|
|
289
|
-
|param|type|description|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
| param | type | description |
|
|
290
|
+
| ------ | -------- | ------------------ |
|
|
291
|
+
| `num1` | `Number` | The first operand |
|
|
292
|
+
| `num2` | `Number` | The second operand |
|
|
293
293
|
|
|
294
294
|
Returns:
|
|
295
295
|
|
|
296
|
-
|type|description|
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
| type | description |
|
|
297
|
+
| ------ | -------------------------------------------------------------------------------------------- |
|
|
298
|
+
| `Bool` | `true` if the first operand is less than or equal to the second operand or `false` otherwise |
|
|
299
299
|
|
|
300
300
|
### Pervasives.**(>=)**
|
|
301
301
|
|
|
@@ -312,16 +312,16 @@ Checks if the first operand is greater than or equal to the second operand.
|
|
|
312
312
|
|
|
313
313
|
Parameters:
|
|
314
314
|
|
|
315
|
-
|param|type|description|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
315
|
+
| param | type | description |
|
|
316
|
+
| ------ | -------- | ------------------ |
|
|
317
|
+
| `num1` | `Number` | The first operand |
|
|
318
|
+
| `num2` | `Number` | The second operand |
|
|
319
319
|
|
|
320
320
|
Returns:
|
|
321
321
|
|
|
322
|
-
|type|description|
|
|
323
|
-
|
|
324
|
-
|
|
322
|
+
| type | description |
|
|
323
|
+
| ------ | ----------------------------------------------------------------------------------------------- |
|
|
324
|
+
| `Bool` | `true` if the first operand is greater than or equal to the second operand or `false` otherwise |
|
|
325
325
|
|
|
326
326
|
### Pervasives.**compare**
|
|
327
327
|
|
|
@@ -340,16 +340,16 @@ Provides a consistent ordering over all types and is suitable for sorting and ot
|
|
|
340
340
|
|
|
341
341
|
Parameters:
|
|
342
342
|
|
|
343
|
-
|param|type|description|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
| param | type | description |
|
|
344
|
+
| ------ | ---- | ------------------ |
|
|
345
|
+
| `num1` | `a` | The first operand |
|
|
346
|
+
| `num2` | `a` | The second operand |
|
|
347
347
|
|
|
348
348
|
Returns:
|
|
349
349
|
|
|
350
|
-
|type|description|
|
|
351
|
-
|
|
352
|
-
|
|
350
|
+
| type | description |
|
|
351
|
+
| -------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
352
|
+
| `Number` | A negative integer if the first operand is less than the second operand, `0` if they are equal, or a positive integer otherwise |
|
|
353
353
|
|
|
354
354
|
### Pervasives.**(+)**
|
|
355
355
|
|
|
@@ -366,16 +366,16 @@ Computes the sum of its operands.
|
|
|
366
366
|
|
|
367
367
|
Parameters:
|
|
368
368
|
|
|
369
|
-
|param|type|description|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
369
|
+
| param | type | description |
|
|
370
|
+
| ------ | -------- | ------------------ |
|
|
371
|
+
| `num1` | `Number` | The first operand |
|
|
372
|
+
| `num2` | `Number` | The second operand |
|
|
373
373
|
|
|
374
374
|
Returns:
|
|
375
375
|
|
|
376
|
-
|type|description|
|
|
377
|
-
|
|
378
|
-
|
|
376
|
+
| type | description |
|
|
377
|
+
| -------- | --------------------------- |
|
|
378
|
+
| `Number` | The sum of the two operands |
|
|
379
379
|
|
|
380
380
|
### Pervasives.**(-)**
|
|
381
381
|
|
|
@@ -392,16 +392,16 @@ Computes the difference of its operands.
|
|
|
392
392
|
|
|
393
393
|
Parameters:
|
|
394
394
|
|
|
395
|
-
|param|type|description|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
395
|
+
| param | type | description |
|
|
396
|
+
| ------ | -------- | ------------------ |
|
|
397
|
+
| `num1` | `Number` | The first operand |
|
|
398
|
+
| `num2` | `Number` | The second operand |
|
|
399
399
|
|
|
400
400
|
Returns:
|
|
401
401
|
|
|
402
|
-
|type|description|
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
| type | description |
|
|
403
|
+
| -------- | ---------------------------------- |
|
|
404
|
+
| `Number` | The difference of the two operands |
|
|
405
405
|
|
|
406
406
|
### Pervasives.**(*)**
|
|
407
407
|
|
|
@@ -418,16 +418,16 @@ Computes the product of its operands.
|
|
|
418
418
|
|
|
419
419
|
Parameters:
|
|
420
420
|
|
|
421
|
-
|param|type|description|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
421
|
+
| param | type | description |
|
|
422
|
+
| ------ | -------- | ------------------ |
|
|
423
|
+
| `num1` | `Number` | The first operand |
|
|
424
|
+
| `num2` | `Number` | The second operand |
|
|
425
425
|
|
|
426
426
|
Returns:
|
|
427
427
|
|
|
428
|
-
|type|description|
|
|
429
|
-
|
|
430
|
-
|
|
428
|
+
| type | description |
|
|
429
|
+
| -------- | ------------------------------- |
|
|
430
|
+
| `Number` | The product of the two operands |
|
|
431
431
|
|
|
432
432
|
### Pervasives.**(/)**
|
|
433
433
|
|
|
@@ -444,16 +444,16 @@ Computes the quotient of its operands.
|
|
|
444
444
|
|
|
445
445
|
Parameters:
|
|
446
446
|
|
|
447
|
-
|param|type|description|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
447
|
+
| param | type | description |
|
|
448
|
+
| ------ | -------- | ------------------ |
|
|
449
|
+
| `num1` | `Number` | The first operand |
|
|
450
|
+
| `num2` | `Number` | The second operand |
|
|
451
451
|
|
|
452
452
|
Returns:
|
|
453
453
|
|
|
454
|
-
|type|description|
|
|
455
|
-
|
|
456
|
-
|
|
454
|
+
| type | description |
|
|
455
|
+
| -------- | -------------------------------- |
|
|
456
|
+
| `Number` | The quotient of the two operands |
|
|
457
457
|
|
|
458
458
|
### Pervasives.**(%)**
|
|
459
459
|
|
|
@@ -471,16 +471,16 @@ The result will have the sign of the second operand.
|
|
|
471
471
|
|
|
472
472
|
Parameters:
|
|
473
473
|
|
|
474
|
-
|param|type|description|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
474
|
+
| param | type | description |
|
|
475
|
+
| ------ | -------- | ------------------ |
|
|
476
|
+
| `num1` | `Number` | The first operand |
|
|
477
|
+
| `num2` | `Number` | The second operand |
|
|
478
478
|
|
|
479
479
|
Returns:
|
|
480
480
|
|
|
481
|
-
|type|description|
|
|
482
|
-
|
|
483
|
-
|
|
481
|
+
| type | description |
|
|
482
|
+
| -------- | --------------------------- |
|
|
483
|
+
| `Number` | The modulus of its operands |
|
|
484
484
|
|
|
485
485
|
### Pervasives.**(\*\*)**
|
|
486
486
|
|
|
@@ -504,16 +504,16 @@ Computes the exponentiation of the given base and power.
|
|
|
504
504
|
|
|
505
505
|
Parameters:
|
|
506
506
|
|
|
507
|
-
|param|type|description|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
507
|
+
| param | type | description |
|
|
508
|
+
| ------- | -------- | ------------------- |
|
|
509
|
+
| `base` | `Number` | The base number |
|
|
510
|
+
| `power` | `Number` | The exponent number |
|
|
511
511
|
|
|
512
512
|
Returns:
|
|
513
513
|
|
|
514
|
-
|type|description|
|
|
515
|
-
|
|
516
|
-
|
|
514
|
+
| type | description |
|
|
515
|
+
| -------- | ---------------------------------- |
|
|
516
|
+
| `Number` | The base raised to the given power |
|
|
517
517
|
|
|
518
518
|
### Pervasives.**incr**
|
|
519
519
|
|
|
@@ -530,15 +530,15 @@ Increments the value by one.
|
|
|
530
530
|
|
|
531
531
|
Parameters:
|
|
532
532
|
|
|
533
|
-
|param|type|description|
|
|
534
|
-
|
|
535
|
-
|
|
533
|
+
| param | type | description |
|
|
534
|
+
| ------- | -------- | ---------------------- |
|
|
535
|
+
| `value` | `Number` | The value to increment |
|
|
536
536
|
|
|
537
537
|
Returns:
|
|
538
538
|
|
|
539
|
-
|type|description|
|
|
540
|
-
|
|
541
|
-
|
|
539
|
+
| type | description |
|
|
540
|
+
| -------- | --------------------- |
|
|
541
|
+
| `Number` | The incremented value |
|
|
542
542
|
|
|
543
543
|
### Pervasives.**decr**
|
|
544
544
|
|
|
@@ -555,15 +555,15 @@ Decrements the value by one.
|
|
|
555
555
|
|
|
556
556
|
Parameters:
|
|
557
557
|
|
|
558
|
-
|param|type|description|
|
|
559
|
-
|
|
560
|
-
|
|
558
|
+
| param | type | description |
|
|
559
|
+
| ------- | -------- | ---------------------- |
|
|
560
|
+
| `value` | `Number` | The value to decrement |
|
|
561
561
|
|
|
562
562
|
Returns:
|
|
563
563
|
|
|
564
|
-
|type|description|
|
|
565
|
-
|
|
566
|
-
|
|
564
|
+
| type | description |
|
|
565
|
+
| -------- | --------------------- |
|
|
566
|
+
| `Number` | The decremented value |
|
|
567
567
|
|
|
568
568
|
### Pervasives.**(++)**
|
|
569
569
|
|
|
@@ -580,16 +580,16 @@ Concatenate two strings.
|
|
|
580
580
|
|
|
581
581
|
Parameters:
|
|
582
582
|
|
|
583
|
-
|param|type|description|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
583
|
+
| param | type | description |
|
|
584
|
+
| ------ | -------- | -------------------- |
|
|
585
|
+
| `str1` | `String` | The beginning string |
|
|
586
|
+
| `str2` | `String` | The ending string |
|
|
587
587
|
|
|
588
588
|
Returns:
|
|
589
589
|
|
|
590
|
-
|type|description|
|
|
591
|
-
|
|
592
|
-
|
|
590
|
+
| type | description |
|
|
591
|
+
| -------- | ------------------- |
|
|
592
|
+
| `String` | The combined string |
|
|
593
593
|
|
|
594
594
|
Examples:
|
|
595
595
|
|
|
@@ -612,15 +612,15 @@ Computes the bitwise NOT of the operand.
|
|
|
612
612
|
|
|
613
613
|
Parameters:
|
|
614
614
|
|
|
615
|
-
|param|type|description|
|
|
616
|
-
|
|
617
|
-
|
|
615
|
+
| param | type | description |
|
|
616
|
+
| ------- | -------- | ----------- |
|
|
617
|
+
| `value` | `Number` | The operand |
|
|
618
618
|
|
|
619
619
|
Returns:
|
|
620
620
|
|
|
621
|
-
|type|description|
|
|
622
|
-
|
|
623
|
-
|
|
621
|
+
| type | description |
|
|
622
|
+
| -------- | ------------------------------------------- |
|
|
623
|
+
| `Number` | Containing the inverted bits of the operand |
|
|
624
624
|
|
|
625
625
|
### Pervasives.**(&)**
|
|
626
626
|
|
|
@@ -645,16 +645,16 @@ Computes the bitwise AND (`&`) on the given operands.
|
|
|
645
645
|
|
|
646
646
|
Parameters:
|
|
647
647
|
|
|
648
|
-
|param|type|description|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
648
|
+
| param | type | description |
|
|
649
|
+
| -------- | -------- | ------------------ |
|
|
650
|
+
| `value1` | `Number` | The first operand |
|
|
651
|
+
| `value2` | `Number` | The second operand |
|
|
652
652
|
|
|
653
653
|
Returns:
|
|
654
654
|
|
|
655
|
-
|type|description|
|
|
656
|
-
|
|
657
|
-
|
|
655
|
+
| type | description |
|
|
656
|
+
| -------- | ----------------------------------------------------------------------------------------------- |
|
|
657
|
+
| `Number` | Containing a `1` in each bit position for which the corresponding bits of both operands are `1` |
|
|
658
658
|
|
|
659
659
|
### Pervasives.**(|)**
|
|
660
660
|
|
|
@@ -679,16 +679,16 @@ Computes the bitwise OR (`|`) on the given operands.
|
|
|
679
679
|
|
|
680
680
|
Parameters:
|
|
681
681
|
|
|
682
|
-
|param|type|description|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
682
|
+
| param | type | description |
|
|
683
|
+
| -------- | -------- | ------------------ |
|
|
684
|
+
| `value1` | `Number` | The first operand |
|
|
685
|
+
| `value2` | `Number` | The second operand |
|
|
686
686
|
|
|
687
687
|
Returns:
|
|
688
688
|
|
|
689
|
-
|type|description|
|
|
690
|
-
|
|
691
|
-
|
|
689
|
+
| type | description |
|
|
690
|
+
| -------- | --------------------------------------------------------------------------------------------------------- |
|
|
691
|
+
| `Number` | Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1` |
|
|
692
692
|
|
|
693
693
|
### Pervasives.**(^)**
|
|
694
694
|
|
|
@@ -714,16 +714,16 @@ Computes the bitwise XOR (`^`) on the given operands.
|
|
|
714
714
|
|
|
715
715
|
Parameters:
|
|
716
716
|
|
|
717
|
-
|param|type|description|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
717
|
+
| param | type | description |
|
|
718
|
+
| -------- | -------- | ------------------ |
|
|
719
|
+
| `value1` | `Number` | The first operand |
|
|
720
|
+
| `value2` | `Number` | The second operand |
|
|
721
721
|
|
|
722
722
|
Returns:
|
|
723
723
|
|
|
724
|
-
|type|description|
|
|
725
|
-
|
|
726
|
-
|
|
724
|
+
| type | description |
|
|
725
|
+
| -------- | -------------------------------------------------------------------------------------------------------------- |
|
|
726
|
+
| `Number` | Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1` |
|
|
727
727
|
|
|
728
728
|
### Pervasives.**(<<)**
|
|
729
729
|
|
|
@@ -748,16 +748,16 @@ Shifts the bits of the value left by the given number of bits.
|
|
|
748
748
|
|
|
749
749
|
Parameters:
|
|
750
750
|
|
|
751
|
-
|param|type|description|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
751
|
+
| param | type | description |
|
|
752
|
+
| -------- | -------- | ------------------------------ |
|
|
753
|
+
| `value` | `Number` | The value to shift |
|
|
754
|
+
| `amount` | `Number` | The number of bits to shift by |
|
|
755
755
|
|
|
756
756
|
Returns:
|
|
757
757
|
|
|
758
|
-
|type|description|
|
|
759
|
-
|
|
760
|
-
|
|
758
|
+
| type | description |
|
|
759
|
+
| -------- | ----------------- |
|
|
760
|
+
| `Number` | The shifted value |
|
|
761
761
|
|
|
762
762
|
### Pervasives.**(>>>)**
|
|
763
763
|
|
|
@@ -782,16 +782,16 @@ Shifts the bits of the value right by the given number of bits, preserving the s
|
|
|
782
782
|
|
|
783
783
|
Parameters:
|
|
784
784
|
|
|
785
|
-
|param|type|description|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
785
|
+
| param | type | description |
|
|
786
|
+
| -------- | -------- | ---------------------- |
|
|
787
|
+
| `value` | `Number` | The value to shift |
|
|
788
|
+
| `amount` | `Number` | The amount to shift by |
|
|
789
789
|
|
|
790
790
|
Returns:
|
|
791
791
|
|
|
792
|
-
|type|description|
|
|
793
|
-
|
|
794
|
-
|
|
792
|
+
| type | description |
|
|
793
|
+
| -------- | ----------------- |
|
|
794
|
+
| `Number` | The shifted value |
|
|
795
795
|
|
|
796
796
|
### Pervasives.**(>>)**
|
|
797
797
|
|
|
@@ -816,16 +816,16 @@ Shifts the bits of the value right by the given number of bits.
|
|
|
816
816
|
|
|
817
817
|
Parameters:
|
|
818
818
|
|
|
819
|
-
|param|type|description|
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
819
|
+
| param | type | description |
|
|
820
|
+
| -------- | -------- | ---------------------- |
|
|
821
|
+
| `value` | `Number` | The value to shift |
|
|
822
|
+
| `amount` | `Number` | The amount to shift by |
|
|
823
823
|
|
|
824
824
|
Returns:
|
|
825
825
|
|
|
826
|
-
|type|description|
|
|
827
|
-
|
|
828
|
-
|
|
826
|
+
| type | description |
|
|
827
|
+
| -------- | ----------------- |
|
|
828
|
+
| `Number` | The shifted value |
|
|
829
829
|
|
|
830
830
|
### Pervasives.**toString**
|
|
831
831
|
|
|
@@ -843,15 +843,15 @@ Provides a better representation of data types if those types are provided from
|
|
|
843
843
|
|
|
844
844
|
Parameters:
|
|
845
845
|
|
|
846
|
-
|param|type|description|
|
|
847
|
-
|
|
848
|
-
|
|
846
|
+
| param | type | description |
|
|
847
|
+
| ------- | ---- | ----------- |
|
|
848
|
+
| `value` | `a` | The operand |
|
|
849
849
|
|
|
850
850
|
Returns:
|
|
851
851
|
|
|
852
|
-
|type|description|
|
|
853
|
-
|
|
854
|
-
|
|
852
|
+
| type | description |
|
|
853
|
+
| -------- | ------------------------ |
|
|
854
|
+
| `String` | The operand, as a string |
|
|
855
855
|
|
|
856
856
|
### Pervasives.**print**
|
|
857
857
|
|
|
@@ -877,10 +877,10 @@ are provided from the module.
|
|
|
877
877
|
|
|
878
878
|
Parameters:
|
|
879
879
|
|
|
880
|
-
|param|type|description|
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
880
|
+
| param | type | description |
|
|
881
|
+
| --------- | -------- | -------------------------------------- |
|
|
882
|
+
| `value` | `a` | The operand |
|
|
883
|
+
| `?suffix` | `String` | The string to print after the argument |
|
|
884
884
|
|
|
885
885
|
### Pervasives.**ignore**
|
|
886
886
|
|
|
@@ -897,9 +897,9 @@ Accepts any value and always returns `void`.
|
|
|
897
897
|
|
|
898
898
|
Parameters:
|
|
899
899
|
|
|
900
|
-
|param|type|description|
|
|
901
|
-
|
|
902
|
-
|
|
900
|
+
| param | type | description |
|
|
901
|
+
| ------- | ---- | ------------------- |
|
|
902
|
+
| `value` | `a` | The value to ignore |
|
|
903
903
|
|
|
904
904
|
### Pervasives.**assert**
|
|
905
905
|
|
|
@@ -916,9 +916,9 @@ Assert that the given Boolean condition is `true`.
|
|
|
916
916
|
|
|
917
917
|
Parameters:
|
|
918
918
|
|
|
919
|
-
|param|type|description|
|
|
920
|
-
|
|
921
|
-
|
|
919
|
+
| param | type | description |
|
|
920
|
+
| ----------- | ------ | ----------------------- |
|
|
921
|
+
| `condition` | `Bool` | The condition to assert |
|
|
922
922
|
|
|
923
923
|
Throws:
|
|
924
924
|
|
|
@@ -951,15 +951,15 @@ Throw an exception. Currently, exceptions cannot be caught and will crash your p
|
|
|
951
951
|
|
|
952
952
|
Parameters:
|
|
953
953
|
|
|
954
|
-
|param|type|description|
|
|
955
|
-
|
|
956
|
-
|
|
954
|
+
| param | type | description |
|
|
955
|
+
| ----- | ----------- | -------------------------- |
|
|
956
|
+
| `exn` | `Exception` | The exception to be thrown |
|
|
957
957
|
|
|
958
958
|
Returns:
|
|
959
959
|
|
|
960
|
-
|type|description|
|
|
961
|
-
|
|
962
|
-
|
|
960
|
+
| type | description |
|
|
961
|
+
| ---- | --------------------------------------------------------------- |
|
|
962
|
+
| `a` | Anything and nothing—your program won't continue past a throw |
|
|
963
963
|
|
|
964
964
|
### Pervasives.**fail**
|
|
965
965
|
|
|
@@ -972,15 +972,15 @@ Currently, Exceptions cannot be caught and will crash your program.
|
|
|
972
972
|
|
|
973
973
|
Parameters:
|
|
974
974
|
|
|
975
|
-
|param|type|description|
|
|
976
|
-
|
|
977
|
-
|
|
975
|
+
| param | type | description |
|
|
976
|
+
| --------- | -------- | -------------------------- |
|
|
977
|
+
| `message` | `String` | The reason for the failure |
|
|
978
978
|
|
|
979
979
|
Returns:
|
|
980
980
|
|
|
981
|
-
|type|description|
|
|
982
|
-
|
|
983
|
-
|
|
981
|
+
| type | description |
|
|
982
|
+
| ---- | ------------------------------------------------------------------------- |
|
|
983
|
+
| `a` | Anything and nothing—your program won't continue past a fail expression |
|
|
984
984
|
|
|
985
985
|
### Pervasives.**identity**
|
|
986
986
|
|
|
@@ -997,15 +997,15 @@ Provides the operand untouched.
|
|
|
997
997
|
|
|
998
998
|
Parameters:
|
|
999
999
|
|
|
1000
|
-
|param|type|description|
|
|
1001
|
-
|
|
1002
|
-
|
|
1000
|
+
| param | type | description |
|
|
1001
|
+
| ------- | ---- | ------------------- |
|
|
1002
|
+
| `value` | `a` | The value to return |
|
|
1003
1003
|
|
|
1004
1004
|
Returns:
|
|
1005
1005
|
|
|
1006
|
-
|type|description|
|
|
1007
|
-
|
|
1008
|
-
|
|
1006
|
+
| type | description |
|
|
1007
|
+
| ---- | ------------------- |
|
|
1008
|
+
| `a` | The value untouched |
|
|
1009
1009
|
|
|
1010
1010
|
### Pervasives.**box**
|
|
1011
1011
|
|
|
@@ -1024,15 +1024,15 @@ Generally, `let mut` expressions are preferable to using a Box.
|
|
|
1024
1024
|
|
|
1025
1025
|
Parameters:
|
|
1026
1026
|
|
|
1027
|
-
|param|type|description|
|
|
1028
|
-
|
|
1029
|
-
|
|
1027
|
+
| param | type | description |
|
|
1028
|
+
| ------- | ---- | -------------------------------- |
|
|
1029
|
+
| `value` | `a` | The initial value inside the box |
|
|
1030
1030
|
|
|
1031
1031
|
Returns:
|
|
1032
1032
|
|
|
1033
|
-
|type|description|
|
|
1034
|
-
|
|
1035
|
-
|
|
1033
|
+
| type | description |
|
|
1034
|
+
| -------- | ------------------------------------ |
|
|
1035
|
+
| `Box<a>` | The box containing the initial value |
|
|
1036
1036
|
|
|
1037
1037
|
### Pervasives.**unbox**
|
|
1038
1038
|
|
|
@@ -1049,13 +1049,13 @@ Retrieves the current value from a box.
|
|
|
1049
1049
|
|
|
1050
1050
|
Parameters:
|
|
1051
1051
|
|
|
1052
|
-
|param|type|description|
|
|
1053
|
-
|
|
1054
|
-
|
|
1052
|
+
| param | type | description |
|
|
1053
|
+
| ------- | -------- | ----------------- |
|
|
1054
|
+
| `value` | `Box<a>` | The box to unwrap |
|
|
1055
1055
|
|
|
1056
1056
|
Returns:
|
|
1057
1057
|
|
|
1058
|
-
|type|description|
|
|
1059
|
-
|
|
1060
|
-
|
|
1058
|
+
| type | description |
|
|
1059
|
+
| ---- | ------------------------ |
|
|
1060
|
+
| `a` | The value inside the box |
|
|
1061
1061
|
|