@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.
Files changed (60) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/array.md +491 -491
  3. package/bigint.md +198 -198
  4. package/buffer.gr +66 -1
  5. package/buffer.md +395 -272
  6. package/bytes.gr +1 -0
  7. package/bytes.md +200 -199
  8. package/char.md +125 -125
  9. package/exception.md +9 -9
  10. package/float32.md +195 -195
  11. package/float64.md +195 -195
  12. package/fs.md +115 -115
  13. package/hash.md +16 -16
  14. package/int16.md +155 -155
  15. package/int32.gr +1 -1
  16. package/int32.md +207 -207
  17. package/int64.gr +1 -1
  18. package/int64.md +207 -207
  19. package/int8.md +155 -155
  20. package/json.md +59 -59
  21. package/list.md +347 -347
  22. package/map.md +222 -222
  23. package/marshal.md +12 -12
  24. package/number.gr +119 -5
  25. package/number.md +503 -261
  26. package/option.md +141 -141
  27. package/package.json +1 -1
  28. package/path.md +90 -90
  29. package/pervasives.md +238 -238
  30. package/priorityqueue.md +112 -112
  31. package/queue.md +117 -117
  32. package/random.md +37 -37
  33. package/range.md +36 -36
  34. package/rational.md +107 -107
  35. package/regex.md +91 -91
  36. package/result.md +102 -102
  37. package/runtime/atof/decimal.md +6 -6
  38. package/runtime/compare.md +7 -7
  39. package/runtime/dataStructures.md +178 -178
  40. package/runtime/equal.md +7 -7
  41. package/runtime/exception.md +15 -15
  42. package/runtime/malloc.md +9 -9
  43. package/runtime/numbers.md +269 -269
  44. package/runtime/string.md +17 -17
  45. package/runtime/unsafe/conv.md +6 -6
  46. package/runtime/unsafe/memory.md +10 -10
  47. package/runtime/utf8.md +31 -31
  48. package/runtime/wasi.md +9 -9
  49. package/set.md +211 -211
  50. package/stack.md +122 -122
  51. package/string.md +228 -228
  52. package/uint16.md +148 -148
  53. package/uint32.md +192 -192
  54. package/uint64.md +192 -192
  55. package/uint8.md +148 -148
  56. package/uri.md +77 -77
  57. package/wasi/file.md +269 -269
  58. package/wasi/process.md +21 -21
  59. package/wasi/random.md +9 -9
  60. package/wasi/time.md +12 -12
package/int16.md CHANGED
@@ -40,15 +40,15 @@ Converts a Number to an Int16.
40
40
 
41
41
  Parameters:
42
42
 
43
- |param|type|description|
44
- |-----|----|-----------|
45
- |`number`|`Number`|The value to convert|
43
+ | param | type | description |
44
+ | -------- | -------- | -------------------- |
45
+ | `number` | `Number` | The value to convert |
46
46
 
47
47
  Returns:
48
48
 
49
- |type|description|
50
- |----|-----------|
51
- |`Int16`|The Number represented as an Int16|
49
+ | type | description |
50
+ | ------- | ---------------------------------- |
51
+ | `Int16` | The Number represented as an Int16 |
52
52
 
53
53
  ### Int16.**toNumber**
54
54
 
@@ -65,15 +65,15 @@ Converts an Int16 to a Number.
65
65
 
66
66
  Parameters:
67
67
 
68
- |param|type|description|
69
- |-----|----|-----------|
70
- |`value`|`Int16`|The value to convert|
68
+ | param | type | description |
69
+ | ------- | ------- | -------------------- |
70
+ | `value` | `Int16` | The value to convert |
71
71
 
72
72
  Returns:
73
73
 
74
- |type|description|
75
- |----|-----------|
76
- |`Number`|The Int16 represented as a Number|
74
+ | type | description |
75
+ | -------- | --------------------------------- |
76
+ | `Number` | The Int16 represented as a Number |
77
77
 
78
78
  ### Int16.**fromUint16**
79
79
 
@@ -90,15 +90,15 @@ Converts a Uint16 to an Int16.
90
90
 
91
91
  Parameters:
92
92
 
93
- |param|type|description|
94
- |-----|----|-----------|
95
- |`number`|`Uint16`|The value to convert|
93
+ | param | type | description |
94
+ | -------- | -------- | -------------------- |
95
+ | `number` | `Uint16` | The value to convert |
96
96
 
97
97
  Returns:
98
98
 
99
- |type|description|
100
- |----|-----------|
101
- |`Int16`|The Uint16 represented as an Int16|
99
+ | type | description |
100
+ | ------- | ---------------------------------- |
101
+ | `Int16` | The Uint16 represented as an Int16 |
102
102
 
103
103
  Examples:
104
104
 
@@ -121,15 +121,15 @@ Increments the value by one.
121
121
 
122
122
  Parameters:
123
123
 
124
- |param|type|description|
125
- |-----|----|-----------|
126
- |`value`|`Int16`|The value to increment|
124
+ | param | type | description |
125
+ | ------- | ------- | ---------------------- |
126
+ | `value` | `Int16` | The value to increment |
127
127
 
128
128
  Returns:
129
129
 
130
- |type|description|
131
- |----|-----------|
132
- |`Int16`|The incremented value|
130
+ | type | description |
131
+ | ------- | --------------------- |
132
+ | `Int16` | The incremented value |
133
133
 
134
134
  Examples:
135
135
 
@@ -156,15 +156,15 @@ Decrements the value by one.
156
156
 
157
157
  Parameters:
158
158
 
159
- |param|type|description|
160
- |-----|----|-----------|
161
- |`value`|`Int16`|The value to decrement|
159
+ | param | type | description |
160
+ | ------- | ------- | ---------------------- |
161
+ | `value` | `Int16` | The value to decrement |
162
162
 
163
163
  Returns:
164
164
 
165
- |type|description|
166
- |----|-----------|
167
- |`Int16`|The decremented value|
165
+ | type | description |
166
+ | ------- | --------------------- |
167
+ | `Int16` | The decremented value |
168
168
 
169
169
  Examples:
170
170
 
@@ -191,16 +191,16 @@ Computes the sum of its operands.
191
191
 
192
192
  Parameters:
193
193
 
194
- |param|type|description|
195
- |-----|----|-----------|
196
- |`x`|`Int16`|The first operand|
197
- |`y`|`Int16`|The second operand|
194
+ | param | type | description |
195
+ | ----- | ------- | ------------------ |
196
+ | `x` | `Int16` | The first operand |
197
+ | `y` | `Int16` | The second operand |
198
198
 
199
199
  Returns:
200
200
 
201
- |type|description|
202
- |----|-----------|
203
- |`Int16`|The sum of the two operands|
201
+ | type | description |
202
+ | ------- | --------------------------- |
203
+ | `Int16` | The sum of the two operands |
204
204
 
205
205
  Examples:
206
206
 
@@ -224,16 +224,16 @@ Computes the difference of its operands.
224
224
 
225
225
  Parameters:
226
226
 
227
- |param|type|description|
228
- |-----|----|-----------|
229
- |`x`|`Int16`|The first operand|
230
- |`y`|`Int16`|The second operand|
227
+ | param | type | description |
228
+ | ----- | ------- | ------------------ |
229
+ | `x` | `Int16` | The first operand |
230
+ | `y` | `Int16` | The second operand |
231
231
 
232
232
  Returns:
233
233
 
234
- |type|description|
235
- |----|-----------|
236
- |`Int16`|The difference of the two operands|
234
+ | type | description |
235
+ | ------- | ---------------------------------- |
236
+ | `Int16` | The difference of the two operands |
237
237
 
238
238
  Examples:
239
239
 
@@ -257,16 +257,16 @@ Computes the product of its operands.
257
257
 
258
258
  Parameters:
259
259
 
260
- |param|type|description|
261
- |-----|----|-----------|
262
- |`x`|`Int16`|The first operand|
263
- |`y`|`Int16`|The second operand|
260
+ | param | type | description |
261
+ | ----- | ------- | ------------------ |
262
+ | `x` | `Int16` | The first operand |
263
+ | `y` | `Int16` | The second operand |
264
264
 
265
265
  Returns:
266
266
 
267
- |type|description|
268
- |----|-----------|
269
- |`Int16`|The product of the two operands|
267
+ | type | description |
268
+ | ------- | ------------------------------- |
269
+ | `Int16` | The product of the two operands |
270
270
 
271
271
  Examples:
272
272
 
@@ -290,16 +290,16 @@ Computes the quotient of its operands using signed division.
290
290
 
291
291
  Parameters:
292
292
 
293
- |param|type|description|
294
- |-----|----|-----------|
295
- |`x`|`Int16`|The first operand|
296
- |`y`|`Int16`|The second operand|
293
+ | param | type | description |
294
+ | ----- | ------- | ------------------ |
295
+ | `x` | `Int16` | The first operand |
296
+ | `y` | `Int16` | The second operand |
297
297
 
298
298
  Returns:
299
299
 
300
- |type|description|
301
- |----|-----------|
302
- |`Int16`|The quotient of its operands|
300
+ | type | description |
301
+ | ------- | ---------------------------- |
302
+ | `Int16` | The quotient of its operands |
303
303
 
304
304
  Examples:
305
305
 
@@ -323,16 +323,16 @@ Computes the remainder of the division of its operands using signed division.
323
323
 
324
324
  Parameters:
325
325
 
326
- |param|type|description|
327
- |-----|----|-----------|
328
- |`x`|`Int16`|The first operand|
329
- |`y`|`Int16`|The second operand|
326
+ | param | type | description |
327
+ | ----- | ------- | ------------------ |
328
+ | `x` | `Int16` | The first operand |
329
+ | `y` | `Int16` | The second operand |
330
330
 
331
331
  Returns:
332
332
 
333
- |type|description|
334
- |----|-----------|
335
- |`Int16`|The remainder of its operands|
333
+ | type | description |
334
+ | ------- | ----------------------------- |
335
+ | `Int16` | The remainder of its operands |
336
336
 
337
337
  Examples:
338
338
 
@@ -356,16 +356,16 @@ The result will have the sign of the second operand.
356
356
 
357
357
  Parameters:
358
358
 
359
- |param|type|description|
360
- |-----|----|-----------|
361
- |`x`|`Int16`|The first operand|
362
- |`y`|`Int16`|The second operand|
359
+ | param | type | description |
360
+ | ----- | ------- | ------------------ |
361
+ | `x` | `Int16` | The first operand |
362
+ | `y` | `Int16` | The second operand |
363
363
 
364
364
  Returns:
365
365
 
366
- |type|description|
367
- |----|-----------|
368
- |`Int16`|The modulus of its operands|
366
+ | type | description |
367
+ | ------- | --------------------------- |
368
+ | `Int16` | The modulus of its operands |
369
369
 
370
370
  Throws:
371
371
 
@@ -395,16 +395,16 @@ Shifts the bits of the value left by the given number of bits.
395
395
 
396
396
  Parameters:
397
397
 
398
- |param|type|description|
399
- |-----|----|-----------|
400
- |`value`|`Int16`|The value to shift|
401
- |`amount`|`Int16`|The number of bits to shift by|
398
+ | param | type | description |
399
+ | -------- | ------- | ------------------------------ |
400
+ | `value` | `Int16` | The value to shift |
401
+ | `amount` | `Int16` | The number of bits to shift by |
402
402
 
403
403
  Returns:
404
404
 
405
- |type|description|
406
- |----|-----------|
407
- |`Int16`|The shifted value|
405
+ | type | description |
406
+ | ------- | ----------------- |
407
+ | `Int16` | The shifted value |
408
408
 
409
409
  Examples:
410
410
 
@@ -428,16 +428,16 @@ Shifts the bits of the value right by the given number of bits, preserving the s
428
428
 
429
429
  Parameters:
430
430
 
431
- |param|type|description|
432
- |-----|----|-----------|
433
- |`value`|`Int16`|The value to shift|
434
- |`amount`|`Int16`|The amount to shift by|
431
+ | param | type | description |
432
+ | -------- | ------- | ---------------------- |
433
+ | `value` | `Int16` | The value to shift |
434
+ | `amount` | `Int16` | The amount to shift by |
435
435
 
436
436
  Returns:
437
437
 
438
- |type|description|
439
- |----|-----------|
440
- |`Int16`|The shifted value|
438
+ | type | description |
439
+ | ------- | ----------------- |
440
+ | `Int16` | The shifted value |
441
441
 
442
442
  Examples:
443
443
 
@@ -461,16 +461,16 @@ Checks if the first value is equal to the second value.
461
461
 
462
462
  Parameters:
463
463
 
464
- |param|type|description|
465
- |-----|----|-----------|
466
- |`x`|`Int16`|The first value|
467
- |`y`|`Int16`|The second value|
464
+ | param | type | description |
465
+ | ----- | ------- | ---------------- |
466
+ | `x` | `Int16` | The first value |
467
+ | `y` | `Int16` | The second value |
468
468
 
469
469
  Returns:
470
470
 
471
- |type|description|
472
- |----|-----------|
473
- |`Bool`|`true` if the first value is equal to the second value or `false` otherwise|
471
+ | type | description |
472
+ | ------ | --------------------------------------------------------------------------- |
473
+ | `Bool` | `true` if the first value is equal to the second value or `false` otherwise |
474
474
 
475
475
  Examples:
476
476
 
@@ -494,16 +494,16 @@ Checks if the first value is not equal to the second value.
494
494
 
495
495
  Parameters:
496
496
 
497
- |param|type|description|
498
- |-----|----|-----------|
499
- |`x`|`Int16`|The first value|
500
- |`y`|`Int16`|The second value|
497
+ | param | type | description |
498
+ | ----- | ------- | ---------------- |
499
+ | `x` | `Int16` | The first value |
500
+ | `y` | `Int16` | The second value |
501
501
 
502
502
  Returns:
503
503
 
504
- |type|description|
505
- |----|-----------|
506
- |`Bool`|`true` if the first value is not equal to the second value or `false` otherwise|
504
+ | type | description |
505
+ | ------ | ------------------------------------------------------------------------------- |
506
+ | `Bool` | `true` if the first value is not equal to the second value or `false` otherwise |
507
507
 
508
508
  Examples:
509
509
 
@@ -527,16 +527,16 @@ Checks if the first value is less than the second value.
527
527
 
528
528
  Parameters:
529
529
 
530
- |param|type|description|
531
- |-----|----|-----------|
532
- |`x`|`Int16`|The first value|
533
- |`y`|`Int16`|The second value|
530
+ | param | type | description |
531
+ | ----- | ------- | ---------------- |
532
+ | `x` | `Int16` | The first value |
533
+ | `y` | `Int16` | The second value |
534
534
 
535
535
  Returns:
536
536
 
537
- |type|description|
538
- |----|-----------|
539
- |`Bool`|`true` if the first value is less than the second value or `false` otherwise|
537
+ | type | description |
538
+ | ------ | ---------------------------------------------------------------------------- |
539
+ | `Bool` | `true` if the first value is less than the second value or `false` otherwise |
540
540
 
541
541
  Examples:
542
542
 
@@ -560,16 +560,16 @@ Checks if the first value is greater than the second value.
560
560
 
561
561
  Parameters:
562
562
 
563
- |param|type|description|
564
- |-----|----|-----------|
565
- |`x`|`Int16`|The first value|
566
- |`y`|`Int16`|The second value|
563
+ | param | type | description |
564
+ | ----- | ------- | ---------------- |
565
+ | `x` | `Int16` | The first value |
566
+ | `y` | `Int16` | The second value |
567
567
 
568
568
  Returns:
569
569
 
570
- |type|description|
571
- |----|-----------|
572
- |`Bool`|`true` if the first value is greater than the second value or `false` otherwise|
570
+ | type | description |
571
+ | ------ | ------------------------------------------------------------------------------- |
572
+ | `Bool` | `true` if the first value is greater than the second value or `false` otherwise |
573
573
 
574
574
  Examples:
575
575
 
@@ -593,16 +593,16 @@ Checks if the first value is less than or equal to the second value.
593
593
 
594
594
  Parameters:
595
595
 
596
- |param|type|description|
597
- |-----|----|-----------|
598
- |`x`|`Int16`|The first value|
599
- |`y`|`Int16`|The second value|
596
+ | param | type | description |
597
+ | ----- | ------- | ---------------- |
598
+ | `x` | `Int16` | The first value |
599
+ | `y` | `Int16` | The second value |
600
600
 
601
601
  Returns:
602
602
 
603
- |type|description|
604
- |----|-----------|
605
- |`Bool`|`true` if the first value is less than or equal to the second value or `false` otherwise|
603
+ | type | description |
604
+ | ------ | ---------------------------------------------------------------------------------------- |
605
+ | `Bool` | `true` if the first value is less than or equal to the second value or `false` otherwise |
606
606
 
607
607
  Examples:
608
608
 
@@ -631,16 +631,16 @@ Checks if the first value is greater than or equal to the second value.
631
631
 
632
632
  Parameters:
633
633
 
634
- |param|type|description|
635
- |-----|----|-----------|
636
- |`x`|`Int16`|The first value|
637
- |`y`|`Int16`|The second value|
634
+ | param | type | description |
635
+ | ----- | ------- | ---------------- |
636
+ | `x` | `Int16` | The first value |
637
+ | `y` | `Int16` | The second value |
638
638
 
639
639
  Returns:
640
640
 
641
- |type|description|
642
- |----|-----------|
643
- |`Bool`|`true` if the first value is greater than or equal to the second value or `false` otherwise|
641
+ | type | description |
642
+ | ------ | ------------------------------------------------------------------------------------------- |
643
+ | `Bool` | `true` if the first value is greater than or equal to the second value or `false` otherwise |
644
644
 
645
645
  Examples:
646
646
 
@@ -669,15 +669,15 @@ Computes the bitwise NOT of the given value.
669
669
 
670
670
  Parameters:
671
671
 
672
- |param|type|description|
673
- |-----|----|-----------|
674
- |`value`|`Int16`|The given value|
672
+ | param | type | description |
673
+ | ------- | ------- | --------------- |
674
+ | `value` | `Int16` | The given value |
675
675
 
676
676
  Returns:
677
677
 
678
- |type|description|
679
- |----|-----------|
680
- |`Int16`|Containing the inverted bits of the given value|
678
+ | type | description |
679
+ | ------- | ----------------------------------------------- |
680
+ | `Int16` | Containing the inverted bits of the given value |
681
681
 
682
682
  Examples:
683
683
 
@@ -700,16 +700,16 @@ Computes the bitwise AND (`&`) on the given operands.
700
700
 
701
701
  Parameters:
702
702
 
703
- |param|type|description|
704
- |-----|----|-----------|
705
- |`x`|`Int16`|The first operand|
706
- |`y`|`Int16`|The second operand|
703
+ | param | type | description |
704
+ | ----- | ------- | ------------------ |
705
+ | `x` | `Int16` | The first operand |
706
+ | `y` | `Int16` | The second operand |
707
707
 
708
708
  Returns:
709
709
 
710
- |type|description|
711
- |----|-----------|
712
- |`Int16`|Containing a `1` in each bit position for which the corresponding bits of both operands are `1`|
710
+ | type | description |
711
+ | ------- | ----------------------------------------------------------------------------------------------- |
712
+ | `Int16` | Containing a `1` in each bit position for which the corresponding bits of both operands are `1` |
713
713
 
714
714
  Examples:
715
715
 
@@ -733,16 +733,16 @@ Computes the bitwise OR (`|`) on the given operands.
733
733
 
734
734
  Parameters:
735
735
 
736
- |param|type|description|
737
- |-----|----|-----------|
738
- |`x`|`Int16`|The first operand|
739
- |`y`|`Int16`|The second operand|
736
+ | param | type | description |
737
+ | ----- | ------- | ------------------ |
738
+ | `x` | `Int16` | The first operand |
739
+ | `y` | `Int16` | The second operand |
740
740
 
741
741
  Returns:
742
742
 
743
- |type|description|
744
- |----|-----------|
745
- |`Int16`|Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1`|
743
+ | type | description |
744
+ | ------- | --------------------------------------------------------------------------------------------------------- |
745
+ | `Int16` | Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1` |
746
746
 
747
747
  Examples:
748
748
 
@@ -766,16 +766,16 @@ Computes the bitwise XOR (`^`) on the given operands.
766
766
 
767
767
  Parameters:
768
768
 
769
- |param|type|description|
770
- |-----|----|-----------|
771
- |`x`|`Int16`|The first operand|
772
- |`y`|`Int16`|The second operand|
769
+ | param | type | description |
770
+ | ----- | ------- | ------------------ |
771
+ | `x` | `Int16` | The first operand |
772
+ | `y` | `Int16` | The second operand |
773
773
 
774
774
  Returns:
775
775
 
776
- |type|description|
777
- |----|-----------|
778
- |`Int16`|Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1`|
776
+ | type | description |
777
+ | ------- | -------------------------------------------------------------------------------------------------------------- |
778
+ | `Int16` | Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1` |
779
779
 
780
780
  Examples:
781
781
 
package/int32.gr CHANGED
@@ -663,7 +663,7 @@ let rec expBySquaring = (y, x, n) => {
663
663
  * @returns The base raised to the given power
664
664
  *
665
665
  * @example
666
- * from Int32 use { (**) }
666
+ * use Int32.{ (**) }
667
667
  * assert 2l ** 3l == 8l
668
668
  *
669
669
  * @since v0.6.0