@glutinum/cli 0.13.0 → 0.14.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 (319) hide show
  1. package/README.md +19 -1
  2. package/dist/Glutinum.Converter/Abbreviations.js +246 -0
  3. package/dist/Glutinum.Converter/FsharpAST.js +87 -28
  4. package/dist/Glutinum.Converter/Generate.js +55 -8
  5. package/dist/Glutinum.Converter/GlueAST.js +333 -34
  6. package/dist/Glutinum.Converter/Log.js +7 -8
  7. package/dist/Glutinum.Converter/Merge.js +683 -31
  8. package/dist/Glutinum.Converter/Packages.js +308 -0
  9. package/dist/Glutinum.Converter/Printer.js +323 -186
  10. package/dist/Glutinum.Converter/Read.js +279 -6
  11. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +13 -7
  12. package/dist/Glutinum.Converter/Reader/Declaration.js +102 -17
  13. package/dist/Glutinum.Converter/Reader/Documentation.js +168 -73
  14. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +7 -51
  15. package/dist/Glutinum.Converter/Reader/ExportAssignment.js +64 -15
  16. package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +165 -0
  17. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +30 -5
  18. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +122 -4
  19. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +83 -7
  20. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +8 -8
  21. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +11 -9
  22. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +3 -2
  23. package/dist/Glutinum.Converter/Reader/Node.js +24 -10
  24. package/dist/Glutinum.Converter/Reader/Parameters.js +110 -7
  25. package/dist/Glutinum.Converter/Reader/Report.js +31 -12
  26. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +4 -3
  27. package/dist/Glutinum.Converter/Reader/TypeNode.js +1524 -253
  28. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +75 -20
  29. package/dist/Glutinum.Converter/Reader/TypeParameters.js +8 -5
  30. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +184 -50
  31. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +32 -13
  32. package/dist/Glutinum.Converter/Reader/Types.js +180 -0
  33. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +99 -43
  34. package/dist/Glutinum.Converter/Reader/Utils.js +1143 -55
  35. package/dist/Glutinum.Converter/Reader/VariableStatement.js +59 -14
  36. package/dist/Glutinum.Converter/Transform.js +8292 -1119
  37. package/dist/Glutinum.Converter/TypeScript.Extensions.js +3 -3
  38. package/dist/Glutinum.Converter/TypeScript.js +3 -3
  39. package/dist/Glutinum.Converter/Utils/Keywords.js +6 -6
  40. package/dist/Glutinum.Converter/Utils/List.js +3 -3
  41. package/dist/Glutinum.Converter/Utils/Naming.js +61 -12
  42. package/dist/Glutinum.Converter/Utils/String.js +7 -3
  43. package/dist/Program.js +230 -72
  44. package/dist/fable_modules/Fable.Promise.3.2.1/AsyncIterable.fs +89 -0
  45. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/AsyncIterable.fs.js +29 -29
  46. package/dist/fable_modules/Fable.Promise.3.2.1/Fable.Promise.fableproj +25 -0
  47. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs +842 -766
  48. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs.js +26 -12
  49. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs +31 -31
  50. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs.js +5 -5
  51. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs +235 -0
  52. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs.js +384 -0
  53. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AssemblyInfo.fs +4 -4
  54. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs +89 -9
  55. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs.js +13 -12
  56. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOption.fs +50 -4
  57. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs +30 -39
  58. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs.js +10 -10
  59. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResult.fs +52 -8
  60. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs +26 -42
  61. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs.js +3 -3
  62. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOption.fs +17 -5
  63. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOption.fs.js +26 -0
  64. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs +31 -33
  65. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs.js +3 -3
  66. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidation.fs +1 -6
  67. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs +10 -18
  68. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs.js +3 -3
  69. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/FsToolkit.ErrorHandling.fableproj +69 -0
  70. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs +68 -10
  71. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs.js +47 -41
  72. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Nullness.fs +81 -0
  73. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Option.fs +133 -2
  74. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs +139 -0
  75. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs.js +48 -0
  76. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/OptionOp.fs +3 -3
  77. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs +88 -0
  78. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs.js +30 -0
  79. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs +200 -0
  80. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs.js +18 -0
  81. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidation.fs +34 -0
  82. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs +244 -0
  83. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs.js +18 -0
  84. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs +87 -0
  85. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs.js +8 -8
  86. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs +8 -23
  87. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs.js +5 -5
  88. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs +1 -1
  89. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs.js +10 -10
  90. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs +7 -18
  91. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs.js +3 -3
  92. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs +503 -0
  93. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs.js +295 -0
  94. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Validation.fs +0 -5
  95. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs +7 -13
  96. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs.js +3 -3
  97. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValueOption.fs +1 -4
  98. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOption.fs +102 -0
  99. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionCE.fs +587 -0
  100. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionOp.fs +10 -0
  101. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +3 -3
  102. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.fs +3 -0
  103. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1 → FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0}/FsToolkit.ErrorHandling.AssemblyInfo.fs +4 -4
  104. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +4 -4
  105. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
  106. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Array.js +192 -86
  107. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Async.js +58 -53
  108. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/AsyncBuilder.js +29 -8
  109. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BigInt.js +71 -46
  110. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BitConverter.js +2 -2
  111. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Boolean.js +4 -3
  112. package/dist/fable_modules/fable-library-js.5.17.2/CHANGELOG.md +348 -0
  113. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Char.js +64 -31
  114. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Choice.js +2 -2
  115. package/dist/fable_modules/fable-library-js.5.17.2/CollectionUtil.js +182 -0
  116. package/dist/fable_modules/fable-library-js.5.17.2/ConditionalWeakTable.js +21 -0
  117. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Date.js +197 -112
  118. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOffset.js +46 -62
  119. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOnly.js +6 -6
  120. package/dist/fable_modules/fable-library-js.5.17.2/DateOnlyTemporal.js +146 -0
  121. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeFormat.js +523 -0
  122. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeOffsetTemporal.js +283 -0
  123. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeTemporal.js +243 -0
  124. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Decimal.js +39 -13
  125. package/dist/fable_modules/fable-library-js.5.17.2/Directory.js +11 -0
  126. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Double.js +10 -3
  127. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Encoding.js +20 -8
  128. package/dist/fable_modules/fable-library-js.5.17.2/Environment.js +3 -0
  129. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Event.js +10 -1
  130. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Collections.js +45 -0
  131. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Core.js +156 -0
  132. package/dist/fable_modules/fable-library-js.5.17.2/File.js +27 -0
  133. package/dist/fable_modules/fable-library-js.5.17.2/Global.js +29 -0
  134. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Guid.js +33 -12
  135. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Int32.js +17 -17
  136. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/List.js +170 -106
  137. package/dist/fable_modules/fable-library-js.5.17.2/Long.js +38 -0
  138. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MailboxProcessor.js +13 -6
  139. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Map.js +65 -61
  140. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MapUtil.js +22 -4
  141. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableMap.js +28 -16
  142. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableSet.js +7 -7
  143. package/dist/fable_modules/fable-library-js.5.17.2/Native.js +14 -0
  144. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Numeric.js +44 -3
  145. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Observable.js +5 -3
  146. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Option.js +11 -20
  147. package/dist/fable_modules/fable-library-js.5.17.2/Path.js +31 -0
  148. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Random.js +22 -20
  149. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Range.js +12 -12
  150. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Reflection.js +50 -22
  151. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/RegExp.js +68 -30
  152. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Result.js +6 -6
  153. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq.js +229 -104
  154. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq2.js +1 -1
  155. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Set.js +153 -113
  156. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/String.js +238 -50
  157. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Collections.Generic.js +30 -14
  158. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Text.js +69 -31
  159. package/dist/fable_modules/fable-library-js.5.17.2/System.js +289 -0
  160. package/dist/fable_modules/fable-library-js.5.17.2/Task.js +27 -0
  161. package/dist/fable_modules/fable-library-js.5.17.2/TaskBuilder.js +72 -0
  162. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeOnly.js +6 -6
  163. package/dist/fable_modules/fable-library-js.5.17.2/TimeOnlyTemporal.js +142 -0
  164. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeSpan.js +18 -15
  165. package/dist/fable_modules/fable-library-js.5.17.2/TimeSpanTemporal.js +259 -0
  166. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Types.js +14 -24
  167. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Uri.js +44 -21
  168. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Util.js +49 -12
  169. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/lib/big.js +14 -11
  170. package/dist/fable_modules/fable-library-js.5.17.2/package.json +24 -0
  171. package/dist/fable_modules/fable-library-js.5.17.2/quotation.js +682 -0
  172. package/package.json +4 -4
  173. package/src/Glutinum.Converter/js/bootstrap.js +109 -2
  174. package/src/Glutinum.Converter/js/host.js +144 -0
  175. package/src/Glutinum.Converter/js/npm.js +137 -0
  176. package/src/Glutinum.Converter/js/resolve.js +402 -0
  177. package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
  178. package/dist/Glutinum.Converter/Generate.js.map +0 -1
  179. package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
  180. package/dist/Glutinum.Converter/Log.js.map +0 -1
  181. package/dist/Glutinum.Converter/Merge.js.map +0 -1
  182. package/dist/Glutinum.Converter/Printer.js.map +0 -1
  183. package/dist/Glutinum.Converter/Read.js.map +0 -1
  184. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
  185. package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
  186. package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
  187. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
  188. package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
  189. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
  190. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
  191. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
  192. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
  193. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
  194. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
  195. package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
  196. package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
  197. package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
  198. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
  199. package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
  200. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
  201. package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
  202. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
  203. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
  204. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
  205. package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
  206. package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
  207. package/dist/Glutinum.Converter/Transform.js.map +0 -1
  208. package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
  209. package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
  210. package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
  211. package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
  212. package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
  213. package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
  214. package/dist/Program.js.map +0 -1
  215. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
  216. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
  217. package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
  218. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
  219. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
  220. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
  221. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
  222. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
  223. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
  224. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
  225. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
  226. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
  227. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
  228. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
  229. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
  230. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
  231. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
  232. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
  233. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
  234. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
  235. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
  236. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
  237. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
  238. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
  239. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
  240. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
  241. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
  242. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
  243. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
  244. package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
  245. package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
  246. package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
  247. package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
  248. package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
  249. package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
  250. package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
  251. package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
  252. package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
  253. package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
  254. package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
  255. package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
  256. package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
  257. package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
  258. package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
  259. package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
  260. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
  261. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
  262. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
  263. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
  264. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
  265. package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
  266. package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
  267. package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
  268. package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
  269. package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
  270. package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
  271. package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
  272. package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
  273. package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
  274. package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
  275. package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
  276. package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
  277. package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
  278. package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
  279. package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
  280. package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
  281. package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
  282. package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
  283. package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
  284. package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
  285. package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
  286. package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
  287. package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
  288. package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
  289. package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
  290. package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
  291. package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
  292. package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
  293. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
  294. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
  295. package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
  296. package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
  297. package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
  298. package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
  299. package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
  300. package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
  301. package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
  302. package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
  303. package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
  304. package/dist/fable_modules/project_cracked.json +0 -1
  305. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionOp.fs +0 -0
  306. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOp.fs +0 -0
  307. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionOp.fs +0 -0
  308. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationOp.fs +0 -0
  309. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOp.fs +0 -0
  310. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionOp.fs +0 -0
  311. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationOp.fs +0 -0
  312. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -0
  313. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  314. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -0
  315. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/FSharp.Core.CompilerServices.js +0 -0
  316. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/README.md +0 -0
  317. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Timer.js +0 -0
  318. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Unicode.13.0.0.js +0 -0
  319. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/big.d.ts +0 -0
@@ -0,0 +1,587 @@
1
+ namespace FsToolkit.ErrorHandling
2
+
3
+ open System
4
+ open System.Runtime.CompilerServices
5
+ open System.Threading
6
+ open System.Threading.Tasks
7
+ open Microsoft.FSharp.Core
8
+ open Microsoft.FSharp.Core.CompilerServices
9
+ open Microsoft.FSharp.Core.CompilerServices.StateMachineHelpers
10
+ open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators
11
+ open Microsoft.FSharp.Control
12
+ open Microsoft.FSharp.Collections
13
+
14
+ /// ValueTask<'T voption>
15
+ type ValueTaskValueOption<'T> = ValueTask<'T voption>
16
+
17
+ [<Struct; NoComparison; NoEquality>]
18
+ type ValueTaskValueOptionStateMachineData<'T> =
19
+
20
+ [<DefaultValue(false)>]
21
+ val mutable Result: 'T voption voption
22
+
23
+ [<DefaultValue(false)>]
24
+ val mutable MethodBuilder: AsyncValueTaskValueOptionMethodBuilder<'T>
25
+
26
+ member this.IsResultNone =
27
+ match this.Result with
28
+ | ValueNone -> false
29
+ | ValueSome(ValueNone) -> true
30
+ | ValueSome _ -> false
31
+
32
+ member this.SetResult() =
33
+ match this.Result with
34
+ | ValueNone -> this.MethodBuilder.SetResult ValueNone
35
+ | ValueSome x -> this.MethodBuilder.SetResult x
36
+
37
+ member this.IsTaskCompleted = this.MethodBuilder.Task.IsCompleted
38
+
39
+ and AsyncValueTaskValueOptionMethodBuilder<'TOverall> =
40
+ AsyncValueTaskMethodBuilder<'TOverall voption>
41
+
42
+ and ValueTaskValueOptionStateMachine<'TOverall> =
43
+ ResumableStateMachine<ValueTaskValueOptionStateMachineData<'TOverall>>
44
+
45
+ and ValueTaskValueOptionResumptionFunc<'TOverall> =
46
+ ResumptionFunc<ValueTaskValueOptionStateMachineData<'TOverall>>
47
+
48
+ and ValueTaskValueOptionResumptionDynamicInfo<'TOverall> =
49
+ ResumptionDynamicInfo<ValueTaskValueOptionStateMachineData<'TOverall>>
50
+
51
+ and ValueTaskValueOptionCode<'TOverall, 'T> =
52
+ ResumableCode<ValueTaskValueOptionStateMachineData<'TOverall>, 'T>
53
+
54
+ type ValueTaskValueOptionBuilderBase() =
55
+
56
+ member inline _.Delay
57
+ (generator: unit -> ValueTaskValueOptionCode<'TOverall, 'T>)
58
+ : ValueTaskValueOptionCode<'TOverall, 'T> =
59
+ ValueTaskValueOptionCode<'TOverall, 'T>(fun sm -> (generator ()).Invoke(&sm))
60
+
61
+ /// Used to represent no-ops like the implicit empty "else" branch of an "if" expression.
62
+ [<DefaultValue>]
63
+ member inline _.Zero<'TOverall>() : ValueTaskValueOptionCode<'TOverall, unit> =
64
+ ValueTaskValueOptionCode<_, _>(fun sm ->
65
+ sm.Data.Result <- ValueSome(ValueSome Unchecked.defaultof<'TOverall>)
66
+ true
67
+ )
68
+
69
+ member inline _.Return(value: 'T) : ValueTaskValueOptionCode<'T, 'T> =
70
+ ValueTaskValueOptionCode<'T, _>(fun sm ->
71
+ sm.Data.Result <- ValueSome(ValueSome value)
72
+ true
73
+ )
74
+
75
+ /// Chains together a step with its following step.
76
+ /// Note that this requires that the first step has no result.
77
+ /// This prevents constructs like `task { return 1; return 2; }`.
78
+ member inline _.Combine
79
+ (
80
+ task1: ValueTaskValueOptionCode<'TOverall, unit>,
81
+ task2: ValueTaskValueOptionCode<'TOverall, 'T>
82
+ ) : ValueTaskValueOptionCode<'TOverall, 'T> =
83
+
84
+ ResumableCode.Combine(
85
+ task1,
86
+ ValueTaskValueOptionCode<'TOverall, 'T>(fun sm ->
87
+ if sm.Data.IsResultNone then true else task2.Invoke(&sm)
88
+ )
89
+ )
90
+
91
+ /// Builds a step that executes the body while the condition predicate is true.
92
+ member inline _.While
93
+ ([<InlineIfLambda>] condition: unit -> bool, body: ValueTaskValueOptionCode<'TOverall, unit>) : ValueTaskValueOptionCode<
94
+ 'TOverall,
95
+ unit
96
+ >
97
+ =
98
+ let mutable keepGoing = true
99
+
100
+ ResumableCode.While(
101
+ (fun () ->
102
+ keepGoing
103
+ && condition ()
104
+ ),
105
+ ValueTaskValueOptionCode<_, _>(fun sm ->
106
+ if sm.Data.IsResultNone then
107
+ keepGoing <- false
108
+ sm.Data.SetResult()
109
+ true
110
+ else
111
+ body.Invoke(&sm)
112
+ )
113
+ )
114
+
115
+
116
+ /// Wraps a step in a try/with. This catches exceptions both in the evaluation of the function
117
+ /// to retrieve the step, and in the continuation of the step (if any).
118
+ member inline _.TryWith
119
+ (
120
+ body: ValueTaskValueOptionCode<'TOverall, 'T>,
121
+ catch: exn -> ValueTaskValueOptionCode<'TOverall, 'T>
122
+ ) : ValueTaskValueOptionCode<'TOverall, 'T> =
123
+ ResumableCode.TryWith(body, catch)
124
+
125
+ /// Wraps a step in a try/finally. This catches exceptions both in the evaluation of the function
126
+ /// to retrieve the step, and in the continuation of the step (if any).
127
+ member inline _.TryFinally
128
+ (
129
+ body: ValueTaskValueOptionCode<'TOverall, 'T>,
130
+ [<InlineIfLambda>] compensation: unit -> unit
131
+ ) : ValueTaskValueOptionCode<'TOverall, 'T> =
132
+ ResumableCode.TryFinally(
133
+ body,
134
+ ResumableCode<_, _>(fun _sm ->
135
+ compensation ()
136
+ true
137
+ )
138
+ )
139
+
140
+ member inline this.For
141
+ (sequence: seq<'T>, body: 'T -> ValueTaskValueOptionCode<'TOverall, unit>)
142
+ : ValueTaskValueOptionCode<'TOverall, unit> =
143
+ ResumableCode.Using(
144
+ sequence.GetEnumerator(),
145
+ // ... and its body is a while loop that advances the enumerator and runs the body on each element.
146
+ (fun e ->
147
+ this.While(
148
+ (fun () -> e.MoveNext()),
149
+ ValueTaskValueOptionCode<'TOverall, unit>(fun sm ->
150
+ (body e.Current).Invoke(&sm)
151
+ )
152
+ )
153
+ )
154
+ )
155
+
156
+ member inline internal this.TryFinallyAsync
157
+ (body: ValueTaskValueOptionCode<'TOverall, 'T>, compensation: unit -> ValueTask)
158
+ : ValueTaskValueOptionCode<'TOverall, 'T> =
159
+ ResumableCode.TryFinallyAsync(
160
+ body,
161
+ ResumableCode<_, _>(fun sm ->
162
+ if __useResumableCode then
163
+ let mutable __stack_condition_fin = true
164
+ let __stack_vtask = compensation ()
165
+
166
+ if not __stack_vtask.IsCompleted then
167
+ let mutable awaiter = __stack_vtask.GetAwaiter()
168
+ let __stack_yield_fin = ResumableCode.Yield().Invoke(&sm)
169
+ __stack_condition_fin <- __stack_yield_fin
170
+
171
+ if not __stack_condition_fin then
172
+ sm.Data.MethodBuilder.AwaitUnsafeOnCompleted(&awaiter, &sm)
173
+
174
+ __stack_condition_fin
175
+ else
176
+ let vtask = compensation ()
177
+ let mutable awaiter = vtask.GetAwaiter()
178
+
179
+ let cont =
180
+ ValueTaskValueOptionResumptionFunc<'TOverall>(fun sm ->
181
+ awaiter.GetResult()
182
+ |> ignore
183
+
184
+ true
185
+ )
186
+
187
+ // shortcut to continue immediately
188
+ if awaiter.IsCompleted then
189
+ true
190
+ else
191
+ sm.ResumptionDynamicInfo.ResumptionData <-
192
+ (awaiter :> ICriticalNotifyCompletion)
193
+
194
+ sm.ResumptionDynamicInfo.ResumptionFunc <- cont
195
+ false
196
+ )
197
+ )
198
+
199
+ member inline this.Using<'Resource, 'TOverall, 'T when 'Resource :> IAsyncDisposableNull>
200
+ (resource: 'Resource, body: 'Resource -> ValueTaskValueOptionCode<'TOverall, 'T>)
201
+ : ValueTaskValueOptionCode<'TOverall, 'T> =
202
+ this.TryFinallyAsync(
203
+ (fun sm -> (body resource).Invoke(&sm)),
204
+ (fun () ->
205
+ if not (isNull (box resource)) then
206
+ resource.DisposeAsync()
207
+ else
208
+ ValueTask()
209
+ )
210
+ )
211
+
212
+ member inline this.Source
213
+ (valueTaskValueOption: ValueTaskValueOption<'T>)
214
+ : ValueTaskValueOption<'T> =
215
+ valueTaskValueOption
216
+
217
+ type ValueTaskValueOptionBuilder() =
218
+
219
+ inherit ValueTaskValueOptionBuilderBase()
220
+
221
+ // This is the dynamic implementation - this is not used
222
+ // for statically compiled tasks. An executor (resumptionFuncExecutor) is
223
+ // registered with the state machine, plus the initial resumption.
224
+ // The executor stays constant throughout the execution, it wraps each step
225
+ // of the execution in a try/with. The resumption is changed at each step
226
+ // to represent the continuation of the computation.
227
+ static member RunDynamic(code: ValueTaskValueOptionCode<'T, 'T>) : ValueTaskValueOption<'T> =
228
+ let mutable sm = ValueTaskValueOptionStateMachine<'T>()
229
+
230
+ let initialResumptionFunc =
231
+ ValueTaskValueOptionResumptionFunc<'T>(fun sm -> code.Invoke(&sm))
232
+
233
+ let resumptionInfo =
234
+ { new ValueTaskValueOptionResumptionDynamicInfo<_>(initialResumptionFunc) with
235
+ member info.MoveNext(sm) =
236
+ let mutable savedExn = null
237
+
238
+ try
239
+ sm.ResumptionDynamicInfo.ResumptionData <- null
240
+ let step = info.ResumptionFunc.Invoke(&sm)
241
+
242
+ // If the `sm.Data.MethodBuilder` has already been set somewhere else (like While/WhileDynamic), we shouldn't continue
243
+ if sm.Data.IsTaskCompleted then
244
+ ()
245
+
246
+ if step then
247
+ sm.Data.SetResult()
248
+ else
249
+ match sm.ResumptionDynamicInfo.ResumptionData with
250
+ | :? ICriticalNotifyCompletion as awaiter ->
251
+ let mutable awaiter = awaiter
252
+ sm.Data.MethodBuilder.AwaitUnsafeOnCompleted(&awaiter, &sm)
253
+ | awaiter -> assert not (isNull awaiter)
254
+
255
+ with exn ->
256
+ savedExn <- exn
257
+ // Run SetException outside the stack unwind, see https://github.com/dotnet/roslyn/issues/26567
258
+ match savedExn with
259
+ | null -> ()
260
+ | exn -> sm.Data.MethodBuilder.SetException exn
261
+
262
+ member _.SetStateMachine(sm, state) =
263
+ sm.Data.MethodBuilder.SetStateMachine(state)
264
+ }
265
+
266
+ sm.ResumptionDynamicInfo <- resumptionInfo
267
+ sm.Data.MethodBuilder <- AsyncValueTaskValueOptionMethodBuilder<'T>.Create()
268
+ sm.Data.MethodBuilder.Start(&sm)
269
+ sm.Data.MethodBuilder.Task
270
+
271
+ member inline _.Run(code: ValueTaskValueOptionCode<'T, 'T>) : ValueTaskValueOption<'T> =
272
+ if __useResumableCode then
273
+ __stateMachine<ValueTaskValueOptionStateMachineData<'T>, ValueTaskValueOption<'T>>
274
+ (MoveNextMethodImpl<_>(fun sm ->
275
+ //-- RESUMABLE CODE START
276
+ __resumeAt sm.ResumptionPoint
277
+ let mutable __stack_exn: ExceptionNull = null
278
+
279
+ try
280
+ let __stack_code_fin = code.Invoke(&sm)
281
+
282
+ if
283
+ __stack_code_fin
284
+ && not sm.Data.IsTaskCompleted
285
+ then
286
+ sm.Data.SetResult()
287
+ with exn ->
288
+ __stack_exn <- exn
289
+ // Run SetException outside the stack unwind, see https://github.com/dotnet/roslyn/issues/26567
290
+ match __stack_exn with
291
+ | null -> ()
292
+ | exn -> sm.Data.MethodBuilder.SetException exn
293
+ //-- RESUMABLE CODE END
294
+ ))
295
+ (SetStateMachineMethodImpl<_>(fun sm state ->
296
+ sm.Data.MethodBuilder.SetStateMachine(state)
297
+ ))
298
+ (AfterCode<_, _>(fun sm ->
299
+ sm.Data.MethodBuilder <- AsyncValueTaskValueOptionMethodBuilder<'T>.Create()
300
+ sm.Data.MethodBuilder.Start(&sm)
301
+ sm.Data.MethodBuilder.Task
302
+ ))
303
+ else
304
+ ValueTaskValueOptionBuilder.RunDynamic(code)
305
+
306
+ [<AutoOpen>]
307
+ module ValueTaskValueOptionBuilder =
308
+
309
+ /// <summary>
310
+ /// Builds a <c>ValueTask&lt;'T voption&gt;</c> using the computation expression syntax.
311
+ /// </summary>
312
+ let valueTaskValueOption = ValueTaskValueOptionBuilder()
313
+
314
+
315
+ open Microsoft.FSharp.Control
316
+ open System
317
+ open System.Runtime.CompilerServices
318
+ open System.Threading.Tasks
319
+ open Microsoft.FSharp.Core
320
+ open Microsoft.FSharp.Core.CompilerServices
321
+ open Microsoft.FSharp.Core.CompilerServices.StateMachineHelpers
322
+ open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators
323
+
324
+ [<AutoOpen>]
325
+ module ValueTaskValueOptionCEExtensionsLowPriority =
326
+ // Low priority extensions
327
+ type ValueTaskValueOptionBuilderBase with
328
+
329
+ [<NoEagerConstraintApplication>]
330
+ static member inline BindDynamic< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall
331
+ when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter)
332
+ and ^Awaiter :> ICriticalNotifyCompletion
333
+ and ^Awaiter: (member get_IsCompleted: unit -> bool)
334
+ and ^Awaiter: (member GetResult: unit -> 'TResult1 voption)>
335
+ (
336
+ sm: byref<_>,
337
+ task: ^TaskLike,
338
+ continuation: ('TResult1 -> ValueTaskValueOptionCode<'TOverall, 'TResult2>)
339
+ ) : bool =
340
+
341
+ let mutable awaiter = (^TaskLike: (member GetAwaiter: unit -> ^Awaiter) (task))
342
+
343
+ let cont =
344
+ (ValueTaskValueOptionResumptionFunc<'TOverall>(fun sm ->
345
+ let result =
346
+ (^Awaiter: (member GetResult: unit -> 'TResult1 voption) (awaiter))
347
+
348
+ match result with
349
+ | ValueSome result -> (continuation result).Invoke(&sm)
350
+ | ValueNone ->
351
+ sm.Data.Result <- ValueSome ValueNone
352
+ true
353
+ ))
354
+
355
+ // shortcut to continue immediately
356
+ if (^Awaiter: (member get_IsCompleted: unit -> bool) (awaiter)) then
357
+ cont.Invoke(&sm)
358
+ else
359
+ sm.ResumptionDynamicInfo.ResumptionData <- (awaiter :> ICriticalNotifyCompletion)
360
+ sm.ResumptionDynamicInfo.ResumptionFunc <- cont
361
+ false
362
+
363
+ [<NoEagerConstraintApplication>]
364
+ member inline _.Bind< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall
365
+ when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter)
366
+ and ^Awaiter :> ICriticalNotifyCompletion
367
+ and ^Awaiter: (member get_IsCompleted: unit -> bool)
368
+ and ^Awaiter: (member GetResult: unit -> 'TResult1 voption)>
369
+ (
370
+ task: ^TaskLike,
371
+ continuation: ('TResult1 -> ValueTaskValueOptionCode<'TOverall, 'TResult2>)
372
+ ) : ValueTaskValueOptionCode<'TOverall, 'TResult2> =
373
+
374
+ ValueTaskValueOptionCode<'TOverall, _>(fun sm ->
375
+ if __useResumableCode then
376
+ //-- RESUMABLE CODE START
377
+ // Get an awaiter from the awaitable
378
+ let mutable awaiter = (^TaskLike: (member GetAwaiter: unit -> ^Awaiter) (task))
379
+
380
+ let mutable __stack_fin = true
381
+
382
+ if not (^Awaiter: (member get_IsCompleted: unit -> bool) (awaiter)) then
383
+ // This will yield with __stack_yield_fin = false
384
+ // This will resume with __stack_yield_fin = true
385
+ let __stack_yield_fin = ResumableCode.Yield().Invoke(&sm)
386
+ __stack_fin <- __stack_yield_fin
387
+
388
+ if __stack_fin then
389
+ let result =
390
+ (^Awaiter: (member GetResult: unit -> 'TResult1 voption) (awaiter))
391
+
392
+ match result with
393
+ | ValueSome result -> (continuation result).Invoke(&sm)
394
+ | ValueNone ->
395
+ sm.Data.Result <- ValueSome ValueNone
396
+ true
397
+ else
398
+ sm.Data.MethodBuilder.AwaitUnsafeOnCompleted(&awaiter, &sm)
399
+ false
400
+ else
401
+ ValueTaskValueOptionBuilderBase.BindDynamic<
402
+ ^TaskLike,
403
+ 'TResult1,
404
+ 'TResult2,
405
+ ^Awaiter,
406
+ 'TOverall
407
+ >(
408
+ &sm,
409
+ task,
410
+ continuation
411
+ )
412
+ //-- RESUMABLE CODE END
413
+ )
414
+
415
+ [<NoEagerConstraintApplication>]
416
+ member inline this.ReturnFrom< ^TaskLike, ^Awaiter, 'T
417
+ when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter)
418
+ and ^Awaiter :> ICriticalNotifyCompletion
419
+ and ^Awaiter: (member get_IsCompleted: unit -> bool)
420
+ and ^Awaiter: (member GetResult: unit -> 'T voption)>
421
+ (task: ^TaskLike)
422
+ : ValueTaskValueOptionCode<'T, 'T> =
423
+
424
+ this.Bind(task, (fun v -> this.Return v))
425
+
426
+ [<NoEagerConstraintApplication>]
427
+ member inline this.Source< ^TaskLike, ^Awaiter, 'T
428
+ when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter)
429
+ and ^Awaiter :> ICriticalNotifyCompletion
430
+ and ^Awaiter: (member get_IsCompleted: unit -> bool)
431
+ and ^Awaiter: (member GetResult: unit -> 'T)>
432
+ (t: ^TaskLike)
433
+ : ValueTaskValueOption<'T> =
434
+
435
+ ValueTask<'T voption>(
436
+ task {
437
+ let! r = t
438
+ return ValueSome r
439
+ }
440
+ )
441
+
442
+ member inline _.Using<'Resource, 'TOverall, 'T when 'Resource :> IDisposableNull>
443
+ (resource: 'Resource, body: 'Resource -> ValueTaskValueOptionCode<'TOverall, 'T>)
444
+ =
445
+ ResumableCode.Using(resource, body)
446
+
447
+ [<AutoOpen>]
448
+ module ValueTaskValueOptionCEExtensionsHighPriority =
449
+ // High priority extensions
450
+ type ValueTaskValueOptionBuilderBase with
451
+
452
+ static member BindDynamic
453
+ (
454
+ sm: byref<_>,
455
+ task: ValueTaskValueOption<'TResult1>,
456
+ continuation: ('TResult1 -> ValueTaskValueOptionCode<'TOverall, 'TResult2>)
457
+ ) : bool =
458
+ let mutable awaiter = task.GetAwaiter()
459
+
460
+ let cont =
461
+ (ValueTaskValueOptionResumptionFunc<'TOverall>(fun sm ->
462
+ let result = awaiter.GetResult()
463
+
464
+ match result with
465
+ | ValueSome result -> (continuation result).Invoke(&sm)
466
+ | ValueNone ->
467
+ sm.Data.Result <- ValueSome ValueNone
468
+ true
469
+ ))
470
+
471
+ // shortcut to continue immediately
472
+ if awaiter.IsCompleted then
473
+ cont.Invoke(&sm)
474
+ else
475
+ sm.ResumptionDynamicInfo.ResumptionData <- (awaiter :> ICriticalNotifyCompletion)
476
+ sm.ResumptionDynamicInfo.ResumptionFunc <- cont
477
+ false
478
+
479
+ member inline _.Bind
480
+ (
481
+ task: ValueTaskValueOption<'TResult1>,
482
+ continuation: ('TResult1 -> ValueTaskValueOptionCode<'TOverall, 'TResult2>)
483
+ ) : ValueTaskValueOptionCode<'TOverall, 'TResult2> =
484
+
485
+ ValueTaskValueOptionCode<'TOverall, _>(fun sm ->
486
+ if __useResumableCode then
487
+ //-- RESUMABLE CODE START
488
+ // Get an awaiter from the task
489
+ let mutable awaiter = task.GetAwaiter()
490
+
491
+ let mutable __stack_fin = true
492
+
493
+ if not awaiter.IsCompleted then
494
+ // This will yield with __stack_yield_fin = false
495
+ // This will resume with __stack_yield_fin = true
496
+ let __stack_yield_fin = ResumableCode.Yield().Invoke(&sm)
497
+ __stack_fin <- __stack_yield_fin
498
+
499
+ if __stack_fin then
500
+ let result = awaiter.GetResult()
501
+
502
+ match result with
503
+ | ValueSome result -> (continuation result).Invoke(&sm)
504
+ | ValueNone ->
505
+ sm.Data.Result <- ValueSome ValueNone
506
+ true
507
+
508
+ else
509
+ sm.Data.MethodBuilder.AwaitUnsafeOnCompleted(&awaiter, &sm)
510
+ false
511
+
512
+ else
513
+ ValueTaskValueOptionBuilderBase.BindDynamic(&sm, task, continuation)
514
+ //-- RESUMABLE CODE END
515
+ )
516
+
517
+ member inline this.BindReturn(x: ValueTaskValueOption<'T>, [<InlineIfLambda>] f) =
518
+ this.Bind(x, (fun x -> this.Return(f x)))
519
+
520
+ member inline _.MergeSources(t1: ValueTaskValueOption<'T>, t2: ValueTaskValueOption<'T1>) =
521
+ ValueTaskValueOption.zip t1 t2
522
+
523
+ member inline this.ReturnFrom
524
+ (task: ValueTaskValueOption<'T>)
525
+ : ValueTaskValueOptionCode<'T, 'T> =
526
+ this.Bind(task, (fun v -> this.Return v))
527
+
528
+ member inline _.Source(s: #seq<_>) = s
529
+
530
+ [<AutoOpen>]
531
+ module ValueTaskValueOptionCEExtensionsMediumPriority =
532
+
533
+ // Medium priority extensions
534
+ type ValueTaskValueOptionBuilderBase with
535
+
536
+ member inline this.Source(t: Task<'T>) : ValueTaskValueOption<'T> =
537
+ ValueTask<'T voption>(Task.map ValueSome t)
538
+
539
+ member inline this.Source(t: Task) : ValueTaskValueOption<unit> =
540
+ ValueTask<unit voption>(
541
+ task {
542
+ do! t
543
+ return ValueSome()
544
+ }
545
+ )
546
+
547
+ member inline this.Source(t: ValueTask<'T>) : ValueTaskValueOption<'T> =
548
+ ValueTask<'T voption>(
549
+ task {
550
+ let! r = t
551
+ return ValueSome r
552
+ }
553
+ )
554
+
555
+ member inline this.Source(t: ValueTask) : ValueTaskValueOption<unit> =
556
+ ValueTask<unit voption>(
557
+ task {
558
+ do! t
559
+ return ValueSome()
560
+ }
561
+ )
562
+
563
+ member inline this.Source(opt: 'T voption) : ValueTaskValueOption<'T> =
564
+ ValueTask<'T voption>(opt)
565
+
566
+ member inline this.Source(computation: Async<'T>) : ValueTaskValueOption<'T> =
567
+ ValueTask<'T voption>(
568
+ computation
569
+ |> Async.map ValueSome
570
+ |> Async.StartImmediateAsTask
571
+ )
572
+
573
+
574
+ [<AutoOpen>]
575
+ module ValueTaskValueOptionCEExtensionsHighPriority2 =
576
+
577
+ // High priority extensions 2
578
+ type ValueTaskValueOptionBuilderBase with
579
+
580
+ member inline this.Source(computation: Async<'T voption>) : ValueTaskValueOption<'T> =
581
+ ValueTask<'T voption>(
582
+ computation
583
+ |> Async.StartImmediateAsTask
584
+ )
585
+
586
+ member inline this.Source(taskValueOption: Task<'T voption>) : ValueTaskValueOption<'T> =
587
+ ValueTask<'T voption>(taskValueOption)
@@ -0,0 +1,10 @@
1
+ namespace FsToolkit.ErrorHandling.Operator.ValueTaskValueOption
2
+
3
+ open FsToolkit.ErrorHandling
4
+
5
+ [<AutoOpen>]
6
+ module ValueTaskValueOption =
7
+
8
+ let inline (<!>) ([<InlineIfLambda>] f) x = ValueTaskValueOption.map f x
9
+ let inline (<*>) f x = ValueTaskValueOption.apply f x
10
+ let inline (>>=) x ([<InlineIfLambda>] f) = ValueTaskValueOption.bind f x
@@ -9,12 +9,12 @@ open System.Reflection
9
9
 
10
10
  [<assembly: System.Reflection.AssemblyCompanyAttribute("demystifyfp, TheAngryByrd")>]
11
11
  [<assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")>]
12
- [<assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © 2018-23")>]
12
+ [<assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © 2018-24")>]
13
13
  [<assembly: System.Reflection.AssemblyDescriptionAttribute("FsToolkit.ErrorHandling is an extensive utility library based around the F# Result type, enabling consistent and powerful error handling.")>]
14
14
  [<assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")>]
15
- [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")>]
15
+ [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+eb57861f9f3f657d2c972313ef3ea843448fd5e4")>]
16
16
  [<assembly: System.Reflection.AssemblyProductAttribute("FsToolkit.ErrorHandling")>]
17
17
  [<assembly: System.Reflection.AssemblyTitleAttribute("FsToolkit.ErrorHandling")>]
18
18
  [<assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")>]
19
- [<assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "")>]
19
+ [<assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/demystifyfp/FsToolkit.ErrorHandling.git")>]
20
20
  do()
@@ -0,0 +1,3 @@
1
+ namespace Microsoft.BuildSettings
2
+ [<System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v9.0", FrameworkDisplayName=".NET 9.0")>]
3
+ do ()
@@ -9,12 +9,12 @@ open System.Reflection
9
9
 
10
10
  [<assembly: System.Reflection.AssemblyCompanyAttribute("demystifyfp, TheAngryByrd")>]
11
11
  [<assembly: System.Reflection.AssemblyConfigurationAttribute("Release")>]
12
- [<assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © 2018-23")>]
12
+ [<assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © 2018-24")>]
13
13
  [<assembly: System.Reflection.AssemblyDescriptionAttribute("FsToolkit.ErrorHandling is an extensive utility library based around the F# Result type, enabling consistent and powerful error handling.")>]
14
- [<assembly: System.Reflection.AssemblyFileVersionAttribute("4.16.0.0")>]
15
- [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("4.16.0+fab8e207658725148034926a7aa1578c93c168ae")>]
14
+ [<assembly: System.Reflection.AssemblyFileVersionAttribute("5.2.0.0")>]
15
+ [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("5.2.0+eb57861f9f3f657d2c972313ef3ea843448fd5e4")>]
16
16
  [<assembly: System.Reflection.AssemblyProductAttribute("FsToolkit.ErrorHandling")>]
17
17
  [<assembly: System.Reflection.AssemblyTitleAttribute("FsToolkit.ErrorHandling")>]
18
- [<assembly: System.Reflection.AssemblyVersionAttribute("4.16.0.0")>]
18
+ [<assembly: System.Reflection.AssemblyVersionAttribute("5.2.0.0")>]
19
19
  [<assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/demystifyfp/FsToolkit.ErrorHandling.git")>]
20
20
  do()
@@ -9,12 +9,12 @@ open System.Reflection
9
9
 
10
10
  [<assembly: System.Reflection.AssemblyCompanyAttribute("demystifyfp, TheAngryByrd")>]
11
11
  [<assembly: System.Reflection.AssemblyConfigurationAttribute("Release")>]
12
- [<assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © 2018-23")>]
12
+ [<assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © 2018-24")>]
13
13
  [<assembly: System.Reflection.AssemblyDescriptionAttribute("FsToolkit.ErrorHandling is an extensive utility library based around the F# Result type, enabling consistent and powerful error handling.")>]
14
- [<assembly: System.Reflection.AssemblyFileVersionAttribute("4.16.0.0")>]
15
- [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("4.16.0+fab8e207658725148034926a7aa1578c93c168ae")>]
14
+ [<assembly: System.Reflection.AssemblyFileVersionAttribute("5.2.0.0")>]
15
+ [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("5.2.0+eb57861f9f3f657d2c972313ef3ea843448fd5e4")>]
16
16
  [<assembly: System.Reflection.AssemblyProductAttribute("FsToolkit.ErrorHandling")>]
17
17
  [<assembly: System.Reflection.AssemblyTitleAttribute("FsToolkit.ErrorHandling")>]
18
- [<assembly: System.Reflection.AssemblyVersionAttribute("4.16.0.0")>]
18
+ [<assembly: System.Reflection.AssemblyVersionAttribute("5.2.0.0")>]
19
19
  [<assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/demystifyfp/FsToolkit.ErrorHandling.git")>]
20
20
  do()
@@ -0,0 +1,20 @@
1
+ // <auto-generated>
2
+ // Generated by the FSharp WriteCodeFragment class.
3
+ // </auto-generated>
4
+ namespace FSharp
5
+
6
+ open System
7
+ open System.Reflection
8
+
9
+
10
+ [<assembly: System.Reflection.AssemblyCompanyAttribute("demystifyfp, TheAngryByrd")>]
11
+ [<assembly: System.Reflection.AssemblyConfigurationAttribute("Release")>]
12
+ [<assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © 2018-24")>]
13
+ [<assembly: System.Reflection.AssemblyDescriptionAttribute("FsToolkit.ErrorHandling is an extensive utility library based around the F# Result type, enabling consistent and powerful error handling.")>]
14
+ [<assembly: System.Reflection.AssemblyFileVersionAttribute("5.2.0.0")>]
15
+ [<assembly: System.Reflection.AssemblyInformationalVersionAttribute("5.2.0+eb57861f9f3f657d2c972313ef3ea843448fd5e4")>]
16
+ [<assembly: System.Reflection.AssemblyProductAttribute("FsToolkit.ErrorHandling")>]
17
+ [<assembly: System.Reflection.AssemblyTitleAttribute("FsToolkit.ErrorHandling")>]
18
+ [<assembly: System.Reflection.AssemblyVersionAttribute("5.2.0.0")>]
19
+ [<assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/demystifyfp/FsToolkit.ErrorHandling.git")>]
20
+ do()