@grain/stdlib 0.5.13 → 0.6.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 +201 -0
- package/LICENSE +1 -1
- package/README.md +25 -2
- package/array.gr +1512 -199
- package/array.md +2032 -94
- package/bigint.gr +239 -140
- package/bigint.md +450 -106
- package/buffer.gr +595 -102
- package/buffer.md +903 -145
- package/bytes.gr +401 -110
- package/bytes.md +551 -63
- package/char.gr +228 -49
- package/char.md +373 -7
- package/exception.gr +26 -12
- package/exception.md +29 -5
- package/float32.gr +130 -109
- package/float32.md +185 -57
- package/float64.gr +112 -99
- package/float64.md +185 -57
- package/hash.gr +62 -40
- package/hash.md +27 -3
- package/int16.gr +430 -0
- package/int16.md +618 -0
- package/int32.gr +200 -269
- package/int32.md +254 -289
- package/int64.gr +142 -225
- package/int64.md +254 -289
- package/int8.gr +511 -0
- package/int8.md +786 -0
- package/json.gr +2071 -0
- package/json.md +646 -0
- package/list.gr +120 -68
- package/list.md +125 -80
- package/map.gr +560 -57
- package/map.md +672 -56
- package/marshal.gr +239 -227
- package/marshal.md +36 -4
- package/number.gr +626 -676
- package/number.md +738 -153
- package/option.gr +33 -35
- package/option.md +58 -42
- package/package.json +2 -2
- package/path.gr +148 -187
- package/path.md +47 -96
- package/pervasives.gr +75 -416
- package/pervasives.md +85 -180
- package/priorityqueue.gr +433 -74
- package/priorityqueue.md +422 -54
- package/queue.gr +362 -80
- package/queue.md +433 -38
- package/random.gr +67 -75
- package/random.md +68 -40
- package/range.gr +135 -63
- package/range.md +198 -43
- package/rational.gr +284 -0
- package/rational.md +545 -0
- package/regex.gr +933 -1066
- package/regex.md +59 -60
- package/result.gr +23 -25
- package/result.md +54 -39
- package/runtime/atof/common.gr +78 -82
- package/runtime/atof/common.md +22 -10
- package/runtime/atof/decimal.gr +102 -127
- package/runtime/atof/decimal.md +28 -7
- package/runtime/atof/lemire.gr +56 -71
- package/runtime/atof/lemire.md +9 -1
- package/runtime/atof/parse.gr +83 -110
- package/runtime/atof/parse.md +12 -2
- package/runtime/atof/slow.gr +28 -35
- package/runtime/atof/slow.md +9 -1
- package/runtime/atof/table.gr +19 -18
- package/runtime/atof/table.md +10 -2
- package/runtime/atoi/parse.gr +153 -136
- package/runtime/atoi/parse.md +50 -1
- package/runtime/bigint.gr +410 -517
- package/runtime/bigint.md +71 -57
- package/runtime/compare.gr +176 -85
- package/runtime/compare.md +31 -1
- package/runtime/dataStructures.gr +144 -32
- package/runtime/dataStructures.md +267 -31
- package/runtime/debugPrint.gr +34 -15
- package/runtime/debugPrint.md +37 -5
- package/runtime/equal.gr +53 -52
- package/runtime/equal.md +30 -1
- package/runtime/exception.gr +38 -47
- package/runtime/exception.md +10 -8
- package/runtime/gc.gr +23 -152
- package/runtime/gc.md +13 -17
- package/runtime/malloc.gr +31 -31
- package/runtime/malloc.md +11 -3
- package/runtime/numberUtils.gr +193 -174
- package/runtime/numberUtils.md +29 -9
- package/runtime/numbers.gr +1695 -1021
- package/runtime/numbers.md +1098 -134
- package/runtime/string.gr +543 -245
- package/runtime/string.md +76 -6
- package/runtime/unsafe/constants.gr +30 -13
- package/runtime/unsafe/constants.md +80 -0
- package/runtime/unsafe/conv.gr +55 -28
- package/runtime/unsafe/conv.md +41 -9
- package/runtime/unsafe/memory.gr +10 -30
- package/runtime/unsafe/memory.md +15 -19
- package/runtime/unsafe/tags.gr +37 -21
- package/runtime/unsafe/tags.md +88 -8
- package/runtime/unsafe/wasmf32.gr +30 -36
- package/runtime/unsafe/wasmf32.md +64 -56
- package/runtime/unsafe/wasmf64.gr +30 -36
- package/runtime/unsafe/wasmf64.md +64 -56
- package/runtime/unsafe/wasmi32.gr +49 -66
- package/runtime/unsafe/wasmi32.md +102 -94
- package/runtime/unsafe/wasmi64.gr +52 -79
- package/runtime/unsafe/wasmi64.md +108 -100
- package/runtime/utils/printing.gr +13 -15
- package/runtime/utils/printing.md +11 -3
- package/runtime/wasi.gr +294 -295
- package/runtime/wasi.md +62 -42
- package/set.gr +574 -64
- package/set.md +634 -54
- package/stack.gr +181 -64
- package/stack.md +271 -42
- package/string.gr +453 -533
- package/string.md +241 -151
- package/uint16.gr +369 -0
- package/uint16.md +585 -0
- package/uint32.gr +470 -0
- package/uint32.md +737 -0
- package/uint64.gr +471 -0
- package/uint64.md +737 -0
- package/uint8.gr +369 -0
- package/uint8.md +585 -0
- package/uri.gr +1093 -0
- package/uri.md +477 -0
- package/{sys → wasi}/file.gr +914 -500
- package/{sys → wasi}/file.md +454 -50
- package/wasi/process.gr +292 -0
- package/{sys → wasi}/process.md +164 -6
- package/wasi/random.gr +77 -0
- package/wasi/random.md +80 -0
- package/{sys → wasi}/time.gr +15 -22
- package/{sys → wasi}/time.md +5 -5
- package/immutablearray.gr +0 -929
- package/immutablearray.md +0 -1038
- package/immutablemap.gr +0 -493
- package/immutablemap.md +0 -479
- package/immutablepriorityqueue.gr +0 -360
- package/immutablepriorityqueue.md +0 -291
- package/immutableset.gr +0 -498
- package/immutableset.md +0 -449
- package/runtime/debug.gr +0 -2
- package/runtime/debug.md +0 -6
- package/runtime/unsafe/errors.gr +0 -36
- package/runtime/unsafe/errors.md +0 -204
- package/sys/process.gr +0 -254
- package/sys/random.gr +0 -79
- package/sys/random.md +0 -66
package/immutableset.md
DELETED
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: ImmutableSet
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
An ImmutableSet is a collection of unique values. Operations on an ImmutableSet do not mutate the set's internal state.
|
|
6
|
-
|
|
7
|
-
<details disabled>
|
|
8
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
9
|
-
No other changes yet.
|
|
10
|
-
</details>
|
|
11
|
-
|
|
12
|
-
```grain
|
|
13
|
-
import ImmutableSet from "immutableset"
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Types
|
|
17
|
-
|
|
18
|
-
Type declarations included in the ImmutableSet module.
|
|
19
|
-
|
|
20
|
-
### ImmutableSet.**ImmutableSet**
|
|
21
|
-
|
|
22
|
-
```grain
|
|
23
|
-
type ImmutableSet<a>
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Values
|
|
27
|
-
|
|
28
|
-
Functions and constants for working with ImmutableSets.
|
|
29
|
-
|
|
30
|
-
### ImmutableSet.**empty**
|
|
31
|
-
|
|
32
|
-
<details disabled>
|
|
33
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
34
|
-
No other changes yet.
|
|
35
|
-
</details>
|
|
36
|
-
|
|
37
|
-
```grain
|
|
38
|
-
empty : ImmutableSet<a>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
An empty set
|
|
42
|
-
|
|
43
|
-
### ImmutableSet.**size**
|
|
44
|
-
|
|
45
|
-
<details disabled>
|
|
46
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
47
|
-
No other changes yet.
|
|
48
|
-
</details>
|
|
49
|
-
|
|
50
|
-
```grain
|
|
51
|
-
size : ImmutableSet<a> -> Number
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Provides the count of values within the set.
|
|
55
|
-
|
|
56
|
-
Parameters:
|
|
57
|
-
|
|
58
|
-
|param|type|description|
|
|
59
|
-
|-----|----|-----------|
|
|
60
|
-
|`set`|`ImmutableSet<a>`|The set to inspect|
|
|
61
|
-
|
|
62
|
-
Returns:
|
|
63
|
-
|
|
64
|
-
|type|description|
|
|
65
|
-
|----|-----------|
|
|
66
|
-
|`Number`|The count of elements in the set|
|
|
67
|
-
|
|
68
|
-
### ImmutableSet.**isEmpty**
|
|
69
|
-
|
|
70
|
-
<details disabled>
|
|
71
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
72
|
-
No other changes yet.
|
|
73
|
-
</details>
|
|
74
|
-
|
|
75
|
-
```grain
|
|
76
|
-
isEmpty : ImmutableSet<a> -> Bool
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Determines if the set contains no elements.
|
|
80
|
-
|
|
81
|
-
Parameters:
|
|
82
|
-
|
|
83
|
-
|param|type|description|
|
|
84
|
-
|-----|----|-----------|
|
|
85
|
-
|`set`|`ImmutableSet<a>`|The set to inspect|
|
|
86
|
-
|
|
87
|
-
Returns:
|
|
88
|
-
|
|
89
|
-
|type|description|
|
|
90
|
-
|----|-----------|
|
|
91
|
-
|`Bool`|`true` if the given set is empty or `false` otherwise|
|
|
92
|
-
|
|
93
|
-
### ImmutableSet.**add**
|
|
94
|
-
|
|
95
|
-
<details disabled>
|
|
96
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
97
|
-
No other changes yet.
|
|
98
|
-
</details>
|
|
99
|
-
|
|
100
|
-
```grain
|
|
101
|
-
add : (a, ImmutableSet<a>) -> ImmutableSet<a>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Produces a new set by inserting the given value into the set. If the value
|
|
105
|
-
already exists, the new set will have the same elements as the input set.
|
|
106
|
-
|
|
107
|
-
Parameters:
|
|
108
|
-
|
|
109
|
-
|param|type|description|
|
|
110
|
-
|-----|----|-----------|
|
|
111
|
-
|`key`|`a`|The value to add|
|
|
112
|
-
|`set`|`ImmutableSet<a>`|The base set|
|
|
113
|
-
|
|
114
|
-
Returns:
|
|
115
|
-
|
|
116
|
-
|type|description|
|
|
117
|
-
|----|-----------|
|
|
118
|
-
|`ImmutableSet<a>`|A new set containing the new element|
|
|
119
|
-
|
|
120
|
-
### ImmutableSet.**contains**
|
|
121
|
-
|
|
122
|
-
<details disabled>
|
|
123
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
124
|
-
No other changes yet.
|
|
125
|
-
</details>
|
|
126
|
-
|
|
127
|
-
```grain
|
|
128
|
-
contains : (a, ImmutableSet<a>) -> Bool
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Determines if the set contains the given value.
|
|
132
|
-
|
|
133
|
-
Parameters:
|
|
134
|
-
|
|
135
|
-
|param|type|description|
|
|
136
|
-
|-----|----|-----------|
|
|
137
|
-
|`key`|`a`|The value to search for|
|
|
138
|
-
|`set`|`ImmutableSet<a>`|The set to search|
|
|
139
|
-
|
|
140
|
-
Returns:
|
|
141
|
-
|
|
142
|
-
|type|description|
|
|
143
|
-
|----|-----------|
|
|
144
|
-
|`Bool`|`true` if the set contains the given value or `false` otherwise|
|
|
145
|
-
|
|
146
|
-
### ImmutableSet.**remove**
|
|
147
|
-
|
|
148
|
-
<details disabled>
|
|
149
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
150
|
-
No other changes yet.
|
|
151
|
-
</details>
|
|
152
|
-
|
|
153
|
-
```grain
|
|
154
|
-
remove : (a, ImmutableSet<a>) -> ImmutableSet<a>
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Produces a new set without the given element. If the value doesn't exist in
|
|
158
|
-
the set, the set will be returned unmodified.
|
|
159
|
-
|
|
160
|
-
Parameters:
|
|
161
|
-
|
|
162
|
-
|param|type|description|
|
|
163
|
-
|-----|----|-----------|
|
|
164
|
-
|`key`|`a`|The value to exclude|
|
|
165
|
-
|`set`|`ImmutableSet<a>`|The set to exclude from|
|
|
166
|
-
|
|
167
|
-
Returns:
|
|
168
|
-
|
|
169
|
-
|type|description|
|
|
170
|
-
|----|-----------|
|
|
171
|
-
|`ImmutableSet<a>`|A new set without the excluded element|
|
|
172
|
-
|
|
173
|
-
### ImmutableSet.**forEach**
|
|
174
|
-
|
|
175
|
-
<details disabled>
|
|
176
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
177
|
-
No other changes yet.
|
|
178
|
-
</details>
|
|
179
|
-
|
|
180
|
-
```grain
|
|
181
|
-
forEach : ((a -> Void), ImmutableSet<a>) -> Void
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
Iterates the set, calling an iterator function on each element.
|
|
185
|
-
|
|
186
|
-
Parameters:
|
|
187
|
-
|
|
188
|
-
|param|type|description|
|
|
189
|
-
|-----|----|-----------|
|
|
190
|
-
|`fn`|`a -> Void`|The iterator function to call with each element|
|
|
191
|
-
|`set`|`ImmutableSet<a>`|The set to iterate|
|
|
192
|
-
|
|
193
|
-
### ImmutableSet.**reduce**
|
|
194
|
-
|
|
195
|
-
<details disabled>
|
|
196
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
197
|
-
No other changes yet.
|
|
198
|
-
</details>
|
|
199
|
-
|
|
200
|
-
```grain
|
|
201
|
-
reduce : (((a, b) -> a), a, ImmutableSet<b>) -> a
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
Combines all elements of a set using a reducer function.
|
|
205
|
-
|
|
206
|
-
Parameters:
|
|
207
|
-
|
|
208
|
-
|param|type|description|
|
|
209
|
-
|-----|----|-----------|
|
|
210
|
-
|`fn`|`(a, b) -> a`|The reducer function to call on each element, where the value returned will be the next accumulator value|
|
|
211
|
-
|`init`|`a`|The initial value to use for the accumulator on the first iteration|
|
|
212
|
-
|`set`|`ImmutableSet<b>`|The set to iterate|
|
|
213
|
-
|
|
214
|
-
Returns:
|
|
215
|
-
|
|
216
|
-
|type|description|
|
|
217
|
-
|----|-----------|
|
|
218
|
-
|`a`|The final accumulator returned from `fn`|
|
|
219
|
-
|
|
220
|
-
### ImmutableSet.**filter**
|
|
221
|
-
|
|
222
|
-
<details disabled>
|
|
223
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
224
|
-
No other changes yet.
|
|
225
|
-
</details>
|
|
226
|
-
|
|
227
|
-
```grain
|
|
228
|
-
filter : ((a -> Bool), ImmutableSet<a>) -> ImmutableSet<a>
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
Produces a new set without the elements from the input set where a predicate function returns `false`.
|
|
232
|
-
|
|
233
|
-
Parameters:
|
|
234
|
-
|
|
235
|
-
|param|type|description|
|
|
236
|
-
|-----|----|-----------|
|
|
237
|
-
|`fn`|`a -> Bool`|The predicate function to indicate which elements to exclude from the set, where returning `false` indicates the value should be excluded|
|
|
238
|
-
|`set`|`ImmutableSet<a>`|The set to iterate|
|
|
239
|
-
|
|
240
|
-
Returns:
|
|
241
|
-
|
|
242
|
-
|type|description|
|
|
243
|
-
|----|-----------|
|
|
244
|
-
|`ImmutableSet<a>`|A new set excluding the elements not fulfilling the predicate|
|
|
245
|
-
|
|
246
|
-
### ImmutableSet.**reject**
|
|
247
|
-
|
|
248
|
-
<details disabled>
|
|
249
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
250
|
-
No other changes yet.
|
|
251
|
-
</details>
|
|
252
|
-
|
|
253
|
-
```grain
|
|
254
|
-
reject : ((a -> Bool), ImmutableSet<a>) -> ImmutableSet<a>
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
Produces a new set without the elements from the input set where a predicate function returns `true`.
|
|
258
|
-
|
|
259
|
-
Parameters:
|
|
260
|
-
|
|
261
|
-
|param|type|description|
|
|
262
|
-
|-----|----|-----------|
|
|
263
|
-
|`fn`|`a -> Bool`|The predicate function to indicate which elements to exclude from the set, where returning `true` indicates the value should be excluded|
|
|
264
|
-
|`set`|`ImmutableSet<a>`|The set to iterate|
|
|
265
|
-
|
|
266
|
-
Returns:
|
|
267
|
-
|
|
268
|
-
|type|description|
|
|
269
|
-
|----|-----------|
|
|
270
|
-
|`ImmutableSet<a>`|A new set excluding the elements fulfilling the predicate|
|
|
271
|
-
|
|
272
|
-
### ImmutableSet.**union**
|
|
273
|
-
|
|
274
|
-
<details disabled>
|
|
275
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
276
|
-
No other changes yet.
|
|
277
|
-
</details>
|
|
278
|
-
|
|
279
|
-
```grain
|
|
280
|
-
union : (ImmutableSet<a>, ImmutableSet<a>) -> ImmutableSet<a>
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
Combines two sets into a single set containing all elements from both sets.
|
|
284
|
-
|
|
285
|
-
Parameters:
|
|
286
|
-
|
|
287
|
-
|param|type|description|
|
|
288
|
-
|-----|----|-----------|
|
|
289
|
-
|`set1`|`ImmutableSet<a>`|The first set to combine|
|
|
290
|
-
|`set2`|`ImmutableSet<a>`|The second set to combine|
|
|
291
|
-
|
|
292
|
-
Returns:
|
|
293
|
-
|
|
294
|
-
|type|description|
|
|
295
|
-
|----|-----------|
|
|
296
|
-
|`ImmutableSet<a>`|A set containing all elements of both sets|
|
|
297
|
-
|
|
298
|
-
### ImmutableSet.**diff**
|
|
299
|
-
|
|
300
|
-
<details disabled>
|
|
301
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
302
|
-
No other changes yet.
|
|
303
|
-
</details>
|
|
304
|
-
|
|
305
|
-
```grain
|
|
306
|
-
diff : (ImmutableSet<a>, ImmutableSet<a>) -> ImmutableSet<a>
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
Combines two sets into a single set containing only the elements not shared between both sets.
|
|
310
|
-
|
|
311
|
-
Parameters:
|
|
312
|
-
|
|
313
|
-
|param|type|description|
|
|
314
|
-
|-----|----|-----------|
|
|
315
|
-
|`set1`|`ImmutableSet<a>`|The first set to combine|
|
|
316
|
-
|`set2`|`ImmutableSet<a>`|The second set to combine|
|
|
317
|
-
|
|
318
|
-
Returns:
|
|
319
|
-
|
|
320
|
-
|type|description|
|
|
321
|
-
|----|-----------|
|
|
322
|
-
|`ImmutableSet<a>`|A set containing only unshared elements from both sets|
|
|
323
|
-
|
|
324
|
-
### ImmutableSet.**intersect**
|
|
325
|
-
|
|
326
|
-
<details disabled>
|
|
327
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
328
|
-
No other changes yet.
|
|
329
|
-
</details>
|
|
330
|
-
|
|
331
|
-
```grain
|
|
332
|
-
intersect : (ImmutableSet<a>, ImmutableSet<a>) -> ImmutableSet<a>
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
Combines two sets into a single set containing only the elements shared between both sets.
|
|
336
|
-
|
|
337
|
-
Parameters:
|
|
338
|
-
|
|
339
|
-
|param|type|description|
|
|
340
|
-
|-----|----|-----------|
|
|
341
|
-
|`set1`|`ImmutableSet<a>`|The first set to combine|
|
|
342
|
-
|`set2`|`ImmutableSet<a>`|The second set to combine|
|
|
343
|
-
|
|
344
|
-
Returns:
|
|
345
|
-
|
|
346
|
-
|type|description|
|
|
347
|
-
|----|-----------|
|
|
348
|
-
|`ImmutableSet<a>`|A set containing only shared elements from both sets|
|
|
349
|
-
|
|
350
|
-
### ImmutableSet.**fromList**
|
|
351
|
-
|
|
352
|
-
<details disabled>
|
|
353
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
354
|
-
No other changes yet.
|
|
355
|
-
</details>
|
|
356
|
-
|
|
357
|
-
```grain
|
|
358
|
-
fromList : List<a> -> ImmutableSet<a>
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
Creates a set from a list.
|
|
362
|
-
|
|
363
|
-
Parameters:
|
|
364
|
-
|
|
365
|
-
|param|type|description|
|
|
366
|
-
|-----|----|-----------|
|
|
367
|
-
|`list`|`List<a>`|The list to convert|
|
|
368
|
-
|
|
369
|
-
Returns:
|
|
370
|
-
|
|
371
|
-
|type|description|
|
|
372
|
-
|----|-----------|
|
|
373
|
-
|`ImmutableSet<a>`|A set containing all list values|
|
|
374
|
-
|
|
375
|
-
### ImmutableSet.**toList**
|
|
376
|
-
|
|
377
|
-
<details disabled>
|
|
378
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
379
|
-
No other changes yet.
|
|
380
|
-
</details>
|
|
381
|
-
|
|
382
|
-
```grain
|
|
383
|
-
toList : ImmutableSet<a> -> List<a>
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
Converts a set into a list of its elements.
|
|
387
|
-
|
|
388
|
-
Parameters:
|
|
389
|
-
|
|
390
|
-
|param|type|description|
|
|
391
|
-
|-----|----|-----------|
|
|
392
|
-
|`set`|`ImmutableSet<a>`|The set to convert|
|
|
393
|
-
|
|
394
|
-
Returns:
|
|
395
|
-
|
|
396
|
-
|type|description|
|
|
397
|
-
|----|-----------|
|
|
398
|
-
|`List<a>`|A list containing all set values|
|
|
399
|
-
|
|
400
|
-
### ImmutableSet.**fromArray**
|
|
401
|
-
|
|
402
|
-
<details disabled>
|
|
403
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
404
|
-
No other changes yet.
|
|
405
|
-
</details>
|
|
406
|
-
|
|
407
|
-
```grain
|
|
408
|
-
fromArray : Array<a> -> ImmutableSet<a>
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
Creates a set from an array.
|
|
412
|
-
|
|
413
|
-
Parameters:
|
|
414
|
-
|
|
415
|
-
|param|type|description|
|
|
416
|
-
|-----|----|-----------|
|
|
417
|
-
|`array`|`Array<a>`|The array to convert|
|
|
418
|
-
|
|
419
|
-
Returns:
|
|
420
|
-
|
|
421
|
-
|type|description|
|
|
422
|
-
|----|-----------|
|
|
423
|
-
|`ImmutableSet<a>`|A set containing all array values|
|
|
424
|
-
|
|
425
|
-
### ImmutableSet.**toArray**
|
|
426
|
-
|
|
427
|
-
<details disabled>
|
|
428
|
-
<summary tabindex="-1">Added in <code>0.5.4</code></summary>
|
|
429
|
-
No other changes yet.
|
|
430
|
-
</details>
|
|
431
|
-
|
|
432
|
-
```grain
|
|
433
|
-
toArray : ImmutableSet<a> -> Array<a>
|
|
434
|
-
```
|
|
435
|
-
|
|
436
|
-
Converts a set into an array of its elements.
|
|
437
|
-
|
|
438
|
-
Parameters:
|
|
439
|
-
|
|
440
|
-
|param|type|description|
|
|
441
|
-
|-----|----|-----------|
|
|
442
|
-
|`set`|`ImmutableSet<a>`|The set to convert|
|
|
443
|
-
|
|
444
|
-
Returns:
|
|
445
|
-
|
|
446
|
-
|type|description|
|
|
447
|
-
|----|-----------|
|
|
448
|
-
|`Array<a>`|An array containing all set values|
|
|
449
|
-
|
package/runtime/debug.gr
DELETED
package/runtime/debug.md
DELETED
package/runtime/unsafe/errors.gr
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/* grainc-flags --compilation-mode=runtime */
|
|
2
|
-
|
|
3
|
-
export let _GRAIN_ERR_NOT_NUMBER_COMP = 0n
|
|
4
|
-
export let _GRAIN_ERR_NOT_NUMBER_ARITH = 1n
|
|
5
|
-
export let _GRAIN_ERR_NOT_BOOLEAN_LOGIC = 2n
|
|
6
|
-
export let _GRAIN_ERR_NOT_BOOLEAN_IF = 3n
|
|
7
|
-
export let _GRAIN_ERR_OVERFLOW = 4n
|
|
8
|
-
export let _GRAIN_ERR_GET_NOT_TUP = 5n
|
|
9
|
-
export let _GRAIN_ERR_GET_ITEM_IDX_NOT_NUMBER = 6n
|
|
10
|
-
export let _GRAIN_ERR_GET_ITEM_IDX_TOO_SMALL = 7n
|
|
11
|
-
export let _GRAIN_ERR_GET_ITEM_IDX_TOO_LARGE = 8n
|
|
12
|
-
export let _GRAIN_ERR_CALLED_NON_FUNCTION = 9n
|
|
13
|
-
export let _GRAIN_ERR_ARITY_MISMATCH = 10n
|
|
14
|
-
export let _GRAIN_ERR_OUT_OF_MEMORY = 11n
|
|
15
|
-
export let _GRAIN_ERR_SET_NOT_TUP = 12n
|
|
16
|
-
export let _GRAIN_ERR_SET_ITEM_IDX_NOT_NUMBER = 13n
|
|
17
|
-
export let _GRAIN_ERR_SET_ITEM_IDX_TOO_SMALL = 14n
|
|
18
|
-
export let _GRAIN_ERR_SET_ITEM_IDX_TOO_LARGE = 15n
|
|
19
|
-
export let _GRAIN_ERR_DIVISION_BY_ZERO = 17n
|
|
20
|
-
export let _GRAIN_ERR_MODULO_BY_ZERO = 18n
|
|
21
|
-
export let _GRAIN_ERR_ARRAY_INDEX_OUT_OF_BOUNDS = 19n
|
|
22
|
-
export let _GRAIN_ERR_INVALID_ARGUMENT = 20n
|
|
23
|
-
export let _GRAIN_ERR_ASSERTION_ERROR = 21n
|
|
24
|
-
export let _GRAIN_ERR_FAILURE = 22n
|
|
25
|
-
export let _GRAIN_ERR_SYSTEM = 23n
|
|
26
|
-
export let _GRAIN_ERR_NOT_INTLIKE = 24n
|
|
27
|
-
export let _GRAIN_ERR_NOT_RATIONAL = 25n
|
|
28
|
-
export let _GRAIN_ERR_MALFORMED_UTF8 = 26n
|
|
29
|
-
export let _GRAIN_ERR_NOT_ADT_VAL_GENERIC = 91n
|
|
30
|
-
export let _GRAIN_ERR_NOT_STRING_GENERIC = 93n
|
|
31
|
-
export let _GRAIN_ERR_NOT_BOOLEAN_GENERIC = 94n
|
|
32
|
-
export let _GRAIN_ERR_NOT_TUPLE_GENERIC = 95n
|
|
33
|
-
export let _GRAIN_ERR_NOT_LAMBDA_GENERIC = 96n
|
|
34
|
-
export let _GRAIN_ERR_BAD_INPUT = 97n
|
|
35
|
-
export let _GRAIN_ERR_NOT_NONNEG = 98n
|
|
36
|
-
export let _GRAIN_ERR_NOT_NUMBER_GENERIC = 99n
|
package/runtime/unsafe/errors.md
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
### Errors.**_GRAIN_ERR_NOT_NUMBER_COMP**
|
|
2
|
-
|
|
3
|
-
```grain
|
|
4
|
-
_GRAIN_ERR_NOT_NUMBER_COMP : WasmI32
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
### Errors.**_GRAIN_ERR_NOT_NUMBER_ARITH**
|
|
8
|
-
|
|
9
|
-
```grain
|
|
10
|
-
_GRAIN_ERR_NOT_NUMBER_ARITH : WasmI32
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Errors.**_GRAIN_ERR_NOT_BOOLEAN_LOGIC**
|
|
14
|
-
|
|
15
|
-
```grain
|
|
16
|
-
_GRAIN_ERR_NOT_BOOLEAN_LOGIC : WasmI32
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### Errors.**_GRAIN_ERR_NOT_BOOLEAN_IF**
|
|
20
|
-
|
|
21
|
-
```grain
|
|
22
|
-
_GRAIN_ERR_NOT_BOOLEAN_IF : WasmI32
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Errors.**_GRAIN_ERR_OVERFLOW**
|
|
26
|
-
|
|
27
|
-
```grain
|
|
28
|
-
_GRAIN_ERR_OVERFLOW : WasmI32
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Errors.**_GRAIN_ERR_GET_NOT_TUP**
|
|
32
|
-
|
|
33
|
-
```grain
|
|
34
|
-
_GRAIN_ERR_GET_NOT_TUP : WasmI32
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Errors.**_GRAIN_ERR_GET_ITEM_IDX_NOT_NUMBER**
|
|
38
|
-
|
|
39
|
-
```grain
|
|
40
|
-
_GRAIN_ERR_GET_ITEM_IDX_NOT_NUMBER : WasmI32
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Errors.**_GRAIN_ERR_GET_ITEM_IDX_TOO_SMALL**
|
|
44
|
-
|
|
45
|
-
```grain
|
|
46
|
-
_GRAIN_ERR_GET_ITEM_IDX_TOO_SMALL : WasmI32
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Errors.**_GRAIN_ERR_GET_ITEM_IDX_TOO_LARGE**
|
|
50
|
-
|
|
51
|
-
```grain
|
|
52
|
-
_GRAIN_ERR_GET_ITEM_IDX_TOO_LARGE : WasmI32
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Errors.**_GRAIN_ERR_CALLED_NON_FUNCTION**
|
|
56
|
-
|
|
57
|
-
```grain
|
|
58
|
-
_GRAIN_ERR_CALLED_NON_FUNCTION : WasmI32
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Errors.**_GRAIN_ERR_ARITY_MISMATCH**
|
|
62
|
-
|
|
63
|
-
```grain
|
|
64
|
-
_GRAIN_ERR_ARITY_MISMATCH : WasmI32
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Errors.**_GRAIN_ERR_OUT_OF_MEMORY**
|
|
68
|
-
|
|
69
|
-
```grain
|
|
70
|
-
_GRAIN_ERR_OUT_OF_MEMORY : WasmI32
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Errors.**_GRAIN_ERR_SET_NOT_TUP**
|
|
74
|
-
|
|
75
|
-
```grain
|
|
76
|
-
_GRAIN_ERR_SET_NOT_TUP : WasmI32
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Errors.**_GRAIN_ERR_SET_ITEM_IDX_NOT_NUMBER**
|
|
80
|
-
|
|
81
|
-
```grain
|
|
82
|
-
_GRAIN_ERR_SET_ITEM_IDX_NOT_NUMBER : WasmI32
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Errors.**_GRAIN_ERR_SET_ITEM_IDX_TOO_SMALL**
|
|
86
|
-
|
|
87
|
-
```grain
|
|
88
|
-
_GRAIN_ERR_SET_ITEM_IDX_TOO_SMALL : WasmI32
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Errors.**_GRAIN_ERR_SET_ITEM_IDX_TOO_LARGE**
|
|
92
|
-
|
|
93
|
-
```grain
|
|
94
|
-
_GRAIN_ERR_SET_ITEM_IDX_TOO_LARGE : WasmI32
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Errors.**_GRAIN_ERR_DIVISION_BY_ZERO**
|
|
98
|
-
|
|
99
|
-
```grain
|
|
100
|
-
_GRAIN_ERR_DIVISION_BY_ZERO : WasmI32
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Errors.**_GRAIN_ERR_MODULO_BY_ZERO**
|
|
104
|
-
|
|
105
|
-
```grain
|
|
106
|
-
_GRAIN_ERR_MODULO_BY_ZERO : WasmI32
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Errors.**_GRAIN_ERR_ARRAY_INDEX_OUT_OF_BOUNDS**
|
|
110
|
-
|
|
111
|
-
```grain
|
|
112
|
-
_GRAIN_ERR_ARRAY_INDEX_OUT_OF_BOUNDS : WasmI32
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### Errors.**_GRAIN_ERR_INVALID_ARGUMENT**
|
|
116
|
-
|
|
117
|
-
```grain
|
|
118
|
-
_GRAIN_ERR_INVALID_ARGUMENT : WasmI32
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Errors.**_GRAIN_ERR_ASSERTION_ERROR**
|
|
122
|
-
|
|
123
|
-
```grain
|
|
124
|
-
_GRAIN_ERR_ASSERTION_ERROR : WasmI32
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Errors.**_GRAIN_ERR_FAILURE**
|
|
128
|
-
|
|
129
|
-
```grain
|
|
130
|
-
_GRAIN_ERR_FAILURE : WasmI32
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Errors.**_GRAIN_ERR_SYSTEM**
|
|
134
|
-
|
|
135
|
-
```grain
|
|
136
|
-
_GRAIN_ERR_SYSTEM : WasmI32
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Errors.**_GRAIN_ERR_NOT_INTLIKE**
|
|
140
|
-
|
|
141
|
-
```grain
|
|
142
|
-
_GRAIN_ERR_NOT_INTLIKE : WasmI32
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Errors.**_GRAIN_ERR_NOT_RATIONAL**
|
|
146
|
-
|
|
147
|
-
```grain
|
|
148
|
-
_GRAIN_ERR_NOT_RATIONAL : WasmI32
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Errors.**_GRAIN_ERR_MALFORMED_UTF8**
|
|
152
|
-
|
|
153
|
-
```grain
|
|
154
|
-
_GRAIN_ERR_MALFORMED_UTF8 : WasmI32
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### Errors.**_GRAIN_ERR_NOT_ADT_VAL_GENERIC**
|
|
158
|
-
|
|
159
|
-
```grain
|
|
160
|
-
_GRAIN_ERR_NOT_ADT_VAL_GENERIC : WasmI32
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### Errors.**_GRAIN_ERR_NOT_STRING_GENERIC**
|
|
164
|
-
|
|
165
|
-
```grain
|
|
166
|
-
_GRAIN_ERR_NOT_STRING_GENERIC : WasmI32
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Errors.**_GRAIN_ERR_NOT_BOOLEAN_GENERIC**
|
|
170
|
-
|
|
171
|
-
```grain
|
|
172
|
-
_GRAIN_ERR_NOT_BOOLEAN_GENERIC : WasmI32
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Errors.**_GRAIN_ERR_NOT_TUPLE_GENERIC**
|
|
176
|
-
|
|
177
|
-
```grain
|
|
178
|
-
_GRAIN_ERR_NOT_TUPLE_GENERIC : WasmI32
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Errors.**_GRAIN_ERR_NOT_LAMBDA_GENERIC**
|
|
182
|
-
|
|
183
|
-
```grain
|
|
184
|
-
_GRAIN_ERR_NOT_LAMBDA_GENERIC : WasmI32
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Errors.**_GRAIN_ERR_BAD_INPUT**
|
|
188
|
-
|
|
189
|
-
```grain
|
|
190
|
-
_GRAIN_ERR_BAD_INPUT : WasmI32
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Errors.**_GRAIN_ERR_NOT_NONNEG**
|
|
194
|
-
|
|
195
|
-
```grain
|
|
196
|
-
_GRAIN_ERR_NOT_NONNEG : WasmI32
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Errors.**_GRAIN_ERR_NOT_NUMBER_GENERIC**
|
|
200
|
-
|
|
201
|
-
```grain
|
|
202
|
-
_GRAIN_ERR_NOT_NUMBER_GENERIC : WasmI32
|
|
203
|
-
```
|
|
204
|
-
|