@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/char.md CHANGED
@@ -27,6 +27,27 @@ from "char" include Char
27
27
  '🌾'
28
28
  ```
29
29
 
30
+ ## Types
31
+
32
+ Type declarations included in the Char module.
33
+
34
+ ### Char.**Encoding**
35
+
36
+ <details disabled>
37
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
38
+ No other changes yet.
39
+ </details>
40
+
41
+ ```grain
42
+ enum Encoding {
43
+ UTF8,
44
+ UTF16,
45
+ UTF32,
46
+ }
47
+ ```
48
+
49
+ Byte encodings
50
+
30
51
  ## Values
31
52
 
32
53
  Functions and constants included in the Char module.
@@ -39,7 +60,7 @@ No other changes yet.
39
60
  </details>
40
61
 
41
62
  ```grain
42
- min : Number
63
+ min: Number
43
64
  ```
44
65
 
45
66
  The minimum valid Unicode scalar value.
@@ -52,7 +73,7 @@ No other changes yet.
52
73
  </details>
53
74
 
54
75
  ```grain
55
- max : Number
76
+ max: Number
56
77
  ```
57
78
 
58
79
  The maximum valid Unicode scalar value.
@@ -65,22 +86,22 @@ No other changes yet.
65
86
  </details>
66
87
 
67
88
  ```grain
68
- isValid : (charCode: Number) => Bool
89
+ isValid: (charCode: Number) => Bool
69
90
  ```
70
91
 
71
92
  Determines whether the given character code is a valid Unicode scalar value.
72
93
 
73
94
  Parameters:
74
95
 
75
- |param|type|description|
76
- |-----|----|-----------|
77
- |`charCode`|`Number`|The number to check|
96
+ | param | type | description |
97
+ | ---------- | -------- | ------------------- |
98
+ | `charCode` | `Number` | The number to check |
78
99
 
79
100
  Returns:
80
101
 
81
- |type|description|
82
- |----|-----------|
83
- |`Bool`|`true` if the number refers to a valid Unicode scalar value or `false` otherwise|
102
+ | type | description |
103
+ | ------ | -------------------------------------------------------------------------------- |
104
+ | `Bool` | `true` if the number refers to a valid Unicode scalar value or `false` otherwise |
84
105
 
85
106
  Examples:
86
107
 
@@ -100,22 +121,22 @@ No other changes yet.
100
121
  </details>
101
122
 
102
123
  ```grain
103
- code : (char: Char) => Number
124
+ code: (char: Char) => Number
104
125
  ```
105
126
 
106
127
  Determines the Unicode scalar value for a character.
107
128
 
108
129
  Parameters:
109
130
 
110
- |param|type|description|
111
- |-----|----|-----------|
112
- |`char`|`Char`|The character|
131
+ | param | type | description |
132
+ | ------ | ------ | ------------- |
133
+ | `char` | `Char` | The character |
113
134
 
114
135
  Returns:
115
136
 
116
- |type|description|
117
- |----|-----------|
118
- |`Number`|The Unicode scalar value for the given character|
137
+ | type | description |
138
+ | -------- | ------------------------------------------------ |
139
+ | `Number` | The Unicode scalar value for the given character |
119
140
 
120
141
  Examples:
121
142
 
@@ -135,22 +156,22 @@ No other changes yet.
135
156
  </details>
136
157
 
137
158
  ```grain
138
- fromCode : (usv: Number) => Char
159
+ fromCode: (usv: Number) => Char
139
160
  ```
140
161
 
141
162
  Creates a character from the given Unicode scalar value.
142
163
 
143
164
  Parameters:
144
165
 
145
- |param|type|description|
146
- |-----|----|-----------|
147
- |`usv`|`Number`|The Unicode scalar value|
166
+ | param | type | description |
167
+ | ----- | -------- | ------------------------ |
168
+ | `usv` | `Number` | The Unicode scalar value |
148
169
 
149
170
  Returns:
150
171
 
151
- |type|description|
152
- |----|-----------|
153
- |`Char`|The character for the given Unicode scalar value|
172
+ | type | description |
173
+ | ------ | ------------------------------------------------ |
174
+ | `Char` | The character for the given Unicode scalar value |
154
175
 
155
176
  Throws:
156
177
 
@@ -176,22 +197,22 @@ No other changes yet.
176
197
  </details>
177
198
 
178
199
  ```grain
179
- succ : (char: Char) => Char
200
+ succ: (char: Char) => Char
180
201
  ```
181
202
 
182
203
  Returns the next valid character by Unicode scalar value.
183
204
 
184
205
  Parameters:
185
206
 
186
- |param|type|description|
187
- |-----|----|-----------|
188
- |`char`|`Char`|The character|
207
+ | param | type | description |
208
+ | ------ | ------ | ------------- |
209
+ | `char` | `Char` | The character |
189
210
 
190
211
  Returns:
191
212
 
192
- |type|description|
193
- |----|-----------|
194
- |`Char`|The next valid character by Unicode scalar value|
213
+ | type | description |
214
+ | ------ | ------------------------------------------------ |
215
+ | `Char` | The next valid character by Unicode scalar value |
195
216
 
196
217
  Throws:
197
218
 
@@ -217,22 +238,22 @@ No other changes yet.
217
238
  </details>
218
239
 
219
240
  ```grain
220
- pred : (char: Char) => Char
241
+ pred: (char: Char) => Char
221
242
  ```
222
243
 
223
244
  Returns the previous valid character by Unicode scalar value.
224
245
 
225
246
  Parameters:
226
247
 
227
- |param|type|description|
228
- |-----|----|-----------|
229
- |`char`|`Char`|The character|
248
+ | param | type | description |
249
+ | ------ | ------ | ------------- |
250
+ | `char` | `Char` | The character |
230
251
 
231
252
  Returns:
232
253
 
233
- |type|description|
234
- |----|-----------|
235
- |`Char`|The previous valid character by Unicode scalar value|
254
+ | type | description |
255
+ | ------ | ---------------------------------------------------- |
256
+ | `Char` | The previous valid character by Unicode scalar value |
236
257
 
237
258
  Throws:
238
259
 
@@ -258,22 +279,22 @@ No other changes yet.
258
279
  </details>
259
280
 
260
281
  ```grain
261
- toString : (char: Char) => String
282
+ toString: (char: Char) => String
262
283
  ```
263
284
 
264
285
  Converts the given character to a string.
265
286
 
266
287
  Parameters:
267
288
 
268
- |param|type|description|
269
- |-----|----|-----------|
270
- |`char`|`Char`|The character to convert|
289
+ | param | type | description |
290
+ | ------ | ------ | ------------------------ |
291
+ | `char` | `Char` | The character to convert |
271
292
 
272
293
  Returns:
273
294
 
274
- |type|description|
275
- |----|-----------|
276
- |`String`|A string containing the given character|
295
+ | type | description |
296
+ | -------- | --------------------------------------- |
297
+ | `String` | A string containing the given character |
277
298
 
278
299
  Examples:
279
300
 
@@ -285,6 +306,46 @@ Char.toString('a') == "a"
285
306
  Char.toString('🌾') == "🌾"
286
307
  ```
287
308
 
309
+ ### Char.**encodedLength**
310
+
311
+ <details disabled>
312
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
313
+ No other changes yet.
314
+ </details>
315
+
316
+ ```grain
317
+ encodedLength: (encoding: Encoding, char: Char) => Number
318
+ ```
319
+
320
+ Returns the byte count of a character if encoded in the given encoding.
321
+
322
+ Parameters:
323
+
324
+ | param | type | description |
325
+ | ---------- | ---------- | --------------------- |
326
+ | `encoding` | `Encoding` | The encoding to check |
327
+ | `char` | `Char` | The character |
328
+
329
+ Returns:
330
+
331
+ | type | description |
332
+ | -------- | ----------------------------------------------------- |
333
+ | `Number` | The byte count of the character in the given encoding |
334
+
335
+ Examples:
336
+
337
+ ```grain
338
+ Char.encodedLength(Char.UTF8, 'a') == 1
339
+ ```
340
+
341
+ ```grain
342
+ Char.encodedLength(Char.UTF8, '🌾') == 4
343
+ ```
344
+
345
+ ```grain
346
+ Char.encodedLength(Char.UTF16, '©') == 1
347
+ ```
348
+
288
349
  ### Char.**(<)**
289
350
 
290
351
  <details disabled>
@@ -293,23 +354,23 @@ No other changes yet.
293
354
  </details>
294
355
 
295
356
  ```grain
296
- (<) : (x: Char, y: Char) => Bool
357
+ (<): (x: Char, y: Char) => Bool
297
358
  ```
298
359
 
299
360
  Checks if the first character is less than the second character by Unicode scalar value.
300
361
 
301
362
  Parameters:
302
363
 
303
- |param|type|description|
304
- |-----|----|-----------|
305
- |`x`|`Char`|The first character|
306
- |`y`|`Char`|The second character|
364
+ | param | type | description |
365
+ | ----- | ------ | -------------------- |
366
+ | `x` | `Char` | The first character |
367
+ | `y` | `Char` | The second character |
307
368
 
308
369
  Returns:
309
370
 
310
- |type|description|
311
- |----|-----------|
312
- |`Bool`|`true` if the first character is less than the second character or `false` otherwise|
371
+ | type | description |
372
+ | ------ | ------------------------------------------------------------------------------------ |
373
+ | `Bool` | `true` if the first character is less than the second character or `false` otherwise |
313
374
 
314
375
  Examples:
315
376
 
@@ -331,23 +392,23 @@ No other changes yet.
331
392
  </details>
332
393
 
333
394
  ```grain
334
- (<=) : (x: Char, y: Char) => Bool
395
+ (<=): (x: Char, y: Char) => Bool
335
396
  ```
336
397
 
337
398
  Checks if the first character is less than or equal to the second character by Unicode scalar value.
338
399
 
339
400
  Parameters:
340
401
 
341
- |param|type|description|
342
- |-----|----|-----------|
343
- |`x`|`Char`|The first character|
344
- |`y`|`Char`|The second character|
402
+ | param | type | description |
403
+ | ----- | ------ | -------------------- |
404
+ | `x` | `Char` | The first character |
405
+ | `y` | `Char` | The second character |
345
406
 
346
407
  Returns:
347
408
 
348
- |type|description|
349
- |----|-----------|
350
- |`Bool`|`true` if the first character is less than or equal to the second character or `false` otherwise|
409
+ | type | description |
410
+ | ------ | ------------------------------------------------------------------------------------------------ |
411
+ | `Bool` | `true` if the first character is less than or equal to the second character or `false` otherwise |
351
412
 
352
413
  Examples:
353
414
 
@@ -374,23 +435,23 @@ No other changes yet.
374
435
  </details>
375
436
 
376
437
  ```grain
377
- (>) : (x: Char, y: Char) => Bool
438
+ (>): (x: Char, y: Char) => Bool
378
439
  ```
379
440
 
380
441
  Checks if the first character is greater than the second character by Unicode scalar value.
381
442
 
382
443
  Parameters:
383
444
 
384
- |param|type|description|
385
- |-----|----|-----------|
386
- |`x`|`Char`|The first character|
387
- |`y`|`Char`|The second character|
445
+ | param | type | description |
446
+ | ----- | ------ | -------------------- |
447
+ | `x` | `Char` | The first character |
448
+ | `y` | `Char` | The second character |
388
449
 
389
450
  Returns:
390
451
 
391
- |type|description|
392
- |----|-----------|
393
- |`Bool`|`true` if the first character is greater than the second character or `false` otherwise|
452
+ | type | description |
453
+ | ------ | --------------------------------------------------------------------------------------- |
454
+ | `Bool` | `true` if the first character is greater than the second character or `false` otherwise |
394
455
 
395
456
  Examples:
396
457
 
@@ -412,23 +473,23 @@ No other changes yet.
412
473
  </details>
413
474
 
414
475
  ```grain
415
- (>=) : (x: Char, y: Char) => Bool
476
+ (>=): (x: Char, y: Char) => Bool
416
477
  ```
417
478
 
418
479
  Checks if the first character is greater than or equal to the second character by Unicode scalar value.
419
480
 
420
481
  Parameters:
421
482
 
422
- |param|type|description|
423
- |-----|----|-----------|
424
- |`x`|`Char`|The first character|
425
- |`y`|`Char`|The second character|
483
+ | param | type | description |
484
+ | ----- | ------ | -------------------- |
485
+ | `x` | `Char` | The first character |
486
+ | `y` | `Char` | The second character |
426
487
 
427
488
  Returns:
428
489
 
429
- |type|description|
430
- |----|-----------|
431
- |`Bool`|`true` if the first character is greater than or equal to the second character or `false` otherwise|
490
+ | type | description |
491
+ | ------ | --------------------------------------------------------------------------------------------------- |
492
+ | `Bool` | `true` if the first character is greater than or equal to the second character or `false` otherwise |
432
493
 
433
494
  Examples:
434
495
 
@@ -447,135 +508,401 @@ use Char.{ (>=) }
447
508
  assert 'a' >= 'a'
448
509
  ```
449
510
 
450
- ### Char.**isAsciiDigit**
511
+ ## Char.Ascii
512
+
513
+ Utilities for working with ASCII characters.
451
514
 
452
515
  <details disabled>
453
- <summary tabindex="-1">Added in <code>0.6.0</code></summary>
516
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
517
+ No other changes yet.
518
+ </details>
519
+
520
+ ```grain
521
+ Char.Ascii.isAscii('1')
522
+ ```
523
+
524
+ ### Values
525
+
526
+ Functions and constants included in the Char.Ascii module.
527
+
528
+ #### Char.Ascii.**min**
529
+
530
+ <details disabled>
531
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
454
532
  No other changes yet.
455
533
  </details>
456
534
 
457
535
  ```grain
458
- isAsciiDigit : (char: Char) => Bool
536
+ min: Number
537
+ ```
538
+
539
+ The minimum valid ASCII character code.
540
+
541
+ #### Char.Ascii.**max**
542
+
543
+ <details disabled>
544
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
545
+ No other changes yet.
546
+ </details>
547
+
548
+ ```grain
549
+ max: Number
550
+ ```
551
+
552
+ The maximum valid ASCII character code.
553
+
554
+ #### Char.Ascii.**isValid**
555
+
556
+ <details disabled>
557
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
558
+ No other changes yet.
559
+ </details>
560
+
561
+ ```grain
562
+ isValid: (char: Char) => Bool
563
+ ```
564
+
565
+ Checks if the character is a valid ASCII character.
566
+
567
+ Parameters:
568
+
569
+ | param | type | description |
570
+ | ------ | ------ | ---------------------- |
571
+ | `char` | `Char` | The character to check |
572
+
573
+ Returns:
574
+
575
+ | type | description |
576
+ | ------ | ------------------------------------------------------------------ |
577
+ | `Bool` | `true` if the character is an ASCII character or `false` otherwise |
578
+
579
+ Examples:
580
+
581
+ ```grain
582
+ assert Char.Ascii.isValid('1')
583
+ ```
584
+
585
+ ```grain
586
+ assert Char.Ascii.isValid('a')
587
+ ```
588
+
589
+ ```grain
590
+ assert !Char.Ascii.isValid('🌾')
591
+ ```
592
+
593
+ #### Char.Ascii.**isDigit**
594
+
595
+ <details>
596
+ <summary>Added in <code>0.7.0</code></summary>
597
+ <table>
598
+ <thead>
599
+ <tr><th>version</th><th>changes</th></tr>
600
+ </thead>
601
+ <tbody>
602
+ <tr><td><code>0.6.0</code></td><td>Originally `Char.isAsciiDigit`</td></tr>
603
+ </tbody>
604
+ </table>
605
+ </details>
606
+
607
+ ```grain
608
+ isDigit: (char: Char) => Bool
459
609
  ```
460
610
 
461
611
  Checks if the character is an ASCII digit.
462
612
 
463
613
  Parameters:
464
614
 
465
- |param|type|description|
466
- |-----|----|-----------|
467
- |`char`|`Char`|The character to check|
615
+ | param | type | description |
616
+ | ------ | ------ | ---------------------- |
617
+ | `char` | `Char` | The character to check |
618
+
619
+ Returns:
620
+
621
+ | type | description |
622
+ | ------ | -------------------------------------------------------------- |
623
+ | `Bool` | `true` if the character is an ASCII digit or `false` otherwise |
624
+
625
+ Examples:
626
+
627
+ ```grain
628
+ assert Char.Ascii.isDigit('1')
629
+ ```
630
+
631
+ ```grain
632
+ assert !Char.Ascii.isDigit('a')
633
+ ```
634
+
635
+ #### Char.Ascii.**isAlpha**
636
+
637
+ <details>
638
+ <summary>Added in <code>0.7.0</code></summary>
639
+ <table>
640
+ <thead>
641
+ <tr><th>version</th><th>changes</th></tr>
642
+ </thead>
643
+ <tbody>
644
+ <tr><td><code>0.6.0</code></td><td>Originally `Char.isAsciiAlpha`</td></tr>
645
+ </tbody>
646
+ </table>
647
+ </details>
648
+
649
+ ```grain
650
+ isAlpha: (char: Char) => Bool
651
+ ```
652
+
653
+ Checks if the character is an ASCII alphabetical character.
654
+
655
+ Parameters:
656
+
657
+ | param | type | description |
658
+ | ------ | ------ | ---------------------- |
659
+ | `char` | `Char` | The character to check |
468
660
 
469
661
  Returns:
470
662
 
471
- |type|description|
472
- |----|-----------|
473
- |`Bool`|`true` if the character is an ASCII digit or `false` otherwise|
663
+ | type | description |
664
+ | ------ | --------------------------------------------------------------------- |
665
+ | `Bool` | `true` if the character is an ASCII alphabetical or `false` otherwise |
474
666
 
475
667
  Examples:
476
668
 
477
669
  ```grain
478
- assert Char.isAsciiDigit('1')
670
+ assert Char.Ascii.isAlpha('a')
479
671
  ```
480
672
 
481
673
  ```grain
482
- assert !Char.isAsciiDigit('a')
674
+ assert !Char.Ascii.isAlpha('1')
483
675
  ```
484
676
 
485
- ### Char.**isAsciiAlpha**
677
+ #### Char.Ascii.**isControl**
486
678
 
487
679
  <details disabled>
488
- <summary tabindex="-1">Added in <code>0.6.0</code></summary>
680
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
489
681
  No other changes yet.
490
682
  </details>
491
683
 
492
684
  ```grain
493
- isAsciiAlpha : (char: Char) => Bool
685
+ isControl: (char: Char) => Bool
494
686
  ```
495
687
 
496
- Checks if the character is an ASCII alphabetical character.
688
+ Checks if the character is an ASCII control character.
497
689
 
498
690
  Parameters:
499
691
 
500
- |param|type|description|
501
- |-----|----|-----------|
502
- |`char`|`Char`|The character to check|
692
+ | param | type | description |
693
+ | ------ | ------ | ---------------------- |
694
+ | `char` | `Char` | The character to check |
503
695
 
504
696
  Returns:
505
697
 
506
- |type|description|
507
- |----|-----------|
508
- |`Bool`|`true` if the character is an ASCII alphabetical or `false` otherwise|
698
+ | type | description |
699
+ | ------ | -------------------------------------------------------------------------- |
700
+ | `Bool` | `true` if the character is an ASCII control character or `false` otherwise |
509
701
 
510
702
  Examples:
511
703
 
512
704
  ```grain
513
- assert Char.isAsciiAlpha('a')
705
+ assert Char.Ascii.isControl('\t')
706
+ ```
707
+
708
+ ```grain
709
+ assert Char.Ascii.isControl('\n')
710
+ ```
711
+
712
+ ```grain
713
+ assert !Char.Ascii.isControl('1')
514
714
  ```
515
715
 
516
716
  ```grain
517
- assert !Char.isAsciiAlpha('1')
717
+ assert !Char.Ascii.isControl('a')
518
718
  ```
519
719
 
520
- ### Char.**toAsciiLowercase**
720
+ #### Char.Ascii.**isWhitespace**
521
721
 
522
722
  <details disabled>
523
- <summary tabindex="-1">Added in <code>0.6.0</code></summary>
723
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
524
724
  No other changes yet.
525
725
  </details>
526
726
 
527
727
  ```grain
528
- toAsciiLowercase : (char: Char) => Char
728
+ isWhitespace: (char: Char) => Bool
529
729
  ```
530
730
 
531
- Converts the character to ASCII lowercase if it is an ASCII uppercase character.
731
+ Checks if the character is an ASCII whitespace character.
532
732
 
533
733
  Parameters:
534
734
 
535
- |param|type|description|
536
- |-----|----|-----------|
537
- |`char`|`Char`|The character to convert|
735
+ | param | type | description |
736
+ | ------ | ------ | ---------------------- |
737
+ | `char` | `Char` | The character to check |
538
738
 
539
739
  Returns:
540
740
 
541
- |type|description|
542
- |----|-----------|
543
- |`Char`|The lowercased character|
741
+ | type | description |
742
+ | ------ | ----------------------------------------------------------------------------- |
743
+ | `Bool` | `true` if the character is an ASCII whitespace character or `false` otherwise |
544
744
 
545
745
  Examples:
546
746
 
547
747
  ```grain
548
- assert Char.toAsciiLowercase('B') == 'b'
748
+ assert Char.isWhitespace('\t')
549
749
  ```
550
750
 
551
- ### Char.**toAsciiUppercase**
751
+ ```grain
752
+ assert Char.isWhitespace('\n')
753
+ ```
754
+
755
+ ```grain
756
+ assert !Char.isWhitespace('1')
757
+ ```
758
+
759
+ ```grain
760
+ assert !Char.isWhitespace('a')
761
+ ```
762
+
763
+ #### Char.Ascii.**isPunctuation**
552
764
 
553
765
  <details disabled>
554
- <summary tabindex="-1">Added in <code>0.6.0</code></summary>
766
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
767
+ No other changes yet.
768
+ </details>
769
+
770
+ ```grain
771
+ isPunctuation: (char: Char) => Bool
772
+ ```
773
+
774
+ Checks if the character is an ASCII punctuation character.
775
+
776
+ Parameters:
777
+
778
+ | param | type | description |
779
+ | ------ | ------ | ---------------------- |
780
+ | `char` | `Char` | The character to check |
781
+
782
+ Returns:
783
+
784
+ | type | description |
785
+ | ------ | ------------------------------------------------------------------------------ |
786
+ | `Bool` | `true` if the character is an ASCII punctuation character or `false` otherwise |
787
+
788
+ Examples:
789
+
790
+ ```grain
791
+ assert Char.Ascii.isPunctuation('!')
792
+ ```
793
+
794
+ ```grain
795
+ assert !Char.Ascii.isPunctuation('1')
796
+ ```
797
+
798
+ #### Char.Ascii.**isGraphic**
799
+
800
+ <details disabled>
801
+ <summary tabindex="-1">Added in <code>0.7.0</code></summary>
555
802
  No other changes yet.
556
803
  </details>
557
804
 
558
805
  ```grain
559
- toAsciiUppercase : (char: Char) => Char
806
+ isGraphic: (char: Char) => Bool
807
+ ```
808
+
809
+ Checks if the character is an ASCII graphic character.
810
+
811
+ Parameters:
812
+
813
+ | param | type | description |
814
+ | ------ | ------ | ---------------------- |
815
+ | `char` | `Char` | The character to check |
816
+
817
+ Returns:
818
+
819
+ | type | description |
820
+ | ------ | -------------------------------------------------------------------------- |
821
+ | `Bool` | `true` if the character is an ASCII graphic character or `false` otherwise |
822
+
823
+ Examples:
824
+
825
+ ```grain
826
+ assert Char.Ascii.isGraphic('!')
827
+ ```
828
+
829
+ ```grain
830
+ assert !Char.Ascii.isGraphic('\t')
831
+ ```
832
+
833
+ #### Char.Ascii.**toLowercase**
834
+
835
+ <details>
836
+ <summary>Added in <code>0.7.0</code></summary>
837
+ <table>
838
+ <thead>
839
+ <tr><th>version</th><th>changes</th></tr>
840
+ </thead>
841
+ <tbody>
842
+ <tr><td><code>0.6.0</code></td><td>Originally `Char.toAsciiLowercase`</td></tr>
843
+ </tbody>
844
+ </table>
845
+ </details>
846
+
847
+ ```grain
848
+ toLowercase: (char: Char) => Char
849
+ ```
850
+
851
+ Converts the character to ASCII lowercase if it is an ASCII uppercase character.
852
+
853
+ Parameters:
854
+
855
+ | param | type | description |
856
+ | ------ | ------ | ------------------------ |
857
+ | `char` | `Char` | The character to convert |
858
+
859
+ Returns:
860
+
861
+ | type | description |
862
+ | ------ | ------------------------ |
863
+ | `Char` | The lowercased character |
864
+
865
+ Examples:
866
+
867
+ ```grain
868
+ assert Char.Ascii.toLowercase('B') == 'b'
869
+ ```
870
+
871
+ #### Char.Ascii.**toUppercase**
872
+
873
+ <details>
874
+ <summary>Added in <code>0.7.0</code></summary>
875
+ <table>
876
+ <thead>
877
+ <tr><th>version</th><th>changes</th></tr>
878
+ </thead>
879
+ <tbody>
880
+ <tr><td><code>0.6.0</code></td><td>Originally `Char.toAsciiUppercase`</td></tr>
881
+ </tbody>
882
+ </table>
883
+ </details>
884
+
885
+ ```grain
886
+ toUppercase: (char: Char) => Char
560
887
  ```
561
888
 
562
889
  Converts the character to ASCII uppercase if it is an ASCII lowercase character.
563
890
 
564
891
  Parameters:
565
892
 
566
- |param|type|description|
567
- |-----|----|-----------|
568
- |`char`|`Char`|The character to convert|
893
+ | param | type | description |
894
+ | ------ | ------ | ------------------------ |
895
+ | `char` | `Char` | The character to convert |
569
896
 
570
897
  Returns:
571
898
 
572
- |type|description|
573
- |----|-----------|
574
- |`Char`|The uppercased character|
899
+ | type | description |
900
+ | ------ | ------------------------ |
901
+ | `Char` | The uppercased character |
575
902
 
576
903
  Examples:
577
904
 
578
905
  ```grain
579
- assert Char.toAsciiUppercase('b') == 'B'
906
+ assert Char.Ascii.toUppercase('b') == 'B'
580
907
  ```
581
908