@grain/stdlib 0.6.5 → 0.7.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 (139) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/LICENSE +1 -1
  3. package/README.md +2 -2
  4. package/array.gr +55 -7
  5. package/array.md +123 -77
  6. package/bigint.md +30 -30
  7. package/buffer.gr +20 -53
  8. package/buffer.md +47 -47
  9. package/bytes.gr +111 -35
  10. package/bytes.md +111 -32
  11. package/char.gr +201 -99
  12. package/char.md +361 -34
  13. package/exception.gr +11 -11
  14. package/exception.md +26 -1
  15. package/float32.gr +327 -3
  16. package/float32.md +606 -19
  17. package/float64.gr +320 -3
  18. package/float64.md +606 -19
  19. package/fs.gr +1082 -0
  20. package/fs.md +630 -0
  21. package/hash.gr +142 -88
  22. package/hash.md +102 -14
  23. package/int16.md +23 -23
  24. package/int32.gr +25 -4
  25. package/int32.md +65 -30
  26. package/int64.gr +26 -1
  27. package/int64.md +65 -30
  28. package/int8.md +23 -23
  29. package/json.gr +366 -51
  30. package/json.md +418 -2
  31. package/list.gr +387 -49
  32. package/list.md +492 -69
  33. package/map.gr +20 -12
  34. package/map.md +44 -38
  35. package/marshal.gr +41 -40
  36. package/marshal.md +2 -2
  37. package/number.gr +159 -30
  38. package/number.md +215 -38
  39. package/option.md +21 -21
  40. package/package.json +5 -3
  41. package/path.gr +48 -0
  42. package/path.md +103 -12
  43. package/pervasives.gr +2 -2
  44. package/pervasives.md +37 -37
  45. package/priorityqueue.gr +7 -7
  46. package/priorityqueue.md +19 -19
  47. package/queue.gr +183 -29
  48. package/queue.md +296 -40
  49. package/random.md +6 -6
  50. package/range.gr +4 -4
  51. package/range.md +6 -6
  52. package/rational.md +16 -16
  53. package/regex.gr +52 -51
  54. package/regex.md +11 -11
  55. package/result.md +16 -16
  56. package/runtime/atof/common.md +39 -39
  57. package/runtime/atof/decimal.gr +6 -6
  58. package/runtime/atof/decimal.md +8 -8
  59. package/runtime/atof/lemire.gr +5 -5
  60. package/runtime/atof/lemire.md +1 -1
  61. package/runtime/atof/parse.gr +16 -16
  62. package/runtime/atof/parse.md +2 -2
  63. package/runtime/atof/slow.md +1 -1
  64. package/runtime/atof/table.md +2 -2
  65. package/runtime/atoi/parse.gr +3 -3
  66. package/runtime/atoi/parse.md +1 -1
  67. package/runtime/bigint.gr +15 -47
  68. package/runtime/bigint.md +54 -60
  69. package/runtime/compare.gr +2 -2
  70. package/runtime/compare.md +1 -1
  71. package/runtime/dataStructures.md +33 -33
  72. package/runtime/debugPrint.gr +4 -1
  73. package/runtime/debugPrint.md +9 -9
  74. package/runtime/equal.gr +99 -77
  75. package/runtime/equal.md +1 -1
  76. package/runtime/exception.gr +62 -82
  77. package/runtime/exception.md +62 -11
  78. package/runtime/gc.gr +39 -45
  79. package/runtime/gc.md +4 -4
  80. package/runtime/malloc.gr +7 -7
  81. package/runtime/malloc.md +4 -4
  82. package/runtime/math/kernel/cos.gr +70 -0
  83. package/runtime/math/kernel/cos.md +14 -0
  84. package/runtime/math/kernel/sin.gr +65 -0
  85. package/runtime/math/kernel/sin.md +14 -0
  86. package/runtime/math/kernel/tan.gr +136 -0
  87. package/runtime/math/kernel/tan.md +14 -0
  88. package/runtime/math/rempio2.gr +244 -0
  89. package/runtime/math/rempio2.md +14 -0
  90. package/runtime/math/trig.gr +130 -0
  91. package/runtime/math/trig.md +28 -0
  92. package/runtime/math/umuldi.gr +26 -0
  93. package/runtime/math/umuldi.md +14 -0
  94. package/runtime/numberUtils.gr +29 -29
  95. package/runtime/numberUtils.md +12 -12
  96. package/runtime/numbers.gr +373 -381
  97. package/runtime/numbers.md +79 -73
  98. package/runtime/string.gr +37 -105
  99. package/runtime/string.md +3 -9
  100. package/runtime/unsafe/constants.md +24 -24
  101. package/runtime/unsafe/conv.md +13 -13
  102. package/runtime/unsafe/memory.gr +24 -20
  103. package/runtime/unsafe/memory.md +27 -7
  104. package/runtime/unsafe/offsets.gr +36 -0
  105. package/runtime/unsafe/offsets.md +88 -0
  106. package/runtime/unsafe/panic.gr +28 -0
  107. package/runtime/unsafe/panic.md +14 -0
  108. package/runtime/unsafe/tags.md +32 -32
  109. package/runtime/unsafe/wasmf32.md +28 -28
  110. package/runtime/unsafe/wasmf64.md +28 -28
  111. package/runtime/unsafe/wasmi32.md +47 -47
  112. package/runtime/unsafe/wasmi64.md +50 -50
  113. package/runtime/utf8.gr +189 -0
  114. package/runtime/utf8.md +117 -0
  115. package/runtime/wasi.gr +4 -2
  116. package/runtime/wasi.md +138 -138
  117. package/set.gr +18 -11
  118. package/set.md +42 -36
  119. package/stack.gr +171 -2
  120. package/stack.md +297 -15
  121. package/string.gr +352 -557
  122. package/string.md +77 -34
  123. package/uint16.gr +81 -0
  124. package/uint16.md +183 -22
  125. package/uint32.gr +25 -4
  126. package/uint32.md +63 -28
  127. package/uint64.gr +25 -5
  128. package/uint64.md +63 -28
  129. package/uint8.gr +81 -0
  130. package/uint8.md +183 -22
  131. package/uri.gr +57 -53
  132. package/uri.md +11 -12
  133. package/wasi/file.gr +67 -59
  134. package/wasi/file.md +39 -39
  135. package/wasi/process.md +5 -5
  136. package/wasi/random.md +3 -3
  137. package/wasi/time.md +4 -4
  138. package/runtime/utils/printing.gr +0 -60
  139. package/runtime/utils/printing.md +0 -26
package/runtime/bigint.md CHANGED
@@ -6,64 +6,58 @@ title: Bigint
6
6
 
7
7
  Functions and constants included in the Bigint module.
8
8
 
9
- ### Bigint.**debugDumpNumber**
10
-
11
- ```grain
12
- debugDumpNumber : (num: WasmI32) => Void
13
- ```
14
-
15
9
  ### Bigint.**getSize**
16
10
 
17
11
  ```grain
18
- getSize : (ptr: WasmI32) => WasmI32
12
+ getSize: (ptr: WasmI32) => WasmI32
19
13
  ```
20
14
 
21
15
  ### Bigint.**getFlags**
22
16
 
23
17
  ```grain
24
- getFlags : (ptr: WasmI32) => WasmI32
18
+ getFlags: (ptr: WasmI32) => WasmI32
25
19
  ```
26
20
 
27
21
  ### Bigint.**getLimb**
28
22
 
29
23
  ```grain
30
- getLimb : (ptr: WasmI32, i: WasmI32) => WasmI64
24
+ getLimb: (ptr: WasmI32, i: WasmI32) => WasmI64
31
25
  ```
32
26
 
33
27
  ### Bigint.**makeWrappedInt32**
34
28
 
35
29
  ```grain
36
- makeWrappedInt32 : (value: WasmI32) => WasmI32
30
+ makeWrappedInt32: (value: WasmI32) => WasmI32
37
31
  ```
38
32
 
39
33
  ### Bigint.**makeWrappedUint32**
40
34
 
41
35
  ```grain
42
- makeWrappedUint32 : (value: WasmI32) => WasmI32
36
+ makeWrappedUint32: (value: WasmI32) => WasmI32
43
37
  ```
44
38
 
45
39
  ### Bigint.**makeWrappedInt64**
46
40
 
47
41
  ```grain
48
- makeWrappedInt64 : (value: WasmI64) => WasmI32
42
+ makeWrappedInt64: (value: WasmI64) => WasmI32
49
43
  ```
50
44
 
51
45
  ### Bigint.**makeWrappedUint64**
52
46
 
53
47
  ```grain
54
- makeWrappedUint64 : (value: WasmI64) => WasmI32
48
+ makeWrappedUint64: (value: WasmI64) => WasmI32
55
49
  ```
56
50
 
57
51
  ### Bigint.**isNegative**
58
52
 
59
53
  ```grain
60
- isNegative : (num: WasmI32) => Bool
54
+ isNegative: (num: WasmI32) => Bool
61
55
  ```
62
56
 
63
57
  ### Bigint.**eqz**
64
58
 
65
59
  ```grain
66
- eqz : (num: WasmI32) => Bool
60
+ eqz: (num: WasmI32) => Bool
67
61
  ```
68
62
 
69
63
  Returns true if the given bigint is equal to zero
@@ -71,270 +65,270 @@ Returns true if the given bigint is equal to zero
71
65
  ### Bigint.**negate**
72
66
 
73
67
  ```grain
74
- negate : (num: WasmI32) => WasmI32
68
+ negate: (num: WasmI32) => WasmI32
75
69
  ```
76
70
 
77
71
  ### Bigint.**abs**
78
72
 
79
73
  ```grain
80
- abs : (num: WasmI32) => WasmI32
74
+ abs: (num: WasmI32) => WasmI32
81
75
  ```
82
76
 
83
77
  ### Bigint.**canConvertToInt32**
84
78
 
85
79
  ```grain
86
- canConvertToInt32 : (num: WasmI32) => Bool
80
+ canConvertToInt32: (num: WasmI32) => Bool
87
81
  ```
88
82
 
89
83
  ### Bigint.**toInt32**
90
84
 
91
85
  ```grain
92
- toInt32 : (num: WasmI32) => WasmI32
86
+ toInt32: (num: WasmI32) => WasmI32
93
87
  ```
94
88
 
95
89
  ### Bigint.**canConvertToInt64**
96
90
 
97
91
  ```grain
98
- canConvertToInt64 : (num: WasmI32) => Bool
92
+ canConvertToInt64: (num: WasmI32) => Bool
99
93
  ```
100
94
 
101
95
  ### Bigint.**toInt64**
102
96
 
103
97
  ```grain
104
- toInt64 : (num: WasmI32) => WasmI64
98
+ toInt64: (num: WasmI32) => WasmI64
105
99
  ```
106
100
 
107
101
  ### Bigint.**toUnsignedInt64**
108
102
 
109
103
  ```grain
110
- toUnsignedInt64 : (num: WasmI32) => WasmI64
104
+ toUnsignedInt64: (num: WasmI32) => WasmI64
111
105
  ```
112
106
 
113
107
  ### Bigint.**toFloat64**
114
108
 
115
109
  ```grain
116
- toFloat64 : (num: WasmI32) => WasmF64
110
+ toFloat64: (num: WasmI32) => WasmF64
117
111
  ```
118
112
 
119
113
  ### Bigint.**toFloat32**
120
114
 
121
115
  ```grain
122
- toFloat32 : (num: WasmI32) => WasmF32
116
+ toFloat32: (num: WasmI32) => WasmF32
123
117
  ```
124
118
 
125
119
  ### Bigint.**cmpI64**
126
120
 
127
121
  ```grain
128
- cmpI64 : (num1: WasmI32, num2: WasmI64) => WasmI32
122
+ cmpI64: (num1: WasmI32, num2: WasmI64) => WasmI32
129
123
  ```
130
124
 
131
125
  ### Bigint.**cmpU64**
132
126
 
133
127
  ```grain
134
- cmpU64 : (num1: WasmI32, num2: WasmI64) => WasmI32
128
+ cmpU64: (num1: WasmI32, num2: WasmI64) => WasmI32
135
129
  ```
136
130
 
137
131
  ### Bigint.**cmpF64**
138
132
 
139
133
  ```grain
140
- cmpF64 : (num1: WasmI32, num2: WasmF64) => WasmI32
134
+ cmpF64: (num1: WasmI32, num2: WasmF64) => WasmI32
141
135
  ```
142
136
 
143
137
  ### Bigint.**cmpF32**
144
138
 
145
139
  ```grain
146
- cmpF32 : (num1: WasmI32, num2: WasmF32) => WasmI32
140
+ cmpF32: (num1: WasmI32, num2: WasmF32) => WasmI32
147
141
  ```
148
142
 
149
143
  ### Bigint.**cmp**
150
144
 
151
145
  ```grain
152
- cmp : (num1: WasmI32, num2: WasmI32) => WasmI32
146
+ cmp: (num1: WasmI32, num2: WasmI32) => WasmI32
153
147
  ```
154
148
 
155
149
  ### Bigint.**eq**
156
150
 
157
151
  ```grain
158
- eq : (num1: WasmI32, num2: WasmI32) => Bool
152
+ eq: (num1: WasmI32, num2: WasmI32) => Bool
159
153
  ```
160
154
 
161
155
  ### Bigint.**ne**
162
156
 
163
157
  ```grain
164
- ne : (num1: WasmI32, num2: WasmI32) => Bool
158
+ ne: (num1: WasmI32, num2: WasmI32) => Bool
165
159
  ```
166
160
 
167
161
  ### Bigint.**lt**
168
162
 
169
163
  ```grain
170
- lt : (num1: WasmI32, num2: WasmI32) => Bool
164
+ lt: (num1: WasmI32, num2: WasmI32) => Bool
171
165
  ```
172
166
 
173
167
  ### Bigint.**lte**
174
168
 
175
169
  ```grain
176
- lte : (num1: WasmI32, num2: WasmI32) => Bool
170
+ lte: (num1: WasmI32, num2: WasmI32) => Bool
177
171
  ```
178
172
 
179
173
  ### Bigint.**gt**
180
174
 
181
175
  ```grain
182
- gt : (num1: WasmI32, num2: WasmI32) => Bool
176
+ gt: (num1: WasmI32, num2: WasmI32) => Bool
183
177
  ```
184
178
 
185
179
  ### Bigint.**gte**
186
180
 
187
181
  ```grain
188
- gte : (num1: WasmI32, num2: WasmI32) => Bool
182
+ gte: (num1: WasmI32, num2: WasmI32) => Bool
189
183
  ```
190
184
 
191
185
  ### Bigint.**bigIntToString**
192
186
 
193
187
  ```grain
194
- bigIntToString : (num: WasmI32, base: WasmI32) => String
188
+ bigIntToString: (num: WasmI32, base: WasmI32) => String
195
189
  ```
196
190
 
197
191
  ### Bigint.**bigIntToString10**
198
192
 
199
193
  ```grain
200
- bigIntToString10 : (num: WasmI32) => String
194
+ bigIntToString10: (num: WasmI32) => String
201
195
  ```
202
196
 
203
197
  ### Bigint.**add**
204
198
 
205
199
  ```grain
206
- add : (num1: WasmI32, num2: WasmI32) => WasmI32
200
+ add: (num1: WasmI32, num2: WasmI32) => WasmI32
207
201
  ```
208
202
 
209
203
  ### Bigint.**addInt**
210
204
 
211
205
  ```grain
212
- addInt : (num1: WasmI32, int: WasmI64) => WasmI32
206
+ addInt: (num1: WasmI32, int: WasmI64) => WasmI32
213
207
  ```
214
208
 
215
209
  ### Bigint.**sub**
216
210
 
217
211
  ```grain
218
- sub : (num1: WasmI32, num2: WasmI32) => WasmI32
212
+ sub: (num1: WasmI32, num2: WasmI32) => WasmI32
219
213
  ```
220
214
 
221
215
  ### Bigint.**subInt**
222
216
 
223
217
  ```grain
224
- subInt : (num1: WasmI32, int: WasmI64) => WasmI32
218
+ subInt: (num1: WasmI32, int: WasmI64) => WasmI32
225
219
  ```
226
220
 
227
221
  ### Bigint.**incr**
228
222
 
229
223
  ```grain
230
- incr : (num: WasmI32) => WasmI32
224
+ incr: (num: WasmI32) => WasmI32
231
225
  ```
232
226
 
233
227
  ### Bigint.**decr**
234
228
 
235
229
  ```grain
236
- decr : (num: WasmI32) => WasmI32
230
+ decr: (num: WasmI32) => WasmI32
237
231
  ```
238
232
 
239
233
  ### Bigint.**mul**
240
234
 
241
235
  ```grain
242
- mul : (num1: WasmI32, num2: WasmI32) => WasmI32
236
+ mul: (num1: WasmI32, num2: WasmI32) => WasmI32
243
237
  ```
244
238
 
245
239
  ### Bigint.**shl**
246
240
 
247
241
  ```grain
248
- shl : (num: WasmI32, places: WasmI32) => WasmI32
242
+ shl: (num: WasmI32, places: WasmI32) => WasmI32
249
243
  ```
250
244
 
251
245
  ### Bigint.**shrS**
252
246
 
253
247
  ```grain
254
- shrS : (num: WasmI32, places: WasmI32) => WasmI32
248
+ shrS: (num: WasmI32, places: WasmI32) => WasmI32
255
249
  ```
256
250
 
257
251
  ### Bigint.**bitwiseNot**
258
252
 
259
253
  ```grain
260
- bitwiseNot : (num: WasmI32) => WasmI32
254
+ bitwiseNot: (num: WasmI32) => WasmI32
261
255
  ```
262
256
 
263
257
  ### Bigint.**bitwiseAnd**
264
258
 
265
259
  ```grain
266
- bitwiseAnd : (num1: WasmI32, num2: WasmI32) => WasmI32
260
+ bitwiseAnd: (num1: WasmI32, num2: WasmI32) => WasmI32
267
261
  ```
268
262
 
269
263
  ### Bigint.**bitwiseOr**
270
264
 
271
265
  ```grain
272
- bitwiseOr : (num1: WasmI32, num2: WasmI32) => WasmI32
266
+ bitwiseOr: (num1: WasmI32, num2: WasmI32) => WasmI32
273
267
  ```
274
268
 
275
269
  ### Bigint.**bitwiseXor**
276
270
 
277
271
  ```grain
278
- bitwiseXor : (num1: WasmI32, num2: WasmI32) => WasmI32
272
+ bitwiseXor: (num1: WasmI32, num2: WasmI32) => WasmI32
279
273
  ```
280
274
 
281
275
  ### Bigint.**countLeadingZeros**
282
276
 
283
277
  ```grain
284
- countLeadingZeros : (num: WasmI32) => WasmI32
278
+ countLeadingZeros: (num: WasmI32) => WasmI32
285
279
  ```
286
280
 
287
281
  ### Bigint.**countTrailingZeros**
288
282
 
289
283
  ```grain
290
- countTrailingZeros : (num: WasmI32) => WasmI64
284
+ countTrailingZeros: (num: WasmI32) => WasmI64
291
285
  ```
292
286
 
293
287
  ### Bigint.**popcnt**
294
288
 
295
289
  ```grain
296
- popcnt : (num: WasmI32, flagDest: WasmI32) => WasmI64
290
+ popcnt: (num: WasmI32, flagDest: WasmI32) => WasmI64
297
291
  ```
298
292
 
299
293
  ### Bigint.**gcd**
300
294
 
301
295
  ```grain
302
- gcd : (num1: WasmI32, num2: WasmI32) => WasmI32
296
+ gcd: (num1: WasmI32, num2: WasmI32) => WasmI32
303
297
  ```
304
298
 
305
299
  ### Bigint.**quotRem**
306
300
 
307
301
  ```grain
308
- quotRem : (num1: WasmI32, num2: WasmI32, dest: WasmI32) => Void
302
+ quotRem: (num1: WasmI32, num2: WasmI32, dest: WasmI32) => Void
309
303
  ```
310
304
 
311
305
  ### Bigint.**divMod**
312
306
 
313
307
  ```grain
314
- divMod : (num1: WasmI32, num2: WasmI32, dest: WasmI32) => Void
308
+ divMod: (num1: WasmI32, num2: WasmI32, dest: WasmI32) => Void
315
309
  ```
316
310
 
317
311
  ### Bigint.**quot**
318
312
 
319
313
  ```grain
320
- quot : (num1: WasmI32, num2: WasmI32) => WasmI32
314
+ quot: (num1: WasmI32, num2: WasmI32) => WasmI32
321
315
  ```
322
316
 
323
317
  ### Bigint.**div**
324
318
 
325
319
  ```grain
326
- div : (num1: WasmI32, num2: WasmI32) => WasmI32
320
+ div: (num1: WasmI32, num2: WasmI32) => WasmI32
327
321
  ```
328
322
 
329
323
  ### Bigint.**rem**
330
324
 
331
325
  ```grain
332
- rem : (num1: WasmI32, num2: WasmI32) => WasmI32
326
+ rem: (num1: WasmI32, num2: WasmI32) => WasmI32
333
327
  ```
334
328
 
335
329
  ### Bigint.**mod**
336
330
 
337
331
  ```grain
338
- mod : (num1: WasmI32, num2: WasmI32) => WasmI32
332
+ mod: (num1: WasmI32, num2: WasmI32) => WasmI32
339
333
  ```
340
334
 
@@ -188,8 +188,8 @@ and compareHelp = (x, y) => {
188
188
  } else if (xtag == Tags._GRAIN_SHORTVAL_TAG_TYPE) {
189
189
  let shortValTag = x & Tags._GRAIN_GENERIC_SHORTVAL_TAG_MASK
190
190
  if (
191
- shortValTag == Tags._GRAIN_INT8_TAG_MASK ||
192
- shortValTag == Tags._GRAIN_INT16_TAG_MASK
191
+ shortValTag == Tags._GRAIN_INT8_TAG_MASK
192
+ || shortValTag == Tags._GRAIN_INT16_TAG_MASK
193
193
  ) {
194
194
  if (x < y) {
195
195
  -1
@@ -14,7 +14,7 @@ No other changes yet.
14
14
  </details>
15
15
 
16
16
  ```grain
17
- compare : (num1: a, num2: a) => Number
17
+ compare: (num1: a, num2: a) => Number
18
18
  ```
19
19
 
20
20
  Compares the first argument to the second argument and produces an integer result.
@@ -9,7 +9,7 @@ Functions and constants included in the DataStructures module.
9
9
  ### DataStructures.**allocateArray**
10
10
 
11
11
  ```grain
12
- allocateArray : (size: WasmI32) => WasmI32
12
+ allocateArray: (size: WasmI32) => WasmI32
13
13
  ```
14
14
 
15
15
  Allocates a new Grain array.
@@ -29,7 +29,7 @@ Returns:
29
29
  ### DataStructures.**allocateTuple**
30
30
 
31
31
  ```grain
32
- allocateTuple : (size: WasmI32) => WasmI32
32
+ allocateTuple: (size: WasmI32) => WasmI32
33
33
  ```
34
34
 
35
35
  Allocates a new Grain tuple.
@@ -49,7 +49,7 @@ Returns:
49
49
  ### DataStructures.**allocateBytes**
50
50
 
51
51
  ```grain
52
- allocateBytes : (size: WasmI32) => WasmI32
52
+ allocateBytes: (size: WasmI32) => WasmI32
53
53
  ```
54
54
 
55
55
  Allocates a new Grain bytes.
@@ -69,7 +69,7 @@ Returns:
69
69
  ### DataStructures.**allocateString**
70
70
 
71
71
  ```grain
72
- allocateString : (size: WasmI32) => WasmI32
72
+ allocateString: (size: WasmI32) => WasmI32
73
73
  ```
74
74
 
75
75
  Allocates a new Grain string.
@@ -89,7 +89,7 @@ Returns:
89
89
  ### DataStructures.**allocateInt32**
90
90
 
91
91
  ```grain
92
- allocateInt32 : () => WasmI32
92
+ allocateInt32: () => WasmI32
93
93
  ```
94
94
 
95
95
  Allocates a new Int32.
@@ -103,7 +103,7 @@ Returns:
103
103
  ### DataStructures.**newInt32**
104
104
 
105
105
  ```grain
106
- newInt32 : (int: WasmI32) => WasmI32
106
+ newInt32: (int: WasmI32) => WasmI32
107
107
  ```
108
108
 
109
109
  Allocates a new Int32 with a prepopulated value
@@ -123,7 +123,7 @@ Returns:
123
123
  ### DataStructures.**allocateUint32**
124
124
 
125
125
  ```grain
126
- allocateUint32 : () => WasmI32
126
+ allocateUint32: () => WasmI32
127
127
  ```
128
128
 
129
129
  Allocates a new Uint32.
@@ -137,7 +137,7 @@ Returns:
137
137
  ### DataStructures.**newUint32**
138
138
 
139
139
  ```grain
140
- newUint32 : (int: WasmI32) => WasmI32
140
+ newUint32: (int: WasmI32) => WasmI32
141
141
  ```
142
142
 
143
143
  Allocates a new Uint32 with a prepopulated value
@@ -157,7 +157,7 @@ Returns:
157
157
  ### DataStructures.**allocateInt64**
158
158
 
159
159
  ```grain
160
- allocateInt64 : () => WasmI32
160
+ allocateInt64: () => WasmI32
161
161
  ```
162
162
 
163
163
  Allocates a new Int64.
@@ -171,7 +171,7 @@ Returns:
171
171
  ### DataStructures.**newInt64**
172
172
 
173
173
  ```grain
174
- newInt64 : (int: WasmI64) => WasmI32
174
+ newInt64: (int: WasmI64) => WasmI32
175
175
  ```
176
176
 
177
177
  Allocates a new Int64 with a prepopulated value
@@ -191,7 +191,7 @@ Returns:
191
191
  ### DataStructures.**allocateUint64**
192
192
 
193
193
  ```grain
194
- allocateUint64 : () => WasmI32
194
+ allocateUint64: () => WasmI32
195
195
  ```
196
196
 
197
197
  Allocates a new Uint64.
@@ -205,7 +205,7 @@ Returns:
205
205
  ### DataStructures.**newUint64**
206
206
 
207
207
  ```grain
208
- newUint64 : (int: WasmI64) => WasmI32
208
+ newUint64: (int: WasmI64) => WasmI32
209
209
  ```
210
210
 
211
211
  Allocates a new Uint64 with a prepopulated value
@@ -225,7 +225,7 @@ Returns:
225
225
  ### DataStructures.**allocateFloat32**
226
226
 
227
227
  ```grain
228
- allocateFloat32 : () => WasmI32
228
+ allocateFloat32: () => WasmI32
229
229
  ```
230
230
 
231
231
  Allocates a new Float32.
@@ -239,7 +239,7 @@ Returns:
239
239
  ### DataStructures.**newFloat32**
240
240
 
241
241
  ```grain
242
- newFloat32 : (float: WasmF32) => WasmI32
242
+ newFloat32: (float: WasmF32) => WasmI32
243
243
  ```
244
244
 
245
245
  Allocates a new Float32 with a prepopulated value
@@ -259,7 +259,7 @@ Returns:
259
259
  ### DataStructures.**allocateFloat64**
260
260
 
261
261
  ```grain
262
- allocateFloat64 : () => WasmI32
262
+ allocateFloat64: () => WasmI32
263
263
  ```
264
264
 
265
265
  Allocates a new Float64.
@@ -273,7 +273,7 @@ Returns:
273
273
  ### DataStructures.**newFloat64**
274
274
 
275
275
  ```grain
276
- newFloat64 : (float: WasmF64) => WasmI32
276
+ newFloat64: (float: WasmF64) => WasmI32
277
277
  ```
278
278
 
279
279
  Allocates a new Float64 with a prepopulated value
@@ -293,7 +293,7 @@ Returns:
293
293
  ### DataStructures.**allocateRational**
294
294
 
295
295
  ```grain
296
- allocateRational : () => WasmI32
296
+ allocateRational: () => WasmI32
297
297
  ```
298
298
 
299
299
  Allocates a new Rational.
@@ -307,7 +307,7 @@ Returns:
307
307
  ### DataStructures.**newRational**
308
308
 
309
309
  ```grain
310
- newRational : (numerator: WasmI32, denominator: WasmI32) => WasmI32
310
+ newRational: (numerator: WasmI32, denominator: WasmI32) => WasmI32
311
311
  ```
312
312
 
313
313
  Allocates a new Rational with a prepopulated value
@@ -328,7 +328,7 @@ Returns:
328
328
  ### DataStructures.**loadAdtVariant**
329
329
 
330
330
  ```grain
331
- loadAdtVariant : (ptr: WasmI32) => WasmI32
331
+ loadAdtVariant: (ptr: WasmI32) => WasmI32
332
332
  ```
333
333
 
334
334
  Load the (tagged) variant of an ADT.
@@ -348,7 +348,7 @@ Returns:
348
348
  ### DataStructures.**stringSize**
349
349
 
350
350
  ```grain
351
- stringSize : (ptr: WasmI32) => WasmI32
351
+ stringSize: (ptr: WasmI32) => WasmI32
352
352
  ```
353
353
 
354
354
  Load an untagged string's size.
@@ -368,7 +368,7 @@ Returns:
368
368
  ### DataStructures.**bytesSize**
369
369
 
370
370
  ```grain
371
- bytesSize : (ptr: WasmI32) => WasmI32
371
+ bytesSize: (ptr: WasmI32) => WasmI32
372
372
  ```
373
373
 
374
374
  Load an untagged Bytes' size.
@@ -388,7 +388,7 @@ Returns:
388
388
  ### DataStructures.**tagSimpleNumber**
389
389
 
390
390
  ```grain
391
- tagSimpleNumber : (num: WasmI32) => Number
391
+ tagSimpleNumber: (num: WasmI32) => Number
392
392
  ```
393
393
 
394
394
  Tag a simple number.
@@ -408,7 +408,7 @@ Returns:
408
408
  ### DataStructures.**untagSimpleNumber**
409
409
 
410
410
  ```grain
411
- untagSimpleNumber : (num: Number) => WasmI32
411
+ untagSimpleNumber: (num: Number) => WasmI32
412
412
  ```
413
413
 
414
414
  Untag a simple number.
@@ -428,7 +428,7 @@ Returns:
428
428
  ### DataStructures.**tagChar**
429
429
 
430
430
  ```grain
431
- tagChar : (char: WasmI32) => Char
431
+ tagChar: (char: WasmI32) => Char
432
432
  ```
433
433
 
434
434
  Tag a char.
@@ -448,7 +448,7 @@ Returns:
448
448
  ### DataStructures.**untagChar**
449
449
 
450
450
  ```grain
451
- untagChar : (char: Char) => WasmI32
451
+ untagChar: (char: Char) => WasmI32
452
452
  ```
453
453
 
454
454
  Untag a char.
@@ -468,7 +468,7 @@ Returns:
468
468
  ### DataStructures.**tagInt8**
469
469
 
470
470
  ```grain
471
- tagInt8 : (int: WasmI32) => Int8
471
+ tagInt8: (int: WasmI32) => Int8
472
472
  ```
473
473
 
474
474
  Tag an int8.
@@ -488,7 +488,7 @@ Returns:
488
488
  ### DataStructures.**untagInt8**
489
489
 
490
490
  ```grain
491
- untagInt8 : (int: Int8) => WasmI32
491
+ untagInt8: (int: Int8) => WasmI32
492
492
  ```
493
493
 
494
494
  Untag an int8.
@@ -508,7 +508,7 @@ Returns:
508
508
  ### DataStructures.**tagInt16**
509
509
 
510
510
  ```grain
511
- tagInt16 : (int: WasmI32) => Int16
511
+ tagInt16: (int: WasmI32) => Int16
512
512
  ```
513
513
 
514
514
  Tag an int16.
@@ -528,7 +528,7 @@ Returns:
528
528
  ### DataStructures.**untagInt16**
529
529
 
530
530
  ```grain
531
- untagInt16 : (int: Int16) => WasmI32
531
+ untagInt16: (int: Int16) => WasmI32
532
532
  ```
533
533
 
534
534
  Untag an int16.
@@ -548,7 +548,7 @@ Returns:
548
548
  ### DataStructures.**tagUint8**
549
549
 
550
550
  ```grain
551
- tagUint8 : (int: WasmI32) => Uint8
551
+ tagUint8: (int: WasmI32) => Uint8
552
552
  ```
553
553
 
554
554
  Tag a uint8.
@@ -568,7 +568,7 @@ Returns:
568
568
  ### DataStructures.**untagUint8**
569
569
 
570
570
  ```grain
571
- untagUint8 : (int: Uint8) => WasmI32
571
+ untagUint8: (int: Uint8) => WasmI32
572
572
  ```
573
573
 
574
574
  Untag a uint8.
@@ -588,7 +588,7 @@ Returns:
588
588
  ### DataStructures.**tagUint16**
589
589
 
590
590
  ```grain
591
- tagUint16 : (int: WasmI32) => Uint16
591
+ tagUint16: (int: WasmI32) => Uint16
592
592
  ```
593
593
 
594
594
  Tag a uint16.
@@ -608,7 +608,7 @@ Returns:
608
608
  ### DataStructures.**untagUint16**
609
609
 
610
610
  ```grain
611
- untagUint16 : (int: Uint16) => WasmI32
611
+ untagUint16: (int: Uint16) => WasmI32
612
612
  ```
613
613
 
614
614
  Untag a uint16.
@@ -1,3 +1,4 @@
1
+ @noPervasives
1
2
  module DebugPrint
2
3
 
3
4
  from "runtime/numberUtils" include NumberUtils as Utils
@@ -9,6 +10,8 @@ from "runtime/unsafe/memory" include Memory
9
10
  foreign wasm fd_write:
10
11
  (WasmI32, WasmI32, WasmI32, WasmI32) => WasmI32 from "wasi_snapshot_preview1"
11
12
 
13
+ primitive ignore = "@ignore"
14
+
12
15
  @unsafe
13
16
  provide let print = (s: String) => {
14
17
  let ptr = WasmI32.fromGrain(s)
@@ -26,7 +29,7 @@ provide let print = (s: String) => {
26
29
  WasmI32.store(iov, 1n, 12n)
27
30
  fd_write(1n, iov, 2n, written)
28
31
  Memory.free(buf)
29
- void
32
+ ignore(s)
30
33
  }
31
34
 
32
35
  @unsafe