@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/wasi/process.md
CHANGED
|
@@ -225,9 +225,9 @@ Access command line arguments.
|
|
|
225
225
|
|
|
226
226
|
Returns:
|
|
227
227
|
|
|
228
|
-
|type|description|
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
| type | description |
|
|
229
|
+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
230
|
+
| `Result<Array<String>, Exception>` | `Ok(args)` of an array containing positional string arguments to the process if successful or `Err(exception)` otherwise |
|
|
231
231
|
|
|
232
232
|
### Process.**env**
|
|
233
233
|
|
|
@@ -239,9 +239,9 @@ Access environment variables.
|
|
|
239
239
|
|
|
240
240
|
Returns:
|
|
241
241
|
|
|
242
|
-
|type|description|
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
| type | description |
|
|
243
|
+
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
244
|
+
| `Result<Array<String>, Exception>` | `Ok(vars)` of an array containing environment variables supplied to the process if successful or `Err(exception)` otherwise |
|
|
245
245
|
|
|
246
246
|
### Process.**exit**
|
|
247
247
|
|
|
@@ -253,15 +253,15 @@ Terminate the process normally.
|
|
|
253
253
|
|
|
254
254
|
Parameters:
|
|
255
255
|
|
|
256
|
-
|param|type|description|
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
| param | type | description |
|
|
257
|
+
| ------ | -------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
258
|
+
| `code` | `Number` | The value to exit with. An exit code of 0 is considered normal, with other values having meaning depending on the platform |
|
|
259
259
|
|
|
260
260
|
Returns:
|
|
261
261
|
|
|
262
|
-
|type|description|
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
| type | description |
|
|
263
|
+
| ------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
264
|
+
| `Result<Void, Exception>` | `Err(exception)` if unsuccessful. Will not actually return a value if successful, as the process has ended |
|
|
265
265
|
|
|
266
266
|
### Process.**sigRaise**
|
|
267
267
|
|
|
@@ -273,15 +273,15 @@ Send a signal to the process of the calling thread.
|
|
|
273
273
|
|
|
274
274
|
Parameters:
|
|
275
275
|
|
|
276
|
-
|param|type|description|
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
| param | type | description |
|
|
277
|
+
| -------- | -------- | ------------------ |
|
|
278
|
+
| `signal` | `Signal` | The signal to send |
|
|
279
279
|
|
|
280
280
|
Returns:
|
|
281
281
|
|
|
282
|
-
|type|description|
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
| type | description |
|
|
283
|
+
| ------------------------- | ------------------------------------------------------ |
|
|
284
|
+
| `Result<Void, Exception>` | `Ok(void)` if successful or `Err(exception)` otherwise |
|
|
285
285
|
|
|
286
286
|
### Process.**schedYield**
|
|
287
287
|
|
|
@@ -293,7 +293,7 @@ Yield execution to the calling thread.
|
|
|
293
293
|
|
|
294
294
|
Returns:
|
|
295
295
|
|
|
296
|
-
|type|description|
|
|
297
|
-
|
|
298
|
-
|
|
296
|
+
| type | description |
|
|
297
|
+
| ------------------------- | ------------------------------------------------------ |
|
|
298
|
+
| `Result<Void, Exception>` | `Ok(void)` if successful or `Err(exception)` otherwise |
|
|
299
299
|
|
package/wasi/random.md
CHANGED
|
@@ -34,9 +34,9 @@ Produce a random 32-bit integer. This function can be slow, so it's best to seed
|
|
|
34
34
|
|
|
35
35
|
Returns:
|
|
36
36
|
|
|
37
|
-
|type|description|
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
| type | description |
|
|
38
|
+
| --------------------------- | ------------------------------------------------------------------------ |
|
|
39
|
+
| `Result<Uint32, Exception>` | `Ok(num)` of a random Uint32 if successful or `Err(exception)` otherwise |
|
|
40
40
|
|
|
41
41
|
### Random.**randomUint64**
|
|
42
42
|
|
|
@@ -60,9 +60,9 @@ Produce a random 64-bit integer. This function can be slow, so it's best to seed
|
|
|
60
60
|
|
|
61
61
|
Returns:
|
|
62
62
|
|
|
63
|
-
|type|description|
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
| type | description |
|
|
64
|
+
| --------------------------- | ------------------------------------------------------------------------ |
|
|
65
|
+
| `Result<Uint64, Exception>` | `Ok(num)` of a random Uint64 if successful or `Err(exception)` otherwise |
|
|
66
66
|
|
|
67
67
|
### Random.**random**
|
|
68
68
|
|
|
@@ -74,7 +74,7 @@ Produce a random number. This function can be slow, so it's best to seed a gener
|
|
|
74
74
|
|
|
75
75
|
Returns:
|
|
76
76
|
|
|
77
|
-
|type|description|
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
| type | description |
|
|
78
|
+
| --------------------------- | ------------------------------------------------------------------------ |
|
|
79
|
+
| `Result<Number, Exception>` | `Ok(num)` of a random number if successful or `Err(exception)` otherwise |
|
|
80
80
|
|
package/wasi/time.md
CHANGED
|
@@ -23,9 +23,9 @@ Time value 0 corresponds with 1970-01-01T00:00:00Z.
|
|
|
23
23
|
|
|
24
24
|
Returns:
|
|
25
25
|
|
|
26
|
-
|type|description|
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
| type | description |
|
|
27
|
+
| -------------------------- | -------------------------------------------------------------------------- |
|
|
28
|
+
| `Result<Int64, Exception>` | `Ok(time)` of the current time if successful or `Err(exception)` otherwise |
|
|
29
29
|
|
|
30
30
|
### Time.**monotonicTime**
|
|
31
31
|
|
|
@@ -40,9 +40,9 @@ Useful for calculation of precise time intervals.
|
|
|
40
40
|
|
|
41
41
|
Returns:
|
|
42
42
|
|
|
43
|
-
|type|description|
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
| type | description |
|
|
44
|
+
| -------------------------- | -------------------------------------------------------------------------- |
|
|
45
|
+
| `Result<Int64, Exception>` | `Ok(time)` of the current time if successful or `Err(exception)` otherwise |
|
|
46
46
|
|
|
47
47
|
### Time.**processCpuTime**
|
|
48
48
|
|
|
@@ -54,9 +54,9 @@ Get the number of nanoseconds elapsed since the process began.
|
|
|
54
54
|
|
|
55
55
|
Returns:
|
|
56
56
|
|
|
57
|
-
|type|description|
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
| type | description |
|
|
58
|
+
| -------------------------- | ------------------------------------------------------------------------------------ |
|
|
59
|
+
| `Result<Int64, Exception>` | `Ok(elapsed)` of the elapsed nanoseconds if successful or `Err(exception)` otherwise |
|
|
60
60
|
|
|
61
61
|
### Time.**threadCpuTime**
|
|
62
62
|
|
|
@@ -68,7 +68,7 @@ Get the number of nanoseconds elapsed since the thread began.
|
|
|
68
68
|
|
|
69
69
|
Returns:
|
|
70
70
|
|
|
71
|
-
|type|description|
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
| type | description |
|
|
72
|
+
| -------------------------- | ------------------------------------------------------------------------------------ |
|
|
73
|
+
| `Result<Int64, Exception>` | `Ok(elapsed)` of the elapsed nanoseconds if successful or `Err(exception)` otherwise |
|
|
74
74
|
|