@grain/stdlib 0.6.6 → 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.
Files changed (137) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/LICENSE +1 -1
  3. package/README.md +2 -2
  4. package/array.gr +55 -7
  5. package/array.md +606 -560
  6. package/bigint.md +228 -228
  7. package/buffer.gr +85 -53
  8. package/buffer.md +442 -319
  9. package/bytes.gr +112 -35
  10. package/bytes.md +299 -219
  11. package/char.gr +201 -99
  12. package/char.md +447 -120
  13. package/exception.gr +11 -11
  14. package/exception.md +29 -4
  15. package/float32.gr +327 -3
  16. package/float32.md +698 -111
  17. package/float64.gr +320 -3
  18. package/float64.md +698 -111
  19. package/fs.gr +1082 -0
  20. package/fs.md +630 -0
  21. package/hash.gr +142 -88
  22. package/hash.md +105 -17
  23. package/int16.md +178 -178
  24. package/int32.gr +26 -5
  25. package/int32.md +266 -231
  26. package/int64.gr +27 -2
  27. package/int64.md +266 -231
  28. package/int8.md +178 -178
  29. package/json.gr +366 -51
  30. package/json.md +431 -15
  31. package/list.gr +328 -31
  32. package/list.md +759 -336
  33. package/map.gr +20 -12
  34. package/map.md +266 -260
  35. package/marshal.gr +41 -40
  36. package/marshal.md +14 -14
  37. package/number.gr +278 -35
  38. package/number.md +688 -269
  39. package/option.md +162 -162
  40. package/package.json +5 -3
  41. package/path.gr +48 -0
  42. package/path.md +180 -89
  43. package/pervasives.gr +2 -2
  44. package/pervasives.md +275 -275
  45. package/priorityqueue.gr +7 -7
  46. package/priorityqueue.md +131 -131
  47. package/queue.gr +183 -29
  48. package/queue.md +404 -148
  49. package/random.md +43 -43
  50. package/range.gr +4 -4
  51. package/range.md +42 -42
  52. package/rational.md +123 -123
  53. package/regex.gr +52 -51
  54. package/regex.md +102 -102
  55. package/result.md +118 -118
  56. package/runtime/atof/common.md +39 -39
  57. package/runtime/atof/decimal.gr +6 -6
  58. package/runtime/atof/decimal.md +14 -14
  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 +8 -8
  71. package/runtime/dataStructures.md +211 -211
  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 +8 -8
  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 +13 -13
  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 +348 -342
  98. package/runtime/string.gr +37 -105
  99. package/runtime/string.md +20 -26
  100. package/runtime/unsafe/constants.md +24 -24
  101. package/runtime/unsafe/conv.md +19 -19
  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 +147 -147
  117. package/set.gr +18 -11
  118. package/set.md +253 -247
  119. package/stack.gr +171 -2
  120. package/stack.md +371 -89
  121. package/string.gr +352 -557
  122. package/string.md +298 -255
  123. package/uint16.md +170 -170
  124. package/uint32.gr +25 -4
  125. package/uint32.md +249 -214
  126. package/uint64.gr +25 -5
  127. package/uint64.md +249 -214
  128. package/uint8.md +170 -170
  129. package/uri.gr +57 -53
  130. package/uri.md +88 -89
  131. package/wasi/file.gr +67 -59
  132. package/wasi/file.md +308 -308
  133. package/wasi/process.md +26 -26
  134. package/wasi/random.md +12 -12
  135. package/wasi/time.md +16 -16
  136. package/runtime/utils/printing.gr +0 -60
  137. package/runtime/utils/printing.md +0 -26
package/set.md CHANGED
@@ -55,7 +55,7 @@ Functions and constants included in the Set module.
55
55
  </details>
56
56
 
57
57
  ```grain
58
- make : (?size: Number) => Set<a>
58
+ make: (?size: Number) => Set<a>
59
59
  ```
60
60
 
61
61
  Creates a new empty set with an initial storage of the given size. As
@@ -65,15 +65,21 @@ can use the default size.
65
65
 
66
66
  Parameters:
67
67
 
68
- |param|type|description|
69
- |-----|----|-----------|
70
- |`?size`|`Number`|The initial storage size of the set|
68
+ | param | type | description |
69
+ | ------- | -------- | ----------------------------------- |
70
+ | `?size` | `Number` | The initial storage size of the set |
71
71
 
72
72
  Returns:
73
73
 
74
- |type|description|
75
- |----|-----------|
76
- |`Set<a>`|An empty set with the given initial storage size|
74
+ | type | description |
75
+ | -------- | ------------------------------------------------ |
76
+ | `Set<a>` | An empty set with the given initial storage size |
77
+
78
+ Throws:
79
+
80
+ `Failure(String)`
81
+
82
+ * If WASI random_get fails
77
83
 
78
84
  ### Set.**add**
79
85
 
@@ -83,17 +89,17 @@ No other changes yet.
83
89
  </details>
84
90
 
85
91
  ```grain
86
- add : (key: a, set: Set<a>) => Void
92
+ add: (key: a, set: Set<a>) => Void
87
93
  ```
88
94
 
89
95
  Adds a new value to the set. If the value already exists, nothing happens.
90
96
 
91
97
  Parameters:
92
98
 
93
- |param|type|description|
94
- |-----|----|-----------|
95
- |`key`|`a`|The value to add|
96
- |`set`|`Set<a>`|The set to update|
99
+ | param | type | description |
100
+ | ----- | -------- | ----------------- |
101
+ | `key` | `a` | The value to add |
102
+ | `set` | `Set<a>` | The set to update |
97
103
 
98
104
  ### Set.**contains**
99
105
 
@@ -103,23 +109,23 @@ No other changes yet.
103
109
  </details>
104
110
 
105
111
  ```grain
106
- contains : (key: a, set: Set<a>) => Bool
112
+ contains: (key: a, set: Set<a>) => Bool
107
113
  ```
108
114
 
109
115
  Determines if the set contains the given value.
110
116
 
111
117
  Parameters:
112
118
 
113
- |param|type|description|
114
- |-----|----|-----------|
115
- |`key`|`a`|The value to search for|
116
- |`set`|`Set<a>`|The set to search|
119
+ | param | type | description |
120
+ | ----- | -------- | ----------------------- |
121
+ | `key` | `a` | The value to search for |
122
+ | `set` | `Set<a>` | The set to search |
117
123
 
118
124
  Returns:
119
125
 
120
- |type|description|
121
- |----|-----------|
122
- |`Bool`|`true` if the set contains the given value or `false` otherwise|
126
+ | type | description |
127
+ | ------ | --------------------------------------------------------------- |
128
+ | `Bool` | `true` if the set contains the given value or `false` otherwise |
123
129
 
124
130
  ### Set.**remove**
125
131
 
@@ -129,17 +135,17 @@ No other changes yet.
129
135
  </details>
130
136
 
131
137
  ```grain
132
- remove : (key: a, set: Set<a>) => Void
138
+ remove: (key: a, set: Set<a>) => Void
133
139
  ```
134
140
 
135
141
  Removes the given value from the set. If the value doesn't exist, nothing happens.
136
142
 
137
143
  Parameters:
138
144
 
139
- |param|type|description|
140
- |-----|----|-----------|
141
- |`key`|`a`|The value to remove|
142
- |`set`|`Set<a>`|The set to update|
145
+ | param | type | description |
146
+ | ----- | -------- | ------------------- |
147
+ | `key` | `a` | The value to remove |
148
+ | `set` | `Set<a>` | The set to update |
143
149
 
144
150
  ### Set.**size**
145
151
 
@@ -149,22 +155,22 @@ No other changes yet.
149
155
  </details>
150
156
 
151
157
  ```grain
152
- size : (set: Set<a>) => Number
158
+ size: (set: Set<a>) => Number
153
159
  ```
154
160
 
155
161
  Provides the count of values within the set.
156
162
 
157
163
  Parameters:
158
164
 
159
- |param|type|description|
160
- |-----|----|-----------|
161
- |`set`|`Set<a>`|The set to inspect|
165
+ | param | type | description |
166
+ | ----- | -------- | ------------------ |
167
+ | `set` | `Set<a>` | The set to inspect |
162
168
 
163
169
  Returns:
164
170
 
165
- |type|description|
166
- |----|-----------|
167
- |`Number`|The count of elements in the set|
171
+ | type | description |
172
+ | -------- | -------------------------------- |
173
+ | `Number` | The count of elements in the set |
168
174
 
169
175
  ### Set.**isEmpty**
170
176
 
@@ -174,22 +180,22 @@ No other changes yet.
174
180
  </details>
175
181
 
176
182
  ```grain
177
- isEmpty : (set: Set<a>) => Bool
183
+ isEmpty: (set: Set<a>) => Bool
178
184
  ```
179
185
 
180
186
  Determines if the set contains no elements.
181
187
 
182
188
  Parameters:
183
189
 
184
- |param|type|description|
185
- |-----|----|-----------|
186
- |`set`|`Set<a>`|The set to inspect|
190
+ | param | type | description |
191
+ | ----- | -------- | ------------------ |
192
+ | `set` | `Set<a>` | The set to inspect |
187
193
 
188
194
  Returns:
189
195
 
190
- |type|description|
191
- |----|-----------|
192
- |`Bool`|`true` if the given set is empty or `false` otherwise|
196
+ | type | description |
197
+ | ------ | ----------------------------------------------------- |
198
+ | `Bool` | `true` if the given set is empty or `false` otherwise |
193
199
 
194
200
  ### Set.**clear**
195
201
 
@@ -199,16 +205,16 @@ No other changes yet.
199
205
  </details>
200
206
 
201
207
  ```grain
202
- clear : (set: Set<a>) => Void
208
+ clear: (set: Set<a>) => Void
203
209
  ```
204
210
 
205
211
  Resets the set by removing all values.
206
212
 
207
213
  Parameters:
208
214
 
209
- |param|type|description|
210
- |-----|----|-----------|
211
- |`set`|`Set<a>`|The set to reset|
215
+ | param | type | description |
216
+ | ----- | -------- | ---------------- |
217
+ | `set` | `Set<a>` | The set to reset |
212
218
 
213
219
  ### Set.**forEach**
214
220
 
@@ -225,17 +231,17 @@ Parameters:
225
231
  </details>
226
232
 
227
233
  ```grain
228
- forEach : (fn: (a => Void), set: Set<a>) => Void
234
+ forEach: (fn: (a => Void), set: Set<a>) => Void
229
235
  ```
230
236
 
231
237
  Iterates the set, calling an iterator function on each element.
232
238
 
233
239
  Parameters:
234
240
 
235
- |param|type|description|
236
- |-----|----|-----------|
237
- |`fn`|`a => Void`|The iterator function to call with each element|
238
- |`set`|`Set<a>`|The set to iterate|
241
+ | param | type | description |
242
+ | ----- | ----------- | ----------------------------------------------- |
243
+ | `fn` | `a => Void` | The iterator function to call with each element |
244
+ | `set` | `Set<a>` | The set to iterate |
239
245
 
240
246
  ### Set.**reduce**
241
247
 
@@ -245,24 +251,24 @@ No other changes yet.
245
251
  </details>
246
252
 
247
253
  ```grain
248
- reduce : (fn: ((a, b) => a), init: a, set: Set<b>) => a
254
+ reduce: (fn: ((a, b) => a), init: a, set: Set<b>) => a
249
255
  ```
250
256
 
251
257
  Combines all elements of a set using a reducer function.
252
258
 
253
259
  Parameters:
254
260
 
255
- |param|type|description|
256
- |-----|----|-----------|
257
- |`fn`|`(a, b) => a`|The reducer function to call on each element, where the value returned will be the next accumulator value|
258
- |`init`|`a`|The initial value to use for the accumulator on the first iteration|
259
- |`set`|`Set<b>`|The set to iterate|
261
+ | param | type | description |
262
+ | ------ | ------------- | --------------------------------------------------------------------------------------------------------- |
263
+ | `fn` | `(a, b) => a` | The reducer function to call on each element, where the value returned will be the next accumulator value |
264
+ | `init` | `a` | The initial value to use for the accumulator on the first iteration |
265
+ | `set` | `Set<b>` | The set to iterate |
260
266
 
261
267
  Returns:
262
268
 
263
- |type|description|
264
- |----|-----------|
265
- |`a`|The final accumulator returned from `fn`|
269
+ | type | description |
270
+ | ---- | ---------------------------------------- |
271
+ | `a` | The final accumulator returned from `fn` |
266
272
 
267
273
  ### Set.**filter**
268
274
 
@@ -272,17 +278,17 @@ No other changes yet.
272
278
  </details>
273
279
 
274
280
  ```grain
275
- filter : (fn: (a => Bool), set: Set<a>) => Void
281
+ filter: (fn: (a => Bool), set: Set<a>) => Void
276
282
  ```
277
283
 
278
284
  Removes elements from a set where a predicate function returns `false`.
279
285
 
280
286
  Parameters:
281
287
 
282
- |param|type|description|
283
- |-----|----|-----------|
284
- |`fn`|`a => Bool`|The predicate function to indicate which elements to remove from the set, where returning `false` indicates the value should be removed|
285
- |`set`|`Set<a>`|The set to iterate|
288
+ | param | type | description |
289
+ | ----- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |
290
+ | `fn` | `a => Bool` | The predicate function to indicate which elements to remove from the set, where returning `false` indicates the value should be removed |
291
+ | `set` | `Set<a>` | The set to iterate |
286
292
 
287
293
  ### Set.**reject**
288
294
 
@@ -292,17 +298,17 @@ No other changes yet.
292
298
  </details>
293
299
 
294
300
  ```grain
295
- reject : (fn: (a => Bool), set: Set<a>) => Void
301
+ reject: (fn: (a => Bool), set: Set<a>) => Void
296
302
  ```
297
303
 
298
304
  Removes elements from a set where a predicate function returns `true`.
299
305
 
300
306
  Parameters:
301
307
 
302
- |param|type|description|
303
- |-----|----|-----------|
304
- |`fn`|`a => Bool`|The predicate function to indicate which elements to remove from the set, where returning `true` indicates the value should be removed|
305
- |`set`|`Set<a>`|The set to iterate|
308
+ | param | type | description |
309
+ | ----- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------- |
310
+ | `fn` | `a => Bool` | The predicate function to indicate which elements to remove from the set, where returning `true` indicates the value should be removed |
311
+ | `set` | `Set<a>` | The set to iterate |
306
312
 
307
313
  ### Set.**toList**
308
314
 
@@ -312,22 +318,22 @@ No other changes yet.
312
318
  </details>
313
319
 
314
320
  ```grain
315
- toList : (set: Set<a>) => List<a>
321
+ toList: (set: Set<a>) => List<a>
316
322
  ```
317
323
 
318
324
  Converts a set into a list of its elements.
319
325
 
320
326
  Parameters:
321
327
 
322
- |param|type|description|
323
- |-----|----|-----------|
324
- |`set`|`Set<a>`|The set to convert|
328
+ | param | type | description |
329
+ | ----- | -------- | ------------------ |
330
+ | `set` | `Set<a>` | The set to convert |
325
331
 
326
332
  Returns:
327
333
 
328
- |type|description|
329
- |----|-----------|
330
- |`List<a>`|A list containing all set values|
334
+ | type | description |
335
+ | --------- | -------------------------------- |
336
+ | `List<a>` | A list containing all set values |
331
337
 
332
338
  ### Set.**fromList**
333
339
 
@@ -337,22 +343,22 @@ No other changes yet.
337
343
  </details>
338
344
 
339
345
  ```grain
340
- fromList : (list: List<a>) => Set<a>
346
+ fromList: (list: List<a>) => Set<a>
341
347
  ```
342
348
 
343
349
  Creates a set from a list.
344
350
 
345
351
  Parameters:
346
352
 
347
- |param|type|description|
348
- |-----|----|-----------|
349
- |`list`|`List<a>`|The list to convert|
353
+ | param | type | description |
354
+ | ------ | --------- | ------------------- |
355
+ | `list` | `List<a>` | The list to convert |
350
356
 
351
357
  Returns:
352
358
 
353
- |type|description|
354
- |----|-----------|
355
- |`Set<a>`|A set containing all list values|
359
+ | type | description |
360
+ | -------- | -------------------------------- |
361
+ | `Set<a>` | A set containing all list values |
356
362
 
357
363
  ### Set.**toArray**
358
364
 
@@ -362,22 +368,22 @@ No other changes yet.
362
368
  </details>
363
369
 
364
370
  ```grain
365
- toArray : (set: Set<a>) => Array<a>
371
+ toArray: (set: Set<a>) => Array<a>
366
372
  ```
367
373
 
368
374
  Converts a set into an array of its elements.
369
375
 
370
376
  Parameters:
371
377
 
372
- |param|type|description|
373
- |-----|----|-----------|
374
- |`set`|`Set<a>`|The set to convert|
378
+ | param | type | description |
379
+ | ----- | -------- | ------------------ |
380
+ | `set` | `Set<a>` | The set to convert |
375
381
 
376
382
  Returns:
377
383
 
378
- |type|description|
379
- |----|-----------|
380
- |`Array<a>`|An array containing all set values|
384
+ | type | description |
385
+ | ---------- | ---------------------------------- |
386
+ | `Array<a>` | An array containing all set values |
381
387
 
382
388
  ### Set.**fromArray**
383
389
 
@@ -387,22 +393,22 @@ No other changes yet.
387
393
  </details>
388
394
 
389
395
  ```grain
390
- fromArray : (array: Array<a>) => Set<a>
396
+ fromArray: (array: Array<a>) => Set<a>
391
397
  ```
392
398
 
393
399
  Creates a set from an array.
394
400
 
395
401
  Parameters:
396
402
 
397
- |param|type|description|
398
- |-----|----|-----------|
399
- |`array`|`Array<a>`|The array to convert|
403
+ | param | type | description |
404
+ | ------- | ---------- | -------------------- |
405
+ | `array` | `Array<a>` | The array to convert |
400
406
 
401
407
  Returns:
402
408
 
403
- |type|description|
404
- |----|-----------|
405
- |`Set<a>`|A set containing all array values|
409
+ | type | description |
410
+ | -------- | --------------------------------- |
411
+ | `Set<a>` | A set containing all array values |
406
412
 
407
413
  ### Set.**union**
408
414
 
@@ -412,23 +418,23 @@ No other changes yet.
412
418
  </details>
413
419
 
414
420
  ```grain
415
- union : (set1: Set<a>, set2: Set<a>) => Set<a>
421
+ union: (set1: Set<a>, set2: Set<a>) => Set<a>
416
422
  ```
417
423
 
418
424
  Combines two sets into a single set containing all elements from both sets.
419
425
 
420
426
  Parameters:
421
427
 
422
- |param|type|description|
423
- |-----|----|-----------|
424
- |`set1`|`Set<a>`|The first set to combine|
425
- |`set2`|`Set<a>`|The second set to combine|
428
+ | param | type | description |
429
+ | ------ | -------- | ------------------------- |
430
+ | `set1` | `Set<a>` | The first set to combine |
431
+ | `set2` | `Set<a>` | The second set to combine |
426
432
 
427
433
  Returns:
428
434
 
429
- |type|description|
430
- |----|-----------|
431
- |`Set<a>`|A set containing all elements of both sets|
435
+ | type | description |
436
+ | -------- | ------------------------------------------ |
437
+ | `Set<a>` | A set containing all elements of both sets |
432
438
 
433
439
  ### Set.**diff**
434
440
 
@@ -438,23 +444,23 @@ No other changes yet.
438
444
  </details>
439
445
 
440
446
  ```grain
441
- diff : (set1: Set<a>, set2: Set<a>) => Set<a>
447
+ diff: (set1: Set<a>, set2: Set<a>) => Set<a>
442
448
  ```
443
449
 
444
450
  Combines two sets into a single set containing only the elements not shared between both sets.
445
451
 
446
452
  Parameters:
447
453
 
448
- |param|type|description|
449
- |-----|----|-----------|
450
- |`set1`|`Set<a>`|The first set to combine|
451
- |`set2`|`Set<a>`|The second set to combine|
454
+ | param | type | description |
455
+ | ------ | -------- | ------------------------- |
456
+ | `set1` | `Set<a>` | The first set to combine |
457
+ | `set2` | `Set<a>` | The second set to combine |
452
458
 
453
459
  Returns:
454
460
 
455
- |type|description|
456
- |----|-----------|
457
- |`Set<a>`|A set containing only unshared elements from both sets|
461
+ | type | description |
462
+ | -------- | ------------------------------------------------------ |
463
+ | `Set<a>` | A set containing only unshared elements from both sets |
458
464
 
459
465
  ### Set.**intersect**
460
466
 
@@ -464,23 +470,23 @@ No other changes yet.
464
470
  </details>
465
471
 
466
472
  ```grain
467
- intersect : (set1: Set<a>, set2: Set<a>) => Set<a>
473
+ intersect: (set1: Set<a>, set2: Set<a>) => Set<a>
468
474
  ```
469
475
 
470
476
  Combines two sets into a single set containing only the elements shared between both sets.
471
477
 
472
478
  Parameters:
473
479
 
474
- |param|type|description|
475
- |-----|----|-----------|
476
- |`set1`|`Set<a>`|The first set to combine|
477
- |`set2`|`Set<a>`|The second set to combine|
480
+ | param | type | description |
481
+ | ------ | -------- | ------------------------- |
482
+ | `set1` | `Set<a>` | The first set to combine |
483
+ | `set2` | `Set<a>` | The second set to combine |
478
484
 
479
485
  Returns:
480
486
 
481
- |type|description|
482
- |----|-----------|
483
- |`Set<a>`|A set containing only shared elements from both sets|
487
+ | type | description |
488
+ | -------- | ---------------------------------------------------- |
489
+ | `Set<a>` | A set containing only shared elements from both sets |
484
490
 
485
491
  ### Set.**getInternalStats**
486
492
 
@@ -497,22 +503,22 @@ Returns:
497
503
  </details>
498
504
 
499
505
  ```grain
500
- getInternalStats : (set: Set<a>) => InternalSetStats
506
+ getInternalStats: (set: Set<a>) => InternalSetStats
501
507
  ```
502
508
 
503
509
  Provides data representing the internal state state of the set.
504
510
 
505
511
  Parameters:
506
512
 
507
- |param|type|description|
508
- |-----|----|-----------|
509
- |`set`|`Set<a>`|The set to inspect|
513
+ | param | type | description |
514
+ | ----- | -------- | ------------------ |
515
+ | `set` | `Set<a>` | The set to inspect |
510
516
 
511
517
  Returns:
512
518
 
513
- |type|description|
514
- |----|-----------|
515
- |`InternalSetStats`|The internal state of the set|
519
+ | type | description |
520
+ | ------------------ | ----------------------------- |
521
+ | `InternalSetStats` | The internal state of the set |
516
522
 
517
523
  ## Set.Immutable
518
524
 
@@ -559,7 +565,7 @@ Functions and constants included in the Set.Immutable module.
559
565
  </details>
560
566
 
561
567
  ```grain
562
- empty : Set<a>
568
+ empty: Set<a>
563
569
  ```
564
570
 
565
571
  An empty set
@@ -579,22 +585,22 @@ An empty set
579
585
  </details>
580
586
 
581
587
  ```grain
582
- size : (set: Set<a>) => Number
588
+ size: (set: Set<a>) => Number
583
589
  ```
584
590
 
585
591
  Provides the count of values within the set.
586
592
 
587
593
  Parameters:
588
594
 
589
- |param|type|description|
590
- |-----|----|-----------|
591
- |`set`|`Set<a>`|The set to inspect|
595
+ | param | type | description |
596
+ | ----- | -------- | ------------------ |
597
+ | `set` | `Set<a>` | The set to inspect |
592
598
 
593
599
  Returns:
594
600
 
595
- |type|description|
596
- |----|-----------|
597
- |`Number`|The count of elements in the set|
601
+ | type | description |
602
+ | -------- | -------------------------------- |
603
+ | `Number` | The count of elements in the set |
598
604
 
599
605
  #### Set.Immutable.**isEmpty**
600
606
 
@@ -611,22 +617,22 @@ Returns:
611
617
  </details>
612
618
 
613
619
  ```grain
614
- isEmpty : (set: Set<a>) => Bool
620
+ isEmpty: (set: Set<a>) => Bool
615
621
  ```
616
622
 
617
623
  Determines if the set contains no elements.
618
624
 
619
625
  Parameters:
620
626
 
621
- |param|type|description|
622
- |-----|----|-----------|
623
- |`set`|`Set<a>`|The set to inspect|
627
+ | param | type | description |
628
+ | ----- | -------- | ------------------ |
629
+ | `set` | `Set<a>` | The set to inspect |
624
630
 
625
631
  Returns:
626
632
 
627
- |type|description|
628
- |----|-----------|
629
- |`Bool`|`true` if the given set is empty or `false` otherwise|
633
+ | type | description |
634
+ | ------ | ----------------------------------------------------- |
635
+ | `Bool` | `true` if the given set is empty or `false` otherwise |
630
636
 
631
637
  #### Set.Immutable.**add**
632
638
 
@@ -643,7 +649,7 @@ Returns:
643
649
  </details>
644
650
 
645
651
  ```grain
646
- add : (key: a, set: Set<a>) => Set<a>
652
+ add: (key: a, set: Set<a>) => Set<a>
647
653
  ```
648
654
 
649
655
  Produces a new set by inserting the given value into the set. If the value
@@ -651,16 +657,16 @@ already exists, the new set will have the same elements as the input set.
651
657
 
652
658
  Parameters:
653
659
 
654
- |param|type|description|
655
- |-----|----|-----------|
656
- |`key`|`a`|The value to add|
657
- |`set`|`Set<a>`|The base set|
660
+ | param | type | description |
661
+ | ----- | -------- | ---------------- |
662
+ | `key` | `a` | The value to add |
663
+ | `set` | `Set<a>` | The base set |
658
664
 
659
665
  Returns:
660
666
 
661
- |type|description|
662
- |----|-----------|
663
- |`Set<a>`|A new set containing the new element|
667
+ | type | description |
668
+ | -------- | ------------------------------------ |
669
+ | `Set<a>` | A new set containing the new element |
664
670
 
665
671
  #### Set.Immutable.**contains**
666
672
 
@@ -677,23 +683,23 @@ Returns:
677
683
  </details>
678
684
 
679
685
  ```grain
680
- contains : (key: a, set: Set<a>) => Bool
686
+ contains: (key: a, set: Set<a>) => Bool
681
687
  ```
682
688
 
683
689
  Determines if the set contains the given value.
684
690
 
685
691
  Parameters:
686
692
 
687
- |param|type|description|
688
- |-----|----|-----------|
689
- |`key`|`a`|The value to search for|
690
- |`set`|`Set<a>`|The set to search|
693
+ | param | type | description |
694
+ | ----- | -------- | ----------------------- |
695
+ | `key` | `a` | The value to search for |
696
+ | `set` | `Set<a>` | The set to search |
691
697
 
692
698
  Returns:
693
699
 
694
- |type|description|
695
- |----|-----------|
696
- |`Bool`|`true` if the set contains the given value or `false` otherwise|
700
+ | type | description |
701
+ | ------ | --------------------------------------------------------------- |
702
+ | `Bool` | `true` if the set contains the given value or `false` otherwise |
697
703
 
698
704
  #### Set.Immutable.**remove**
699
705
 
@@ -710,7 +716,7 @@ Returns:
710
716
  </details>
711
717
 
712
718
  ```grain
713
- remove : (key: a, set: Set<a>) => Set<a>
719
+ remove: (key: a, set: Set<a>) => Set<a>
714
720
  ```
715
721
 
716
722
  Produces a new set without the given element. If the value doesn't exist in
@@ -718,16 +724,16 @@ the set, the set will be returned unmodified.
718
724
 
719
725
  Parameters:
720
726
 
721
- |param|type|description|
722
- |-----|----|-----------|
723
- |`key`|`a`|The value to exclude|
724
- |`set`|`Set<a>`|The set to exclude from|
727
+ | param | type | description |
728
+ | ----- | -------- | ----------------------- |
729
+ | `key` | `a` | The value to exclude |
730
+ | `set` | `Set<a>` | The set to exclude from |
725
731
 
726
732
  Returns:
727
733
 
728
- |type|description|
729
- |----|-----------|
730
- |`Set<a>`|A new set without the excluded element|
734
+ | type | description |
735
+ | -------- | -------------------------------------- |
736
+ | `Set<a>` | A new set without the excluded element |
731
737
 
732
738
  #### Set.Immutable.**forEach**
733
739
 
@@ -744,17 +750,17 @@ Returns:
744
750
  </details>
745
751
 
746
752
  ```grain
747
- forEach : (fn: (a => Void), set: Set<a>) => Void
753
+ forEach: (fn: (a => Void), set: Set<a>) => Void
748
754
  ```
749
755
 
750
756
  Iterates the set, calling an iterator function on each element.
751
757
 
752
758
  Parameters:
753
759
 
754
- |param|type|description|
755
- |-----|----|-----------|
756
- |`fn`|`a => Void`|The iterator function to call with each element|
757
- |`set`|`Set<a>`|The set to iterate|
760
+ | param | type | description |
761
+ | ----- | ----------- | ----------------------------------------------- |
762
+ | `fn` | `a => Void` | The iterator function to call with each element |
763
+ | `set` | `Set<a>` | The set to iterate |
758
764
 
759
765
  #### Set.Immutable.**reduce**
760
766
 
@@ -771,24 +777,24 @@ Parameters:
771
777
  </details>
772
778
 
773
779
  ```grain
774
- reduce : (fn: ((a, b) => a), init: a, set: Set<b>) => a
780
+ reduce: (fn: ((a, b) => a), init: a, set: Set<b>) => a
775
781
  ```
776
782
 
777
783
  Combines all elements of a set using a reducer function.
778
784
 
779
785
  Parameters:
780
786
 
781
- |param|type|description|
782
- |-----|----|-----------|
783
- |`fn`|`(a, b) => a`|The reducer function to call on each element, where the value returned will be the next accumulator value|
784
- |`init`|`a`|The initial value to use for the accumulator on the first iteration|
785
- |`set`|`Set<b>`|The set to iterate|
787
+ | param | type | description |
788
+ | ------ | ------------- | --------------------------------------------------------------------------------------------------------- |
789
+ | `fn` | `(a, b) => a` | The reducer function to call on each element, where the value returned will be the next accumulator value |
790
+ | `init` | `a` | The initial value to use for the accumulator on the first iteration |
791
+ | `set` | `Set<b>` | The set to iterate |
786
792
 
787
793
  Returns:
788
794
 
789
- |type|description|
790
- |----|-----------|
791
- |`a`|The final accumulator returned from `fn`|
795
+ | type | description |
796
+ | ---- | ---------------------------------------- |
797
+ | `a` | The final accumulator returned from `fn` |
792
798
 
793
799
  #### Set.Immutable.**filter**
794
800
 
@@ -805,23 +811,23 @@ Returns:
805
811
  </details>
806
812
 
807
813
  ```grain
808
- filter : (fn: (a => Bool), set: Set<a>) => Set<a>
814
+ filter: (fn: (a => Bool), set: Set<a>) => Set<a>
809
815
  ```
810
816
 
811
817
  Produces a new set without the elements from the input set where a predicate function returns `false`.
812
818
 
813
819
  Parameters:
814
820
 
815
- |param|type|description|
816
- |-----|----|-----------|
817
- |`fn`|`a => Bool`|The predicate function to indicate which elements to exclude from the set, where returning `false` indicates the value should be excluded|
818
- |`set`|`Set<a>`|The set to iterate|
821
+ | param | type | description |
822
+ | ----- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
823
+ | `fn` | `a => Bool` | The predicate function to indicate which elements to exclude from the set, where returning `false` indicates the value should be excluded |
824
+ | `set` | `Set<a>` | The set to iterate |
819
825
 
820
826
  Returns:
821
827
 
822
- |type|description|
823
- |----|-----------|
824
- |`Set<a>`|A new set excluding the elements not fulfilling the predicate|
828
+ | type | description |
829
+ | -------- | ------------------------------------------------------------- |
830
+ | `Set<a>` | A new set excluding the elements not fulfilling the predicate |
825
831
 
826
832
  #### Set.Immutable.**reject**
827
833
 
@@ -838,23 +844,23 @@ Returns:
838
844
  </details>
839
845
 
840
846
  ```grain
841
- reject : (fn: (a => Bool), set: Set<a>) => Set<a>
847
+ reject: (fn: (a => Bool), set: Set<a>) => Set<a>
842
848
  ```
843
849
 
844
850
  Produces a new set without the elements from the input set where a predicate function returns `true`.
845
851
 
846
852
  Parameters:
847
853
 
848
- |param|type|description|
849
- |-----|----|-----------|
850
- |`fn`|`a => Bool`|The predicate function to indicate which elements to exclude from the set, where returning `true` indicates the value should be excluded|
851
- |`set`|`Set<a>`|The set to iterate|
854
+ | param | type | description |
855
+ | ----- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
856
+ | `fn` | `a => Bool` | The predicate function to indicate which elements to exclude from the set, where returning `true` indicates the value should be excluded |
857
+ | `set` | `Set<a>` | The set to iterate |
852
858
 
853
859
  Returns:
854
860
 
855
- |type|description|
856
- |----|-----------|
857
- |`Set<a>`|A new set excluding the elements fulfilling the predicate|
861
+ | type | description |
862
+ | -------- | --------------------------------------------------------- |
863
+ | `Set<a>` | A new set excluding the elements fulfilling the predicate |
858
864
 
859
865
  #### Set.Immutable.**union**
860
866
 
@@ -871,23 +877,23 @@ Returns:
871
877
  </details>
872
878
 
873
879
  ```grain
874
- union : (set1: Set<a>, set2: Set<a>) => Set<a>
880
+ union: (set1: Set<a>, set2: Set<a>) => Set<a>
875
881
  ```
876
882
 
877
883
  Combines two sets into a single set containing all elements from both sets.
878
884
 
879
885
  Parameters:
880
886
 
881
- |param|type|description|
882
- |-----|----|-----------|
883
- |`set1`|`Set<a>`|The first set to combine|
884
- |`set2`|`Set<a>`|The second set to combine|
887
+ | param | type | description |
888
+ | ------ | -------- | ------------------------- |
889
+ | `set1` | `Set<a>` | The first set to combine |
890
+ | `set2` | `Set<a>` | The second set to combine |
885
891
 
886
892
  Returns:
887
893
 
888
- |type|description|
889
- |----|-----------|
890
- |`Set<a>`|A set containing all elements of both sets|
894
+ | type | description |
895
+ | -------- | ------------------------------------------ |
896
+ | `Set<a>` | A set containing all elements of both sets |
891
897
 
892
898
  #### Set.Immutable.**diff**
893
899
 
@@ -904,23 +910,23 @@ Returns:
904
910
  </details>
905
911
 
906
912
  ```grain
907
- diff : (set1: Set<a>, set2: Set<a>) => Set<a>
913
+ diff: (set1: Set<a>, set2: Set<a>) => Set<a>
908
914
  ```
909
915
 
910
916
  Combines two sets into a single set containing only the elements not shared between both sets.
911
917
 
912
918
  Parameters:
913
919
 
914
- |param|type|description|
915
- |-----|----|-----------|
916
- |`set1`|`Set<a>`|The first set to combine|
917
- |`set2`|`Set<a>`|The second set to combine|
920
+ | param | type | description |
921
+ | ------ | -------- | ------------------------- |
922
+ | `set1` | `Set<a>` | The first set to combine |
923
+ | `set2` | `Set<a>` | The second set to combine |
918
924
 
919
925
  Returns:
920
926
 
921
- |type|description|
922
- |----|-----------|
923
- |`Set<a>`|A set containing only unshared elements from both sets|
927
+ | type | description |
928
+ | -------- | ------------------------------------------------------ |
929
+ | `Set<a>` | A set containing only unshared elements from both sets |
924
930
 
925
931
  #### Set.Immutable.**intersect**
926
932
 
@@ -937,23 +943,23 @@ Returns:
937
943
  </details>
938
944
 
939
945
  ```grain
940
- intersect : (set1: Set<a>, set2: Set<a>) => Set<a>
946
+ intersect: (set1: Set<a>, set2: Set<a>) => Set<a>
941
947
  ```
942
948
 
943
949
  Combines two sets into a single set containing only the elements shared between both sets.
944
950
 
945
951
  Parameters:
946
952
 
947
- |param|type|description|
948
- |-----|----|-----------|
949
- |`set1`|`Set<a>`|The first set to combine|
950
- |`set2`|`Set<a>`|The second set to combine|
953
+ | param | type | description |
954
+ | ------ | -------- | ------------------------- |
955
+ | `set1` | `Set<a>` | The first set to combine |
956
+ | `set2` | `Set<a>` | The second set to combine |
951
957
 
952
958
  Returns:
953
959
 
954
- |type|description|
955
- |----|-----------|
956
- |`Set<a>`|A set containing only shared elements from both sets|
960
+ | type | description |
961
+ | -------- | ---------------------------------------------------- |
962
+ | `Set<a>` | A set containing only shared elements from both sets |
957
963
 
958
964
  #### Set.Immutable.**fromList**
959
965
 
@@ -970,22 +976,22 @@ Returns:
970
976
  </details>
971
977
 
972
978
  ```grain
973
- fromList : (list: List<a>) => Set<a>
979
+ fromList: (list: List<a>) => Set<a>
974
980
  ```
975
981
 
976
982
  Creates a set from a list.
977
983
 
978
984
  Parameters:
979
985
 
980
- |param|type|description|
981
- |-----|----|-----------|
982
- |`list`|`List<a>`|The list to convert|
986
+ | param | type | description |
987
+ | ------ | --------- | ------------------- |
988
+ | `list` | `List<a>` | The list to convert |
983
989
 
984
990
  Returns:
985
991
 
986
- |type|description|
987
- |----|-----------|
988
- |`Set<a>`|A set containing all list values|
992
+ | type | description |
993
+ | -------- | -------------------------------- |
994
+ | `Set<a>` | A set containing all list values |
989
995
 
990
996
  #### Set.Immutable.**toList**
991
997
 
@@ -1002,22 +1008,22 @@ Returns:
1002
1008
  </details>
1003
1009
 
1004
1010
  ```grain
1005
- toList : (set: Set<a>) => List<a>
1011
+ toList: (set: Set<a>) => List<a>
1006
1012
  ```
1007
1013
 
1008
1014
  Converts a set into a list of its elements.
1009
1015
 
1010
1016
  Parameters:
1011
1017
 
1012
- |param|type|description|
1013
- |-----|----|-----------|
1014
- |`set`|`Set<a>`|The set to convert|
1018
+ | param | type | description |
1019
+ | ----- | -------- | ------------------ |
1020
+ | `set` | `Set<a>` | The set to convert |
1015
1021
 
1016
1022
  Returns:
1017
1023
 
1018
- |type|description|
1019
- |----|-----------|
1020
- |`List<a>`|A list containing all set values|
1024
+ | type | description |
1025
+ | --------- | -------------------------------- |
1026
+ | `List<a>` | A list containing all set values |
1021
1027
 
1022
1028
  #### Set.Immutable.**fromArray**
1023
1029
 
@@ -1034,22 +1040,22 @@ Returns:
1034
1040
  </details>
1035
1041
 
1036
1042
  ```grain
1037
- fromArray : (array: Array<a>) => Set<a>
1043
+ fromArray: (array: Array<a>) => Set<a>
1038
1044
  ```
1039
1045
 
1040
1046
  Creates a set from an array.
1041
1047
 
1042
1048
  Parameters:
1043
1049
 
1044
- |param|type|description|
1045
- |-----|----|-----------|
1046
- |`array`|`Array<a>`|The array to convert|
1050
+ | param | type | description |
1051
+ | ------- | ---------- | -------------------- |
1052
+ | `array` | `Array<a>` | The array to convert |
1047
1053
 
1048
1054
  Returns:
1049
1055
 
1050
- |type|description|
1051
- |----|-----------|
1052
- |`Set<a>`|A set containing all array values|
1056
+ | type | description |
1057
+ | -------- | --------------------------------- |
1058
+ | `Set<a>` | A set containing all array values |
1053
1059
 
1054
1060
  #### Set.Immutable.**toArray**
1055
1061
 
@@ -1066,20 +1072,20 @@ Returns:
1066
1072
  </details>
1067
1073
 
1068
1074
  ```grain
1069
- toArray : (set: Set<a>) => Array<a>
1075
+ toArray: (set: Set<a>) => Array<a>
1070
1076
  ```
1071
1077
 
1072
1078
  Converts a set into an array of its elements.
1073
1079
 
1074
1080
  Parameters:
1075
1081
 
1076
- |param|type|description|
1077
- |-----|----|-----------|
1078
- |`set`|`Set<a>`|The set to convert|
1082
+ | param | type | description |
1083
+ | ----- | -------- | ------------------ |
1084
+ | `set` | `Set<a>` | The set to convert |
1079
1085
 
1080
1086
  Returns:
1081
1087
 
1082
- |type|description|
1083
- |----|-----------|
1084
- |`Array<a>`|An array containing all set values|
1088
+ | type | description |
1089
+ | ---------- | ---------------------------------- |
1090
+ | `Array<a>` | An array containing all set values |
1085
1091