@grain/stdlib 0.4.4 → 0.5.0
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 +87 -0
- package/LICENSE +1 -1
- package/array.gr +92 -73
- package/array.md +18 -18
- package/bigint.gr +497 -0
- package/bigint.md +811 -0
- package/buffer.gr +56 -217
- package/buffer.md +24 -17
- package/bytes.gr +103 -205
- package/bytes.md +19 -0
- package/char.gr +152 -166
- package/char.md +200 -0
- package/exception.md +6 -0
- package/float32.gr +159 -82
- package/float32.md +315 -0
- package/float64.gr +163 -82
- package/float64.md +315 -0
- package/hash.gr +53 -49
- package/int32.gr +479 -230
- package/int32.md +937 -0
- package/int64.gr +479 -230
- package/int64.md +937 -0
- package/list.gr +530 -116
- package/list.md +1141 -0
- package/map.gr +302 -121
- package/map.md +525 -0
- package/number.gr +51 -57
- package/number.md +37 -3
- package/option.gr +25 -25
- package/option.md +1 -1
- package/package.json +3 -3
- package/pervasives.gr +504 -52
- package/pervasives.md +1116 -0
- package/queue.gr +8 -1
- package/queue.md +10 -0
- package/random.gr +196 -0
- package/random.md +179 -0
- package/range.gr +26 -26
- package/regex.gr +1833 -842
- package/regex.md +11 -11
- package/result.md +1 -1
- package/runtime/bigint.gr +2045 -0
- package/runtime/bigint.md +326 -0
- package/runtime/dataStructures.gr +99 -279
- package/runtime/dataStructures.md +391 -0
- package/runtime/debug.gr +0 -1
- package/runtime/debug.md +6 -0
- package/runtime/equal.gr +40 -37
- package/runtime/equal.md +6 -0
- package/runtime/exception.gr +28 -15
- package/runtime/exception.md +30 -0
- package/runtime/gc.gr +50 -20
- package/runtime/gc.md +36 -0
- package/runtime/malloc.gr +32 -22
- package/runtime/malloc.md +55 -0
- package/runtime/numberUtils.gr +297 -142
- package/runtime/numberUtils.md +54 -0
- package/runtime/numbers.gr +1204 -453
- package/runtime/numbers.md +300 -0
- package/runtime/string.gr +193 -228
- package/runtime/string.md +24 -0
- package/runtime/stringUtils.gr +62 -38
- package/runtime/stringUtils.md +6 -0
- package/runtime/unsafe/constants.gr +17 -0
- package/runtime/unsafe/constants.md +72 -0
- package/runtime/unsafe/conv.gr +10 -10
- package/runtime/unsafe/conv.md +71 -0
- package/runtime/unsafe/errors.md +204 -0
- package/runtime/unsafe/memory.gr +14 -3
- package/runtime/unsafe/memory.md +54 -0
- package/runtime/unsafe/printWasm.gr +4 -4
- package/runtime/unsafe/printWasm.md +24 -0
- package/runtime/unsafe/tags.gr +11 -10
- package/runtime/unsafe/tags.md +120 -0
- package/runtime/unsafe/wasmf32.gr +9 -2
- package/runtime/unsafe/wasmf32.md +168 -0
- package/runtime/unsafe/wasmf64.gr +9 -2
- package/runtime/unsafe/wasmf64.md +168 -0
- package/runtime/unsafe/wasmi32.gr +65 -47
- package/runtime/unsafe/wasmi32.md +282 -0
- package/runtime/unsafe/wasmi64.gr +78 -50
- package/runtime/unsafe/wasmi64.md +300 -0
- package/runtime/utils/printing.gr +62 -0
- package/runtime/utils/printing.md +18 -0
- package/runtime/wasi.gr +200 -46
- package/runtime/wasi.md +839 -0
- package/set.gr +125 -121
- package/set.md +24 -21
- package/stack.gr +29 -29
- package/stack.md +4 -6
- package/string.gr +434 -415
- package/string.md +3 -3
- package/sys/file.gr +477 -482
- package/sys/process.gr +33 -47
- package/sys/random.gr +48 -20
- package/sys/random.md +38 -0
- package/sys/time.gr +12 -28
package/regex.md
CHANGED
|
@@ -62,17 +62,17 @@ The special character sequences are as follows:
|
|
|
62
62
|
- `(«re»)` - Matches `«re»`, storing the result in a group
|
|
63
63
|
- `(?:«re»)` - Matches `«re»` without storing the result in a group
|
|
64
64
|
- `(?«mode»:«re») - Matches `«re»` with the mode settings specified by `«mode»` using the following syntax:
|
|
65
|
-
- `«mode»i` - The same as `«mode»`, but with case-insensitivity enabled (temporarily not supported until grain-lang/grain#661 is resolved)
|
|
66
|
-
- `«mode»-i` - The same as `«mode»`, but with case-insensitivity disabled (the default)
|
|
67
|
-
- `«mode»m` / `«mode»-s` - The same as `«mode»`, but with multi-line mode enabled
|
|
68
|
-
- `«mode»-m` / `«mode»s` - The same as `«mode»`, but with multi-line mode disabled
|
|
69
|
-
- An empty string, which will not change any mode settings
|
|
65
|
+
- `«mode»i` - The same as `«mode»`, but with case-insensitivity enabled (temporarily not supported until grain-lang/grain#661 is resolved)
|
|
66
|
+
- `«mode»-i` - The same as `«mode»`, but with case-insensitivity disabled (the default)
|
|
67
|
+
- `«mode»m` / `«mode»-s` - The same as `«mode»`, but with multi-line mode enabled
|
|
68
|
+
- `«mode»-m` / `«mode»s` - The same as `«mode»`, but with multi-line mode disabled
|
|
69
|
+
- An empty string, which will not change any mode settings
|
|
70
70
|
- `(?«tst»«re1»|«re2»)` - Will match `«re1»` if `«tst»`, otherwise will match `«re2»`. The following options are available for `«tst»`
|
|
71
|
-
- `(«n»)` - Will be true if group `«n»` has a match
|
|
72
|
-
- `(?=«re»)` - Will be true if `«re»` matches the next sequence
|
|
73
|
-
- `(?!«re»)` - Will be true if `«re»` does not match the next sequence
|
|
74
|
-
- `(?<=«re»)` - Will be true if `«re»` matches the preceding sequence
|
|
75
|
-
- `(?<!«re»)` - Will be true if `«re»` does not match the preceding sequence
|
|
71
|
+
- `(«n»)` - Will be true if group `«n»` has a match
|
|
72
|
+
- `(?=«re»)` - Will be true if `«re»` matches the next sequence
|
|
73
|
+
- `(?!«re»)` - Will be true if `«re»` does not match the next sequence
|
|
74
|
+
- `(?<=«re»)` - Will be true if `«re»` matches the preceding sequence
|
|
75
|
+
- `(?<!«re»)` - Will be true if `«re»` does not match the preceding sequence
|
|
76
76
|
- `(?«tst»«re»)` - Equivalent to `(?«tst»«re»|)`
|
|
77
77
|
- Finally, basic classes (defined below) can also appear outside of character ranges.
|
|
78
78
|
|
|
@@ -201,7 +201,7 @@ Returns:
|
|
|
201
201
|
|
|
202
202
|
|type|description|
|
|
203
203
|
|----|-----------|
|
|
204
|
-
|`Bool`|`true` if the RegExp matches the string
|
|
204
|
+
|`Bool`|`true` if the RegExp matches the string or `false` otherwise|
|
|
205
205
|
|
|
206
206
|
Examples:
|
|
207
207
|
|
package/result.md
CHANGED
|
@@ -272,7 +272,7 @@ No other changes yet.
|
|
|
272
272
|
</details>
|
|
273
273
|
|
|
274
274
|
```grain
|
|
275
|
-
|
|
275
|
+
or : (Result<a, b>, Result<a, b>) -> Result<a, b>
|
|
276
276
|
```
|
|
277
277
|
|
|
278
278
|
Behaves like a logical OR (`||`) where the first Result is only returned if it is the `Ok` variant and falling back to the second Result in all other cases.
|