@grain/stdlib 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/LICENSE +1 -1
  3. package/array.gr +92 -73
  4. package/array.md +18 -18
  5. package/bigint.gr +497 -0
  6. package/bigint.md +811 -0
  7. package/buffer.gr +56 -217
  8. package/buffer.md +24 -17
  9. package/bytes.gr +103 -205
  10. package/bytes.md +19 -0
  11. package/char.gr +152 -166
  12. package/char.md +200 -0
  13. package/exception.md +6 -0
  14. package/float32.gr +159 -82
  15. package/float32.md +315 -0
  16. package/float64.gr +163 -82
  17. package/float64.md +315 -0
  18. package/hash.gr +53 -49
  19. package/int32.gr +479 -230
  20. package/int32.md +937 -0
  21. package/int64.gr +479 -230
  22. package/int64.md +937 -0
  23. package/list.gr +530 -116
  24. package/list.md +1141 -0
  25. package/map.gr +302 -121
  26. package/map.md +525 -0
  27. package/number.gr +51 -57
  28. package/number.md +37 -3
  29. package/option.gr +25 -25
  30. package/option.md +1 -1
  31. package/package.json +3 -3
  32. package/pervasives.gr +504 -52
  33. package/pervasives.md +1116 -0
  34. package/queue.gr +8 -1
  35. package/queue.md +10 -0
  36. package/random.gr +196 -0
  37. package/random.md +179 -0
  38. package/range.gr +26 -26
  39. package/regex.gr +1833 -842
  40. package/regex.md +11 -11
  41. package/result.md +1 -1
  42. package/runtime/bigint.gr +2045 -0
  43. package/runtime/bigint.md +326 -0
  44. package/runtime/dataStructures.gr +99 -279
  45. package/runtime/dataStructures.md +391 -0
  46. package/runtime/debug.gr +0 -1
  47. package/runtime/debug.md +6 -0
  48. package/runtime/equal.gr +40 -37
  49. package/runtime/equal.md +6 -0
  50. package/runtime/exception.gr +28 -15
  51. package/runtime/exception.md +30 -0
  52. package/runtime/gc.gr +50 -20
  53. package/runtime/gc.md +36 -0
  54. package/runtime/malloc.gr +32 -22
  55. package/runtime/malloc.md +55 -0
  56. package/runtime/numberUtils.gr +297 -142
  57. package/runtime/numberUtils.md +54 -0
  58. package/runtime/numbers.gr +1204 -453
  59. package/runtime/numbers.md +300 -0
  60. package/runtime/string.gr +193 -228
  61. package/runtime/string.md +24 -0
  62. package/runtime/stringUtils.gr +62 -38
  63. package/runtime/stringUtils.md +6 -0
  64. package/runtime/unsafe/constants.gr +17 -0
  65. package/runtime/unsafe/constants.md +72 -0
  66. package/runtime/unsafe/conv.gr +10 -10
  67. package/runtime/unsafe/conv.md +71 -0
  68. package/runtime/unsafe/errors.md +204 -0
  69. package/runtime/unsafe/memory.gr +14 -3
  70. package/runtime/unsafe/memory.md +54 -0
  71. package/runtime/unsafe/printWasm.gr +4 -4
  72. package/runtime/unsafe/printWasm.md +24 -0
  73. package/runtime/unsafe/tags.gr +11 -10
  74. package/runtime/unsafe/tags.md +120 -0
  75. package/runtime/unsafe/wasmf32.gr +9 -2
  76. package/runtime/unsafe/wasmf32.md +168 -0
  77. package/runtime/unsafe/wasmf64.gr +9 -2
  78. package/runtime/unsafe/wasmf64.md +168 -0
  79. package/runtime/unsafe/wasmi32.gr +65 -47
  80. package/runtime/unsafe/wasmi32.md +282 -0
  81. package/runtime/unsafe/wasmi64.gr +78 -50
  82. package/runtime/unsafe/wasmi64.md +300 -0
  83. package/runtime/utils/printing.gr +62 -0
  84. package/runtime/utils/printing.md +18 -0
  85. package/runtime/wasi.gr +200 -46
  86. package/runtime/wasi.md +839 -0
  87. package/set.gr +125 -121
  88. package/set.md +24 -21
  89. package/stack.gr +29 -29
  90. package/stack.md +4 -6
  91. package/string.gr +434 -415
  92. package/string.md +3 -3
  93. package/sys/file.gr +477 -482
  94. package/sys/process.gr +33 -47
  95. package/sys/random.gr +48 -20
  96. package/sys/random.md +38 -0
  97. package/sys/time.gr +12 -28
package/int32.md ADDED
@@ -0,0 +1,937 @@
1
+ ---
2
+ title: Int32
3
+ ---
4
+
5
+ Utilities for working with the Int32 type.
6
+
7
+ <details disabled>
8
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
9
+ No other changes yet.
10
+ </details>
11
+
12
+ ```grain
13
+ import Int32 from "int32"
14
+ ```
15
+
16
+ ## Conversions
17
+
18
+ Functions for converting between Numbers and the Int32 type.
19
+
20
+ ### Int32.**fromNumber**
21
+
22
+ <details disabled>
23
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
24
+ No other changes yet.
25
+ </details>
26
+
27
+ ```grain
28
+ fromNumber : Number -> Int32
29
+ ```
30
+
31
+ Converts a Number to an Int32.
32
+
33
+ Parameters:
34
+
35
+ |param|type|description|
36
+ |-----|----|-----------|
37
+ |`number`|`Number`|The value to convert|
38
+
39
+ Returns:
40
+
41
+ |type|description|
42
+ |----|-----------|
43
+ |`Int32`|The Number represented as an Int32|
44
+
45
+ ### Int32.**toNumber**
46
+
47
+ <details disabled>
48
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
49
+ No other changes yet.
50
+ </details>
51
+
52
+ ```grain
53
+ toNumber : Int32 -> Number
54
+ ```
55
+
56
+ Converts an Int32 to a Number.
57
+
58
+ Parameters:
59
+
60
+ |param|type|description|
61
+ |-----|----|-----------|
62
+ |`value`|`Int32`|The value to convert|
63
+
64
+ Returns:
65
+
66
+ |type|description|
67
+ |----|-----------|
68
+ |`Number`|The Int32 represented as a Number|
69
+
70
+ ## Operations
71
+
72
+ Mathematical operations for Int32 values.
73
+
74
+ ### Int32.**incr**
75
+
76
+ <details disabled>
77
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
78
+ No other changes yet.
79
+ </details>
80
+
81
+ ```grain
82
+ incr : Int32 -> Int32
83
+ ```
84
+
85
+ Increments the value by one.
86
+
87
+ Parameters:
88
+
89
+ |param|type|description|
90
+ |-----|----|-----------|
91
+ |`value`|`Int32`|The value to increment|
92
+
93
+ Returns:
94
+
95
+ |type|description|
96
+ |----|-----------|
97
+ |`Int32`|The incremented value|
98
+
99
+ ### Int32.**decr**
100
+
101
+ <details disabled>
102
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
103
+ No other changes yet.
104
+ </details>
105
+
106
+ ```grain
107
+ decr : Int32 -> Int32
108
+ ```
109
+
110
+ Decrements the value by one.
111
+
112
+ Parameters:
113
+
114
+ |param|type|description|
115
+ |-----|----|-----------|
116
+ |`value`|`Int32`|The value to decrement|
117
+
118
+ Returns:
119
+
120
+ |type|description|
121
+ |----|-----------|
122
+ |`Int32`|The decremented value|
123
+
124
+ ### Int32.**add**
125
+
126
+ <details disabled>
127
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
128
+ No other changes yet.
129
+ </details>
130
+
131
+ ```grain
132
+ add : (Int32, Int32) -> Int32
133
+ ```
134
+
135
+ Computes the sum of its operands.
136
+
137
+ Parameters:
138
+
139
+ |param|type|description|
140
+ |-----|----|-----------|
141
+ |`x`|`Int32`|The first operand|
142
+ |`y`|`Int32`|The second operand|
143
+
144
+ Returns:
145
+
146
+ |type|description|
147
+ |----|-----------|
148
+ |`Int32`|The sum of the two operands|
149
+
150
+ ### Int32.**sub**
151
+
152
+ <details disabled>
153
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
154
+ No other changes yet.
155
+ </details>
156
+
157
+ ```grain
158
+ sub : (Int32, Int32) -> Int32
159
+ ```
160
+
161
+ Computes the difference of its operands.
162
+
163
+ Parameters:
164
+
165
+ |param|type|description|
166
+ |-----|----|-----------|
167
+ |`x`|`Int32`|The first operand|
168
+ |`y`|`Int32`|The second operand|
169
+
170
+ Returns:
171
+
172
+ |type|description|
173
+ |----|-----------|
174
+ |`Int32`|The difference of the two operands|
175
+
176
+ ### Int32.**mul**
177
+
178
+ <details disabled>
179
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
180
+ No other changes yet.
181
+ </details>
182
+
183
+ ```grain
184
+ mul : (Int32, Int32) -> Int32
185
+ ```
186
+
187
+ Computes the product of its operands.
188
+
189
+ Parameters:
190
+
191
+ |param|type|description|
192
+ |-----|----|-----------|
193
+ |`x`|`Int32`|The first operand|
194
+ |`y`|`Int32`|The second operand|
195
+
196
+ Returns:
197
+
198
+ |type|description|
199
+ |----|-----------|
200
+ |`Int32`|The product of the two operands|
201
+
202
+ ### Int32.**div**
203
+
204
+ <details disabled>
205
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
206
+ No other changes yet.
207
+ </details>
208
+
209
+ ```grain
210
+ div : (Int32, Int32) -> Int32
211
+ ```
212
+
213
+ Computes the quotient of its operands using signed division.
214
+
215
+ Parameters:
216
+
217
+ |param|type|description|
218
+ |-----|----|-----------|
219
+ |`x`|`Int32`|The first operand|
220
+ |`y`|`Int32`|The second operand|
221
+
222
+ Returns:
223
+
224
+ |type|description|
225
+ |----|-----------|
226
+ |`Int32`|The quotient of its operands|
227
+
228
+ ### Int32.**divU**
229
+
230
+ <details disabled>
231
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
232
+ No other changes yet.
233
+ </details>
234
+
235
+ ```grain
236
+ divU : (Int32, Int32) -> Int32
237
+ ```
238
+
239
+ Computes the quotient of its operands using unsigned division.
240
+
241
+ Parameters:
242
+
243
+ |param|type|description|
244
+ |-----|----|-----------|
245
+ |`x`|`Int32`|The first operand|
246
+ |`y`|`Int32`|The second operand|
247
+
248
+ Returns:
249
+
250
+ |type|description|
251
+ |----|-----------|
252
+ |`Int32`|The quotient of its operands|
253
+
254
+ ### Int32.**rem**
255
+
256
+ <details disabled>
257
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
258
+ No other changes yet.
259
+ </details>
260
+
261
+ ```grain
262
+ rem : (Int32, Int32) -> Int32
263
+ ```
264
+
265
+ Computes the remainder of the division of its operands using signed division.
266
+
267
+ Parameters:
268
+
269
+ |param|type|description|
270
+ |-----|----|-----------|
271
+ |`x`|`Int32`|The first operand|
272
+ |`y`|`Int32`|The second operand|
273
+
274
+ Returns:
275
+
276
+ |type|description|
277
+ |----|-----------|
278
+ |`Int32`|The remainder of its operands|
279
+
280
+ ### Int32.**remU**
281
+
282
+ <details disabled>
283
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
284
+ No other changes yet.
285
+ </details>
286
+
287
+ ```grain
288
+ remU : (Int32, Int32) -> Int32
289
+ ```
290
+
291
+ Computes the remainder of the division of its operands using unsigned division.
292
+
293
+ Parameters:
294
+
295
+ |param|type|description|
296
+ |-----|----|-----------|
297
+ |`x`|`Int32`|The first operand|
298
+ |`y`|`Int32`|The second operand|
299
+
300
+ Returns:
301
+
302
+ |type|description|
303
+ |----|-----------|
304
+ |`Int32`|The remainder of its operands|
305
+
306
+ ### Int32.**mod**
307
+
308
+ <details disabled>
309
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
310
+ No other changes yet.
311
+ </details>
312
+
313
+ ```grain
314
+ mod : (Int32, Int32) -> Int32
315
+ ```
316
+
317
+ Computes the remainder of the division of the first operand by the second.
318
+ The result will have the sign of the second operand.
319
+
320
+ Parameters:
321
+
322
+ |param|type|description|
323
+ |-----|----|-----------|
324
+ |`x`|`Int32`|The first operand|
325
+ |`y`|`Int32`|The second operand|
326
+
327
+ Returns:
328
+
329
+ |type|description|
330
+ |----|-----------|
331
+ |`Int32`|The modulus of its operands|
332
+
333
+ ## Bitwise operations
334
+
335
+ Functions for operating on bits of Int32 values.
336
+
337
+ ### Int32.**rotl**
338
+
339
+ <details disabled>
340
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
341
+ No other changes yet.
342
+ </details>
343
+
344
+ ```grain
345
+ rotl : (Int32, Int32) -> Int32
346
+ ```
347
+
348
+ Rotates the bits of the value left by the given number of bits.
349
+
350
+ Parameters:
351
+
352
+ |param|type|description|
353
+ |-----|----|-----------|
354
+ |`value`|`Int32`|The value to rotate|
355
+ |`amount`|`Int32`|The number of bits to rotate by|
356
+
357
+ Returns:
358
+
359
+ |type|description|
360
+ |----|-----------|
361
+ |`Int32`|The rotated value|
362
+
363
+ ### Int32.**rotr**
364
+
365
+ <details disabled>
366
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
367
+ No other changes yet.
368
+ </details>
369
+
370
+ ```grain
371
+ rotr : (Int32, Int32) -> Int32
372
+ ```
373
+
374
+ Rotates the bits of the value right by the given number of bits.
375
+
376
+ Parameters:
377
+
378
+ |param|type|description|
379
+ |-----|----|-----------|
380
+ |`value`|`Int32`|The value to rotate|
381
+ |`amount`|`Int32`|The number of bits to rotate by|
382
+
383
+ Returns:
384
+
385
+ |type|description|
386
+ |----|-----------|
387
+ |`Int32`|The rotated value|
388
+
389
+ ### Int32.**shl**
390
+
391
+ <details disabled>
392
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
393
+ No other changes yet.
394
+ </details>
395
+
396
+ ```grain
397
+ shl : (Int32, Int32) -> Int32
398
+ ```
399
+
400
+ Shifts the bits of the value left by the given number of bits.
401
+
402
+ Parameters:
403
+
404
+ |param|type|description|
405
+ |-----|----|-----------|
406
+ |`value`|`Int32`|The value to shift|
407
+ |`amount`|`Int32`|The number of bits to shift by|
408
+
409
+ Returns:
410
+
411
+ |type|description|
412
+ |----|-----------|
413
+ |`Int32`|The shifted value|
414
+
415
+ ### Int32.**shr**
416
+
417
+ <details disabled>
418
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
419
+ No other changes yet.
420
+ </details>
421
+
422
+ ```grain
423
+ shr : (Int32, Int32) -> Int32
424
+ ```
425
+
426
+ Shifts the bits of the value right by the given number of bits, preserving the sign bit.
427
+
428
+ Parameters:
429
+
430
+ |param|type|description|
431
+ |-----|----|-----------|
432
+ |`value`|`Int32`|The value to shift|
433
+ |`amount`|`Int32`|The amount to shift by|
434
+
435
+ Returns:
436
+
437
+ |type|description|
438
+ |----|-----------|
439
+ |`Int32`|The shifted value|
440
+
441
+ ### Int32.**shrU**
442
+
443
+ <details disabled>
444
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
445
+ No other changes yet.
446
+ </details>
447
+
448
+ ```grain
449
+ shrU : (Int32, Int32) -> Int32
450
+ ```
451
+
452
+ Shifts the bits of the value right by the given number of bits.
453
+
454
+ Parameters:
455
+
456
+ |param|type|description|
457
+ |-----|----|-----------|
458
+ |`value`|`Int32`|The value to shift|
459
+ |`amount`|`Int32`|The amount to shift by|
460
+
461
+ Returns:
462
+
463
+ |type|description|
464
+ |----|-----------|
465
+ |`Int32`|The shifted value|
466
+
467
+ ## Comparisons
468
+
469
+ Functions for comparing Int32 values.
470
+
471
+ ### Int32.**eq**
472
+
473
+ <details disabled>
474
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
475
+ No other changes yet.
476
+ </details>
477
+
478
+ ```grain
479
+ eq : (Int32, Int32) -> Bool
480
+ ```
481
+
482
+ Checks if the first value is equal to the second value.
483
+
484
+ Parameters:
485
+
486
+ |param|type|description|
487
+ |-----|----|-----------|
488
+ |`x`|`Int32`|The first value|
489
+ |`y`|`Int32`|The second value|
490
+
491
+ Returns:
492
+
493
+ |type|description|
494
+ |----|-----------|
495
+ |`Bool`|`true` if the first value is equal to the second value or `false` otherwise|
496
+
497
+ ### Int32.**ne**
498
+
499
+ <details disabled>
500
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
501
+ No other changes yet.
502
+ </details>
503
+
504
+ ```grain
505
+ ne : (Int32, Int32) -> Bool
506
+ ```
507
+
508
+ Checks if the first value is not equal to the second value.
509
+
510
+ Parameters:
511
+
512
+ |param|type|description|
513
+ |-----|----|-----------|
514
+ |`x`|`Int32`|The first value|
515
+ |`y`|`Int32`|The second value|
516
+
517
+ Returns:
518
+
519
+ |type|description|
520
+ |----|-----------|
521
+ |`Bool`|`true` if the first value is not equal to the second value or `false` otherwise|
522
+
523
+ ### Int32.**eqz**
524
+
525
+ <details disabled>
526
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
527
+ No other changes yet.
528
+ </details>
529
+
530
+ ```grain
531
+ eqz : Int32 -> Bool
532
+ ```
533
+
534
+ Checks if the given value is equal to zero.
535
+
536
+ Parameters:
537
+
538
+ |param|type|description|
539
+ |-----|----|-----------|
540
+ |`value`|`Int32`|The value to inspect|
541
+
542
+ Returns:
543
+
544
+ |type|description|
545
+ |----|-----------|
546
+ |`Bool`|`true` if the first value is equal to zero or `false` otherwise|
547
+
548
+ ### Int32.**lt**
549
+
550
+ <details disabled>
551
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
552
+ No other changes yet.
553
+ </details>
554
+
555
+ ```grain
556
+ lt : (Int32, Int32) -> Bool
557
+ ```
558
+
559
+ Checks if the first value is less than the second value.
560
+
561
+ Parameters:
562
+
563
+ |param|type|description|
564
+ |-----|----|-----------|
565
+ |`x`|`Int32`|The first value|
566
+ |`y`|`Int32`|The second value|
567
+
568
+ Returns:
569
+
570
+ |type|description|
571
+ |----|-----------|
572
+ |`Bool`|`true` if the first value is less than the second value or `false` otherwise|
573
+
574
+ ### Int32.**ltU**
575
+
576
+ <details disabled>
577
+ <summary tabindex="-1">Added in <code>next</code></summary>
578
+ No other changes yet.
579
+ </details>
580
+
581
+ ```grain
582
+ ltU : (Int32, Int32) -> Bool
583
+ ```
584
+
585
+ Checks if the first unsigned value is less than the second unsigned value.
586
+
587
+ Parameters:
588
+
589
+ |param|type|description|
590
+ |-----|----|-----------|
591
+ |`x`|`Int32`|The first value|
592
+ |`y`|`Int32`|The second value|
593
+
594
+ Returns:
595
+
596
+ |type|description|
597
+ |----|-----------|
598
+ |`Bool`|`true` if the first value is less than the second value or `false` otherwise|
599
+
600
+ ### Int32.**gt**
601
+
602
+ <details disabled>
603
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
604
+ No other changes yet.
605
+ </details>
606
+
607
+ ```grain
608
+ gt : (Int32, Int32) -> Bool
609
+ ```
610
+
611
+ Checks if the first value is greater than the second value.
612
+
613
+ Parameters:
614
+
615
+ |param|type|description|
616
+ |-----|----|-----------|
617
+ |`x`|`Int32`|The first value|
618
+ |`y`|`Int32`|The second value|
619
+
620
+ Returns:
621
+
622
+ |type|description|
623
+ |----|-----------|
624
+ |`Bool`|`true` if the first value is greater than the second value or `false` otherwise|
625
+
626
+ ### Int32.**gtU**
627
+
628
+ <details disabled>
629
+ <summary tabindex="-1">Added in <code>next</code></summary>
630
+ No other changes yet.
631
+ </details>
632
+
633
+ ```grain
634
+ gtU : (Int32, Int32) -> Bool
635
+ ```
636
+
637
+ Checks if the first unsigned value is greater than the second unsigned value.
638
+
639
+ Parameters:
640
+
641
+ |param|type|description|
642
+ |-----|----|-----------|
643
+ |`x`|`Int32`|The first value|
644
+ |`y`|`Int32`|The second value|
645
+
646
+ Returns:
647
+
648
+ |type|description|
649
+ |----|-----------|
650
+ |`Bool`|`true` if the first value is greater than the second value or `false` otherwise|
651
+
652
+ ### Int32.**lte**
653
+
654
+ <details disabled>
655
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
656
+ No other changes yet.
657
+ </details>
658
+
659
+ ```grain
660
+ lte : (Int32, Int32) -> Bool
661
+ ```
662
+
663
+ Checks if the first value is less than or equal to the second value.
664
+
665
+ Parameters:
666
+
667
+ |param|type|description|
668
+ |-----|----|-----------|
669
+ |`x`|`Int32`|The first value|
670
+ |`y`|`Int32`|The second value|
671
+
672
+ Returns:
673
+
674
+ |type|description|
675
+ |----|-----------|
676
+ |`Bool`|`true` if the first value is less than or equal to the second value or `false` otherwise|
677
+
678
+ ### Int32.**lteU**
679
+
680
+ <details disabled>
681
+ <summary tabindex="-1">Added in <code>next</code></summary>
682
+ No other changes yet.
683
+ </details>
684
+
685
+ ```grain
686
+ lteU : (Int32, Int32) -> Bool
687
+ ```
688
+
689
+ Checks if the first unsigned value is less than or equal to the second unsigned value.
690
+
691
+ Parameters:
692
+
693
+ |param|type|description|
694
+ |-----|----|-----------|
695
+ |`x`|`Int32`|The first value|
696
+ |`y`|`Int32`|The second value|
697
+
698
+ Returns:
699
+
700
+ |type|description|
701
+ |----|-----------|
702
+ |`Bool`|`true` if the first value is less than or equal to the second value or `false` otherwise|
703
+
704
+ ### Int32.**gte**
705
+
706
+ <details disabled>
707
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
708
+ No other changes yet.
709
+ </details>
710
+
711
+ ```grain
712
+ gte : (Int32, Int32) -> Bool
713
+ ```
714
+
715
+ Checks if the first value is greater than or equal to the second value.
716
+
717
+ Parameters:
718
+
719
+ |param|type|description|
720
+ |-----|----|-----------|
721
+ |`x`|`Int32`|The first value|
722
+ |`y`|`Int32`|The second value|
723
+
724
+ Returns:
725
+
726
+ |type|description|
727
+ |----|-----------|
728
+ |`Bool`|`true` if the first value is greater than or equal to the second value or `false` otherwise|
729
+
730
+ ### Int32.**gteU**
731
+
732
+ <details disabled>
733
+ <summary tabindex="-1">Added in <code>next</code></summary>
734
+ No other changes yet.
735
+ </details>
736
+
737
+ ```grain
738
+ gteU : (Int32, Int32) -> Bool
739
+ ```
740
+
741
+ Checks if the first unsigned value is greater than or equal to the second unsigned value.
742
+
743
+ Parameters:
744
+
745
+ |param|type|description|
746
+ |-----|----|-----------|
747
+ |`x`|`Int32`|The first value|
748
+ |`y`|`Int32`|The second value|
749
+
750
+ Returns:
751
+
752
+ |type|description|
753
+ |----|-----------|
754
+ |`Bool`|`true` if the first value is greater than or equal to the second value or `false` otherwise|
755
+
756
+ ## Bitwise logic
757
+
758
+ Boolean operations on the bits of Int32 values.
759
+
760
+ ### Int32.**lnot**
761
+
762
+ <details disabled>
763
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
764
+ No other changes yet.
765
+ </details>
766
+
767
+ ```grain
768
+ lnot : Int32 -> Int32
769
+ ```
770
+
771
+ Computes the bitwise NOT of the given value.
772
+
773
+ Parameters:
774
+
775
+ |param|type|description|
776
+ |-----|----|-----------|
777
+ |`value`|`Int32`|The given value|
778
+
779
+ Returns:
780
+
781
+ |type|description|
782
+ |----|-----------|
783
+ |`Int32`|Containing the inverted bits of the given value|
784
+
785
+ ### Int32.**land**
786
+
787
+ <details disabled>
788
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
789
+ No other changes yet.
790
+ </details>
791
+
792
+ ```grain
793
+ land : (Int32, Int32) -> Int32
794
+ ```
795
+
796
+ Computes the bitwise AND (`&`) on the given operands.
797
+
798
+ Parameters:
799
+
800
+ |param|type|description|
801
+ |-----|----|-----------|
802
+ |`x`|`Int32`|The first operand|
803
+ |`y`|`Int32`|The second operand|
804
+
805
+ Returns:
806
+
807
+ |type|description|
808
+ |----|-----------|
809
+ |`Int32`|Containing a `1` in each bit position for which the corresponding bits of both operands are `1`|
810
+
811
+ ### Int32.**lor**
812
+
813
+ <details disabled>
814
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
815
+ No other changes yet.
816
+ </details>
817
+
818
+ ```grain
819
+ lor : (Int32, Int32) -> Int32
820
+ ```
821
+
822
+ Computes the bitwise OR (`|`) on the given operands.
823
+
824
+ Parameters:
825
+
826
+ |param|type|description|
827
+ |-----|----|-----------|
828
+ |`x`|`Int32`|The first operand|
829
+ |`y`|`Int32`|The second operand|
830
+
831
+ Returns:
832
+
833
+ |type|description|
834
+ |----|-----------|
835
+ |`Int32`|Containing a `1` in each bit position for which the corresponding bits of either or both operands are `1`|
836
+
837
+ ### Int32.**lxor**
838
+
839
+ <details disabled>
840
+ <summary tabindex="-1">Added in <code>0.2.0</code></summary>
841
+ No other changes yet.
842
+ </details>
843
+
844
+ ```grain
845
+ lxor : (Int32, Int32) -> Int32
846
+ ```
847
+
848
+ Computes the bitwise XOR (`^`) on the given operands.
849
+
850
+ Parameters:
851
+
852
+ |param|type|description|
853
+ |-----|----|-----------|
854
+ |`x`|`Int32`|The first operand|
855
+ |`y`|`Int32`|The second operand|
856
+
857
+ Returns:
858
+
859
+ |type|description|
860
+ |----|-----------|
861
+ |`Int32`|Containing a `1` in each bit position for which the corresponding bits of either but not both operands are `1`|
862
+
863
+ ### Int32.**clz**
864
+
865
+ <details disabled>
866
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
867
+ No other changes yet.
868
+ </details>
869
+
870
+ ```grain
871
+ clz : Int32 -> Int32
872
+ ```
873
+
874
+ Counts the number of leading zero bits in the value.
875
+
876
+ Parameters:
877
+
878
+ |param|type|description|
879
+ |-----|----|-----------|
880
+ |`value`|`Int32`|The value to inspect|
881
+
882
+ Returns:
883
+
884
+ |type|description|
885
+ |----|-----------|
886
+ |`Int32`|The amount of leading zeros|
887
+
888
+ ### Int32.**ctz**
889
+
890
+ <details disabled>
891
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
892
+ No other changes yet.
893
+ </details>
894
+
895
+ ```grain
896
+ ctz : Int32 -> Int32
897
+ ```
898
+
899
+ Counts the number of trailing zero bits in the value.
900
+
901
+ Parameters:
902
+
903
+ |param|type|description|
904
+ |-----|----|-----------|
905
+ |`value`|`Int32`|The value to inspect|
906
+
907
+ Returns:
908
+
909
+ |type|description|
910
+ |----|-----------|
911
+ |`Int32`|The amount of trailing zeros|
912
+
913
+ ### Int32.**popcnt**
914
+
915
+ <details disabled>
916
+ <summary tabindex="-1">Added in <code>0.4.0</code></summary>
917
+ No other changes yet.
918
+ </details>
919
+
920
+ ```grain
921
+ popcnt : Int32 -> Int32
922
+ ```
923
+
924
+ Counts the number of bits set to `1` in the value, also known as a population count.
925
+
926
+ Parameters:
927
+
928
+ |param|type|description|
929
+ |-----|----|-----------|
930
+ |`value`|`Int32`|The value to inspect|
931
+
932
+ Returns:
933
+
934
+ |type|description|
935
+ |----|-----------|
936
+ |`Int32`|The amount of 1-bits in its operand|
937
+