@grain/stdlib 0.4.6 → 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.
Files changed (82) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/array.gr +18 -18
  3. package/array.md +18 -18
  4. package/bigint.gr +497 -0
  5. package/bigint.md +811 -0
  6. package/buffer.gr +49 -213
  7. package/buffer.md +24 -17
  8. package/bytes.gr +100 -202
  9. package/bytes.md +19 -0
  10. package/char.gr +63 -133
  11. package/exception.md +6 -0
  12. package/float32.gr +39 -78
  13. package/float64.gr +43 -78
  14. package/hash.gr +37 -37
  15. package/int32.gr +152 -198
  16. package/int32.md +104 -0
  17. package/int64.gr +151 -197
  18. package/int64.md +104 -0
  19. package/list.gr +467 -70
  20. package/list.md +1141 -0
  21. package/map.gr +192 -7
  22. package/map.md +525 -0
  23. package/number.gr +30 -54
  24. package/number.md +3 -3
  25. package/option.md +1 -1
  26. package/package.json +3 -3
  27. package/pervasives.gr +499 -59
  28. package/pervasives.md +1116 -0
  29. package/queue.gr +4 -0
  30. package/queue.md +10 -0
  31. package/random.gr +196 -0
  32. package/random.md +179 -0
  33. package/regex.gr +1833 -842
  34. package/regex.md +11 -11
  35. package/result.md +1 -1
  36. package/runtime/bigint.gr +2045 -0
  37. package/runtime/bigint.md +326 -0
  38. package/runtime/dataStructures.gr +99 -278
  39. package/runtime/dataStructures.md +391 -0
  40. package/runtime/debug.md +6 -0
  41. package/runtime/equal.gr +5 -23
  42. package/runtime/equal.md +6 -0
  43. package/runtime/exception.md +30 -0
  44. package/runtime/gc.gr +20 -3
  45. package/runtime/gc.md +36 -0
  46. package/runtime/malloc.gr +13 -11
  47. package/runtime/malloc.md +55 -0
  48. package/runtime/numberUtils.gr +91 -41
  49. package/runtime/numberUtils.md +54 -0
  50. package/runtime/numbers.gr +1043 -391
  51. package/runtime/numbers.md +300 -0
  52. package/runtime/string.gr +136 -230
  53. package/runtime/string.md +24 -0
  54. package/runtime/stringUtils.gr +58 -38
  55. package/runtime/stringUtils.md +6 -0
  56. package/runtime/unsafe/constants.gr +17 -0
  57. package/runtime/unsafe/constants.md +72 -0
  58. package/runtime/unsafe/conv.md +71 -0
  59. package/runtime/unsafe/errors.md +204 -0
  60. package/runtime/unsafe/memory.md +54 -0
  61. package/runtime/unsafe/printWasm.md +24 -0
  62. package/runtime/unsafe/tags.gr +9 -8
  63. package/runtime/unsafe/tags.md +120 -0
  64. package/runtime/unsafe/wasmf32.md +168 -0
  65. package/runtime/unsafe/wasmf64.md +168 -0
  66. package/runtime/unsafe/wasmi32.md +282 -0
  67. package/runtime/unsafe/wasmi64.md +300 -0
  68. package/runtime/utils/printing.gr +62 -0
  69. package/runtime/utils/printing.md +18 -0
  70. package/runtime/wasi.gr +1 -1
  71. package/runtime/wasi.md +839 -0
  72. package/set.gr +17 -8
  73. package/set.md +24 -21
  74. package/stack.gr +3 -3
  75. package/stack.md +4 -6
  76. package/string.gr +194 -329
  77. package/string.md +3 -3
  78. package/sys/file.gr +245 -429
  79. package/sys/process.gr +27 -45
  80. package/sys/random.gr +47 -16
  81. package/sys/random.md +38 -0
  82. package/sys/time.gr +11 -27
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, otherwise `false`|
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
- ( or ) : (Result<a, b>, Result<a, b>) -> Result<a, b>
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.