@grain/stdlib 0.7.0 → 0.7.2

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 (62) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/array.md +491 -491
  3. package/bigint.md +198 -198
  4. package/buffer.gr +66 -1
  5. package/buffer.md +395 -272
  6. package/bytes.gr +1 -0
  7. package/bytes.md +200 -199
  8. package/char.md +125 -125
  9. package/exception.md +9 -9
  10. package/float32.md +195 -195
  11. package/float64.md +195 -195
  12. package/fs.md +115 -115
  13. package/hash.md +16 -16
  14. package/int16.md +155 -155
  15. package/int32.gr +1 -1
  16. package/int32.md +207 -207
  17. package/int64.gr +1 -1
  18. package/int64.md +207 -207
  19. package/int8.md +155 -155
  20. package/json.md +59 -59
  21. package/list.md +347 -347
  22. package/map.md +222 -222
  23. package/marshal.md +12 -12
  24. package/number.gr +119 -5
  25. package/number.md +503 -261
  26. package/option.md +141 -141
  27. package/package.json +2 -2
  28. package/path.gr +82 -65
  29. package/path.md +210 -141
  30. package/pervasives.md +238 -238
  31. package/priorityqueue.md +112 -112
  32. package/queue.md +117 -117
  33. package/random.md +37 -37
  34. package/range.md +36 -36
  35. package/rational.md +107 -107
  36. package/regex.md +91 -91
  37. package/result.md +102 -102
  38. package/runtime/atof/decimal.md +6 -6
  39. package/runtime/compare.md +7 -7
  40. package/runtime/dataStructures.md +178 -178
  41. package/runtime/equal.md +7 -7
  42. package/runtime/exception.md +15 -15
  43. package/runtime/malloc.md +9 -9
  44. package/runtime/numbers.md +269 -269
  45. package/runtime/string.md +17 -17
  46. package/runtime/unsafe/conv.md +6 -6
  47. package/runtime/unsafe/memory.gr +2 -19
  48. package/runtime/unsafe/memory.md +10 -10
  49. package/runtime/utf8.md +31 -31
  50. package/runtime/wasi.md +9 -9
  51. package/set.md +211 -211
  52. package/stack.md +122 -122
  53. package/string.md +228 -228
  54. package/uint16.md +148 -148
  55. package/uint32.md +192 -192
  56. package/uint64.md +192 -192
  57. package/uint8.md +148 -148
  58. package/uri.md +77 -77
  59. package/wasi/file.md +269 -269
  60. package/wasi/process.md +21 -21
  61. package/wasi/random.md +9 -9
  62. package/wasi/time.md +12 -12
package/json.md CHANGED
@@ -556,16 +556,16 @@ Converts the `Json` data structure into a JSON string with specific formatting s
556
556
 
557
557
  Parameters:
558
558
 
559
- |param|type|description|
560
- |-----|----|-----------|
561
- |`?format`|`FormattingChoices`|Formatting options|
562
- |`json`|`Json`|The `Json` data structure to convert|
559
+ | param | type | description |
560
+ | --------- | ------------------- | ------------------------------------ |
561
+ | `?format` | `FormattingChoices` | Formatting options |
562
+ | `json` | `Json` | The `Json` data structure to convert |
563
563
 
564
564
  Returns:
565
565
 
566
- |type|description|
567
- |----|-----------|
568
- |`Result<String, JsonToStringError>`|`Ok(str)` containing the JSON string or `Err(err)` if the provided `Json` data structure cannot be converted to a string|
566
+ | type | description |
567
+ | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
568
+ | `Result<String, JsonToStringError>` | `Ok(str)` containing the JSON string or `Err(err)` if the provided `Json` data structure cannot be converted to a string |
569
569
 
570
570
  Examples:
571
571
 
@@ -623,15 +623,15 @@ Parses JSON string into a `Json` data structure.
623
623
 
624
624
  Parameters:
625
625
 
626
- |param|type|description|
627
- |-----|----|-----------|
628
- |`str`|`String`|The JSON string to parse|
626
+ | param | type | description |
627
+ | ----- | -------- | ------------------------ |
628
+ | `str` | `String` | The JSON string to parse |
629
629
 
630
630
  Returns:
631
631
 
632
- |type|description|
633
- |----|-----------|
634
- |`Result<Json, JsonParseError>`|`Ok(json)` containing the parsed data structure on a successful parse or `Err(err)` containing a parse error otherwise|
632
+ | type | description |
633
+ | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
634
+ | `Result<Json, JsonParseError>` | `Ok(json)` containing the parsed data structure on a successful parse or `Err(err)` containing a parse error otherwise |
635
635
 
636
636
  Examples:
637
637
 
@@ -687,10 +687,10 @@ data.
687
687
 
688
688
  Fields:
689
689
 
690
- |name|type|description|
691
- |----|----|-----------|
692
- |`get`|`(subject: a0) => Option<b0>`|A function which reads a value from the subject.|
693
- |`set`|`(newValue: b0, subject: a0) => Option<a0>`|A function which immutably updates a value in the subject.|
690
+ | name | type | description |
691
+ | ----- | ------------------------------------------- | ---------------------------------------------------------- |
692
+ | `get` | `(subject: a0) => Option<b0>` | A function which reads a value from the subject. |
693
+ | `set` | `(newValue: b0, subject: a0) => Option<a0>` | A function which immutably updates a value in the subject. |
694
694
 
695
695
  ### Values
696
696
 
@@ -706,16 +706,16 @@ Reads the value focused on by the given lens from the input data.
706
706
 
707
707
  Parameters:
708
708
 
709
- |param|type|description|
710
- |-----|----|-----------|
711
- |`lens`|`Lens<a, b>`|The lens to apply to the subject data|
712
- |`subject`|`a`|The data which will have the lens applied to it|
709
+ | param | type | description |
710
+ | --------- | ------------ | ----------------------------------------------- |
711
+ | `lens` | `Lens<a, b>` | The lens to apply to the subject data |
712
+ | `subject` | `a` | The data which will have the lens applied to it |
713
713
 
714
714
  Returns:
715
715
 
716
- |type|description|
717
- |----|-----------|
718
- |`Option<b>`|`Some(data)` containing the data read by the lens if the lens matches the given data, or `None` if the data cannot be matched to the lens|
716
+ | type | description |
717
+ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
718
+ | `Option<b>` | `Some(data)` containing the data read by the lens if the lens matches the given data, or `None` if the data cannot be matched to the lens |
719
719
 
720
720
  Examples:
721
721
 
@@ -742,17 +742,17 @@ desired new value.
742
742
 
743
743
  Parameters:
744
744
 
745
- |param|type|description|
746
- |-----|----|-----------|
747
- |`lens`|`Lens<a, b>`|The lens to apply to the subject data|
748
- |`newValue`|`b`|The new value to set at the focus of the lens|
749
- |`subject`|`a`|The data which will have the lens applied to it|
745
+ | param | type | description |
746
+ | ---------- | ------------ | ----------------------------------------------- |
747
+ | `lens` | `Lens<a, b>` | The lens to apply to the subject data |
748
+ | `newValue` | `b` | The new value to set at the focus of the lens |
749
+ | `subject` | `a` | The data which will have the lens applied to it |
750
750
 
751
751
  Returns:
752
752
 
753
- |type|description|
754
- |----|-----------|
755
- |`Option<a>`|`Some(data)` containing the new data after the lens substitution if the lens matches the given data, or `None` if the data cannot be matched to the lens|
753
+ | type | description |
754
+ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
755
+ | `Option<a>` | `Some(data)` containing the new data after the lens substitution if the lens matches the given data, or `None` if the data cannot be matched to the lens |
756
756
 
757
757
  Examples:
758
758
 
@@ -779,17 +779,17 @@ applying a function to it and setting the focus to the result of the function
779
779
 
780
780
  Parameters:
781
781
 
782
- |param|type|description|
783
- |-----|----|-----------|
784
- |`lens`|`Lens<a, b>`|The lens to apply to the subject data|
785
- |`fn`|`b => b`|The function to apply to the matched data at the lens if matched|
786
- |`subject`|`a`|The data which will have the lens applied to it|
782
+ | param | type | description |
783
+ | --------- | ------------ | ---------------------------------------------------------------- |
784
+ | `lens` | `Lens<a, b>` | The lens to apply to the subject data |
785
+ | `fn` | `b => b` | The function to apply to the matched data at the lens if matched |
786
+ | `subject` | `a` | The data which will have the lens applied to it |
787
787
 
788
788
  Returns:
789
789
 
790
- |type|description|
791
- |----|-----------|
792
- |`Option<a>`|`Some(data)` containing the new data after the lens mapping has been applied if the lens matches the given data, or `None` if the data cannot be matched to the lens|
790
+ | type | description |
791
+ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
792
+ | `Option<a>` | `Some(data)` containing the new data after the lens mapping has been applied if the lens matches the given data, or `None` if the data cannot be matched to the lens |
793
793
 
794
794
  Examples:
795
795
 
@@ -935,15 +935,15 @@ Creates a lens whose focus is a given property of a JSON object.
935
935
 
936
936
  Parameters:
937
937
 
938
- |param|type|description|
939
- |-----|----|-----------|
940
- |`propertyName`|`String`|The property name of the JSON object to focus on|
938
+ | param | type | description |
939
+ | -------------- | -------- | ------------------------------------------------ |
940
+ | `propertyName` | `String` | The property name of the JSON object to focus on |
941
941
 
942
942
  Returns:
943
943
 
944
- |type|description|
945
- |----|-----------|
946
- |`Lens<Json, Json>`|A lens whose focus is the given property of a JSON object|
944
+ | type | description |
945
+ | ------------------ | --------------------------------------------------------- |
946
+ | `Lens<Json, Json>` | A lens whose focus is the given property of a JSON object |
947
947
 
948
948
  Examples:
949
949
 
@@ -1006,15 +1006,15 @@ Creates a lens whose focus is a given property path within a JSON object tree.
1006
1006
 
1007
1007
  Parameters:
1008
1008
 
1009
- |param|type|description|
1010
- |-----|----|-----------|
1011
- |`propertyNames`|`List<String>`|The property path of the JSON object to create a focus on|
1009
+ | param | type | description |
1010
+ | --------------- | -------------- | --------------------------------------------------------- |
1011
+ | `propertyNames` | `List<String>` | The property path of the JSON object to create a focus on |
1012
1012
 
1013
1013
  Returns:
1014
1014
 
1015
- |type|description|
1016
- |----|-----------|
1017
- |`Lens<Json, Json>`|A lens whose focus is the given property path of a JSON object|
1015
+ | type | description |
1016
+ | ------------------ | -------------------------------------------------------------- |
1017
+ | `Lens<Json, Json>` | A lens whose focus is the given property path of a JSON object |
1018
1018
 
1019
1019
  Examples:
1020
1020
 
@@ -1038,16 +1038,16 @@ Reverse lens composition.
1038
1038
 
1039
1039
  Parameters:
1040
1040
 
1041
- |param|type|description|
1042
- |-----|----|-----------|
1043
- |`lens1`|`Lens<a, b>`|The lens which will be applied first|
1044
- |`lens2`|`Lens<b, c>`|The lens which will be applied second|
1041
+ | param | type | description |
1042
+ | ------- | ------------ | ------------------------------------- |
1043
+ | `lens1` | `Lens<a, b>` | The lens which will be applied first |
1044
+ | `lens2` | `Lens<b, c>` | The lens which will be applied second |
1045
1045
 
1046
1046
  Returns:
1047
1047
 
1048
- |type|description|
1049
- |----|-----------|
1050
- |`Lens<a, c>`|A lens which combines the two given lenses, passing through the first and then the second|
1048
+ | type | description |
1049
+ | ------------ | ----------------------------------------------------------------------------------------- |
1050
+ | `Lens<a, c>` | A lens which combines the two given lenses, passing through the first and then the second |
1051
1051
 
1052
1052
  Examples:
1053
1053