@glutinum/cli 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/README.md +35 -3
  2. package/dist/Glutinum.Converter/Abbreviations.js +246 -0
  3. package/dist/Glutinum.Converter/FsharpAST.js +98 -34
  4. package/dist/Glutinum.Converter/Generate.js +55 -8
  5. package/dist/Glutinum.Converter/GlueAST.js +446 -30
  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 +332 -170
  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 -8
  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 +1527 -248
  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 +8710 -1137
  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 +76 -14
  42. package/dist/Glutinum.Converter/Utils/String.js +7 -3
  43. package/dist/Program.js +230 -72
  44. package/package.json +4 -4
  45. package/src/Glutinum.Converter/js/bootstrap.js +109 -2
  46. package/src/Glutinum.Converter/js/host.js +144 -0
  47. package/src/Glutinum.Converter/js/npm.js +137 -0
  48. package/src/Glutinum.Converter/js/resolve.js +402 -0
  49. package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
  50. package/dist/Glutinum.Converter/Generate.js.map +0 -1
  51. package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
  52. package/dist/Glutinum.Converter/Log.js.map +0 -1
  53. package/dist/Glutinum.Converter/Merge.js.map +0 -1
  54. package/dist/Glutinum.Converter/Printer.js.map +0 -1
  55. package/dist/Glutinum.Converter/Read.js.map +0 -1
  56. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
  57. package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
  58. package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
  59. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
  60. package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
  61. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
  62. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
  63. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
  64. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
  65. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
  66. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
  67. package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
  68. package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
  69. package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
  70. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
  71. package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
  72. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
  73. package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
  74. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
  75. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
  76. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
  77. package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
  78. package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
  79. package/dist/Glutinum.Converter/Transform.js.map +0 -1
  80. package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
  81. package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
  82. package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
  83. package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
  84. package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
  85. package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
  86. package/dist/Program.js.map +0 -1
  87. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
  88. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +0 -105
  89. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
  90. package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
  91. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs +0 -766
  92. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +0 -218
  93. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
  94. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +0 -31
  95. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +0 -20
  96. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
  97. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AssemblyInfo.fs +0 -19
  98. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs +0 -207
  99. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js +0 -127
  100. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
  101. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOption.fs +0 -81
  102. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs +0 -183
  103. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js +0 -37
  104. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
  105. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionOp.fs +0 -24
  106. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResult.fs +0 -439
  107. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs +0 -217
  108. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js +0 -18
  109. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
  110. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOp.fs +0 -24
  111. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs +0 -75
  112. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
  113. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
  114. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs +0 -238
  115. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js +0 -18
  116. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
  117. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionOp.fs +0 -24
  118. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidation.fs +0 -190
  119. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs +0 -194
  120. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js +0 -18
  121. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
  122. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationOp.fs +0 -35
  123. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
  124. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs +0 -218
  125. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js +0 -358
  126. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
  127. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Option.fs +0 -331
  128. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
  129. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
  130. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
  131. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionOp.fs +0 -21
  132. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs +0 -644
  133. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js +0 -45
  134. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
  135. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs +0 -155
  136. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js +0 -23
  137. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
  138. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOp.fs +0 -45
  139. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs +0 -201
  140. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js +0 -65
  141. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
  142. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs +0 -146
  143. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js +0 -18
  144. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
  145. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionOp.fs +0 -57
  146. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
  147. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
  148. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
  149. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
  150. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
  151. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
  152. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Validation.fs +0 -172
  153. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs +0 -148
  154. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js +0 -18
  155. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
  156. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationOp.fs +0 -35
  157. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOption.fs +0 -151
  158. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
  159. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
  160. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
  161. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -3
  162. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
  163. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
  164. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
  165. package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
  166. package/dist/fable_modules/fable-library-js.4.14.0/Array.js +0 -1242
  167. package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
  168. package/dist/fable_modules/fable-library-js.4.14.0/Async.js +0 -158
  169. package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
  170. package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.js +0 -183
  171. package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
  172. package/dist/fable_modules/fable-library-js.4.14.0/BigInt.js +0 -282
  173. package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
  174. package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.js +0 -138
  175. package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
  176. package/dist/fable_modules/fable-library-js.4.14.0/Boolean.js +0 -21
  177. package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
  178. package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
  179. package/dist/fable_modules/fable-library-js.4.14.0/Char.js +0 -169
  180. package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
  181. package/dist/fable_modules/fable-library-js.4.14.0/Choice.js +0 -184
  182. package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
  183. package/dist/fable_modules/fable-library-js.4.14.0/Date.js +0 -749
  184. package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
  185. package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.js +0 -268
  186. package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
  187. package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.js +0 -124
  188. package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
  189. package/dist/fable_modules/fable-library-js.4.14.0/Decimal.js +0 -212
  190. package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
  191. package/dist/fable_modules/fable-library-js.4.14.0/Double.js +0 -46
  192. package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
  193. package/dist/fable_modules/fable-library-js.4.14.0/Encoding.js +0 -173
  194. package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
  195. package/dist/fable_modules/fable-library-js.4.14.0/Event.js +0 -93
  196. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
  197. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
  198. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
  199. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.js +0 -27
  200. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
  201. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
  202. package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
  203. package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
  204. package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
  205. package/dist/fable_modules/fable-library-js.4.14.0/Guid.js +0 -142
  206. package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
  207. package/dist/fable_modules/fable-library-js.4.14.0/Int32.js +0 -135
  208. package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
  209. package/dist/fable_modules/fable-library-js.4.14.0/List.js +0 -1273
  210. package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
  211. package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
  212. package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
  213. package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.js +0 -93
  214. package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
  215. package/dist/fable_modules/fable-library-js.4.14.0/Map.js +0 -1396
  216. package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
  217. package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.js +0 -112
  218. package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
  219. package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.js +0 -327
  220. package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
  221. package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.js +0 -233
  222. package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
  223. package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
  224. package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
  225. package/dist/fable_modules/fable-library-js.4.14.0/Numeric.js +0 -71
  226. package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
  227. package/dist/fable_modules/fable-library-js.4.14.0/Observable.js +0 -113
  228. package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
  229. package/dist/fable_modules/fable-library-js.4.14.0/Option.js +0 -96
  230. package/dist/fable_modules/fable-library-js.4.14.0/README.md +0 -3
  231. package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
  232. package/dist/fable_modules/fable-library-js.4.14.0/Random.js +0 -170
  233. package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
  234. package/dist/fable_modules/fable-library-js.4.14.0/Range.js +0 -45
  235. package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
  236. package/dist/fable_modules/fable-library-js.4.14.0/Reflection.js +0 -461
  237. package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
  238. package/dist/fable_modules/fable-library-js.4.14.0/RegExp.js +0 -132
  239. package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
  240. package/dist/fable_modules/fable-library-js.4.14.0/Result.js +0 -165
  241. package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
  242. package/dist/fable_modules/fable-library-js.4.14.0/Seq.js +0 -1379
  243. package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
  244. package/dist/fable_modules/fable-library-js.4.14.0/Seq2.js +0 -111
  245. package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
  246. package/dist/fable_modules/fable-library-js.4.14.0/Set.js +0 -1789
  247. package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
  248. package/dist/fable_modules/fable-library-js.4.14.0/String.js +0 -543
  249. package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
  250. package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.js +0 -317
  251. package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
  252. package/dist/fable_modules/fable-library-js.4.14.0/System.Text.js +0 -162
  253. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
  254. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
  255. package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
  256. package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.js +0 -122
  257. package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
  258. package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.js +0 -177
  259. package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
  260. package/dist/fable_modules/fable-library-js.4.14.0/Timer.js +0 -67
  261. package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
  262. package/dist/fable_modules/fable-library-js.4.14.0/Types.js +0 -208
  263. package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
  264. package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.js +0 -4
  265. package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
  266. package/dist/fable_modules/fable-library-js.4.14.0/Uri.js +0 -142
  267. package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
  268. package/dist/fable_modules/fable-library-js.4.14.0/Util.js +0 -770
  269. package/dist/fable_modules/fable-library-js.4.14.0/big.d.ts +0 -338
  270. package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
  271. package/dist/fable_modules/fable-library-js.4.14.0/lib/big.js +0 -826
  272. package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
  273. package/dist/fable_modules/project_cracked.json +0 -1
@@ -1,24 +0,0 @@
1
- namespace FsToolkit.ErrorHandling.Operator.AsyncResult
2
-
3
- open FsToolkit.ErrorHandling
4
-
5
- [<AutoOpen>]
6
- module AsyncResult =
7
-
8
- let inline (<!>)
9
- (([<InlineIfLambda>] mapper: 'okInput -> 'okOutput))
10
- (input: Async<Result<'okInput, 'error>>)
11
- : Async<Result<'okOutput, 'error>> =
12
- AsyncResult.map mapper input
13
-
14
- let inline (<*>)
15
- (applier: Async<Result<'okInput -> 'okOutput, 'error>>)
16
- (input: Async<Result<'okInput, 'error>>)
17
- : Async<Result<'okOutput, 'error>> =
18
- AsyncResult.apply applier input
19
-
20
- let inline (>>=)
21
- (input: Async<Result<'input, 'error>>)
22
- ([<InlineIfLambda>] binder: 'input -> Async<Result<'okOutput, 'error>>)
23
- : Async<Result<'okOutput, 'error>> =
24
- AsyncResult.bind binder input
@@ -1,75 +0,0 @@
1
- namespace FsToolkit.ErrorHandling
2
-
3
-
4
- type AsyncResultOption<'ok, 'error> = Async<Result<Option<'ok>, 'error>>
5
-
6
- [<RequireQualifiedAccess>]
7
- module AsyncResultOption =
8
-
9
- let inline map
10
- ([<InlineIfLambda>] mapper: 'okInput -> 'okOutput)
11
- (input: Async<Result<'okInput option, 'error>>)
12
- : Async<Result<'okOutput option, 'error>> =
13
- AsyncResult.map (Option.map mapper) input
14
-
15
- let inline bind
16
- ([<InlineIfLambda>] binder: 'okInput -> Async<Result<'okOutput option, 'error>>)
17
- (input: Async<Result<'okInput option, 'error>>)
18
- : Async<Result<'okOutput option, 'error>> =
19
- AsyncResult.bind
20
- (fun opt ->
21
- match opt with
22
- | Some x -> binder x
23
- | None -> AsyncResult.retn None
24
- )
25
- input
26
-
27
-
28
- let inline map2
29
- ([<InlineIfLambda>] mapper: 'okInput1 -> 'okInput2 -> 'okOutput)
30
- (input1: Async<Result<'okInput1 option, 'error>>)
31
- (input2: Async<Result<'okInput2 option, 'error>>)
32
- : Async<Result<'okOutput option, 'error>> =
33
- AsyncResult.map2 (Option.map2 mapper) input1 input2
34
-
35
- let inline map3
36
- ([<InlineIfLambda>] mapper: 'okInput1 -> 'okInput2 -> 'okInput3 -> 'okOutput)
37
- (input1: Async<Result<'okInput1 option, 'error>>)
38
- (input2: Async<Result<'okInput2 option, 'error>>)
39
- (input3: Async<Result<'okInput3 option, 'error>>)
40
- : Async<Result<'okOutput option, 'error>> =
41
- AsyncResult.map3 (Option.map3 mapper) input1 input2 input3
42
-
43
- let inline retn (value: 'ok) : Async<Result<'ok option, 'error>> = AsyncResult.retn (Some value)
44
-
45
- let apply
46
- (applier: Async<Result<('okInput -> 'okOutput) option, 'error>>)
47
- (input: Async<Result<'okInput option, 'error>>)
48
- : Async<Result<'okOutput option, 'error>> =
49
- map2 (fun f x -> f x) applier input
50
-
51
- /// Replaces the wrapped value with unit
52
- let ignore<'ok, 'error>
53
- (value: Async<Result<'ok option, 'error>>)
54
- : Async<Result<unit option, 'error>> =
55
- value
56
- |> map ignore<'ok>
57
-
58
- let inline ofResult (r: Result<'ok, 'error>) =
59
- r
60
- |> Result.map Some
61
- |> Async.singleton
62
-
63
-
64
- let inline ofAsyncResult (r: Async<Result<'ok, 'error>>) =
65
- r
66
- |> AsyncResult.map Some
67
-
68
- let inline ofOption (r: Option<'ok>) =
69
- r
70
- |> Ok
71
- |> Async.singleton
72
-
73
- let inline ofAsyncOption (r: Async<Option<'ok>>) =
74
- r
75
- |> Async.map Ok
@@ -1,26 +0,0 @@
1
- import { singleton } from "../fable-library-js.4.14.0/AsyncBuilder.js";
2
- import { FSharpResult$2 } from "../fable-library-js.4.14.0/Result.js";
3
- import { some, value as value_4 } from "../fable-library-js.4.14.0/Option.js";
4
-
5
- export function AsyncResultOption_apply(applier, input) {
6
- return singleton.Bind(applier, (x_3) => singleton.Bind(input, (y_2) => {
7
- let copyOfStruct, copyOfStruct_1, input1_1, input2_1, x_1, y;
8
- const value = (copyOfStruct = x_3, (copyOfStruct.tag === 1) ? (new FSharpResult$2(1, [copyOfStruct.fields[0]])) : ((copyOfStruct_1 = y_2, (copyOfStruct_1.tag === 1) ? (new FSharpResult$2(1, [copyOfStruct_1.fields[0]])) : (new FSharpResult$2(0, [(input1_1 = copyOfStruct.fields[0], (input2_1 = copyOfStruct_1.fields[0], (input1_1 != null) ? ((input2_1 != null) ? ((x_1 = input1_1, (y = value_4(input2_1), some(x_1(y))))) : void 0) : void 0))])))));
9
- return singleton.Return(value);
10
- }));
11
- }
12
-
13
- /**
14
- * Replaces the wrapped value with unit
15
- */
16
- export function AsyncResultOption_ignore(value) {
17
- return singleton.Bind(value, (x$0027) => {
18
- let input_2;
19
- let value_2;
20
- const input_4 = x$0027;
21
- value_2 = ((input_4.tag === 1) ? (new FSharpResult$2(1, [input_4.fields[0]])) : (new FSharpResult$2(0, [(input_2 = input_4.fields[0], (input_2 == null) ? void 0 : some(void value_4(input_2)))])));
22
- return singleton.Return(value_2);
23
- });
24
- }
25
-
26
- //# sourceMappingURL=AsyncResultOption.fs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["./Async.fs","./AsyncResultOption.fs","./Result.fs","./Option.fs"],"names":["applier","input","copyOfStruct","input1","input2","x","y","value","x\u0027"],"mappings":";;;;;WAoCQ,eCYsBA,kBDZtB,eCY8BC;YCsGxBC,cAAAA,gBCjGLC,UACAC,UAGMC,KAAQC;AHwBIC,uBEqEbL,eFtEiBG,KEsEjB,CAAA,AAAAH,2BAGU,uBAHV,AAAAA,8BAAAA,iBFtEmBI,KEsEnB,CAAA,AAAAJ,6BAGU,uBAHV,AAAAA,\u002BBACU,wBClGfC,WDiGK,AAAAD,yBChGLE,WDgGK,AAAAF,0BC9FA,CAAA,AAACC,qBAAD,CAAA,AAASC,sBACRC,MADAF,WACQG,YADAF,WACK,KFTH,AESeC,IAAEC,SAC3B,UAAA;AH3CJ,eAAA,iBAkEgBC;;;;;;;;WA7CnB,eCkBAA;YElBCN;AHwBUM;AE1CVN,wBFyCcO;AEvCT,AFwCKD,mBExCL,CAAA,AAAAN,sBAEO,uBAAA,AAAAA,wBADH,wBCeTA,UDfS,AAAAA,mBCiBJ,CAAA,AAAAA,mBAEI,SADE,KAAA,aAAAA;AHxBT,eAAA,iBA6CQM","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -1,238 +0,0 @@
1
- namespace FsToolkit.ErrorHandling
2
-
3
- open System
4
- open System.Threading.Tasks
5
-
6
- [<AutoOpen>]
7
- module AsyncResultOptionCE =
8
-
9
- type AsyncResultOptionBuilder() =
10
- member inline _.Return(value: 'ok) : AsyncResultOption<'ok, 'error> =
11
- AsyncResultOption.retn value
12
-
13
- member inline _.ReturnFrom
14
- (value: Async<Result<'ok option, 'error>>)
15
- : Async<Result<'ok option, 'error>> =
16
- value
17
-
18
- member inline _.Bind
19
- (
20
- input: AsyncResultOption<'okInput, 'error>,
21
- [<InlineIfLambda>] binder: 'okInput -> AsyncResultOption<'okOutput, 'error>
22
- ) : AsyncResultOption<'okOutput, 'error> =
23
- AsyncResultOption.bind binder input
24
-
25
- member inline _.Combine(aro1, aro2) =
26
- aro1
27
- |> AsyncResultOption.bind (fun _ -> aro2)
28
-
29
- member inline _.Delay([<InlineIfLambda>] f: unit -> Async<'a>) : Async<'a> = async.Delay f
30
-
31
- member inline _.Zero() = Async.singleton (Ok(option.Zero()))
32
-
33
- member inline _.TryWith
34
- (
35
- computation: AsyncResultOption<'ok, 'error>,
36
- [<InlineIfLambda>] handler: Exception -> AsyncResultOption<'ok, 'error>
37
- ) : AsyncResultOption<'ok, 'error> =
38
- async.TryWith(computation, handler)
39
-
40
- member inline _.TryFinally
41
- (
42
- computation: AsyncResultOption<'ok, 'error>,
43
- [<InlineIfLambda>] compensation: unit -> unit
44
- ) : AsyncResultOption<'ok, 'error> =
45
- async.TryFinally(computation, compensation)
46
-
47
-
48
- #if NETSTANDARD2_1
49
-
50
- member inline _.TryFinallyAsync
51
- (
52
- computation: AsyncResultOption<'ok, 'error>,
53
- [<InlineIfLambda>] compensation: unit -> ValueTask
54
- ) : AsyncResultOption<'ok, 'error> =
55
- let compensation =
56
- async {
57
- let vTask = compensation ()
58
-
59
- if vTask.IsCompletedSuccessfully then
60
- return ()
61
- else
62
- return!
63
- vTask.AsTask()
64
- |> Async.AwaitTask
65
- }
66
-
67
- Async.TryFinallyAsync(computation, compensation)
68
-
69
-
70
- member inline this.Using
71
- (
72
- resource: 'ok :> IAsyncDisposable,
73
- [<InlineIfLambda>] binder: 'ok -> AsyncResultOption<'okOut, 'error>
74
- ) : AsyncResultOption<'okOut, 'error> =
75
- this.TryFinallyAsync(
76
- binder resource,
77
- (fun () ->
78
- if not (isNull (box resource)) then
79
- resource.DisposeAsync()
80
- else
81
- ValueTask()
82
- )
83
- )
84
- #endif
85
-
86
-
87
- member inline this.While
88
- (
89
- [<InlineIfLambda>] guard: unit -> bool,
90
- computation: AsyncResultOption<unit, 'error>
91
- ) : AsyncResultOption<unit, 'error> =
92
- if guard () then
93
- let mutable whileAsync = Unchecked.defaultof<_>
94
-
95
- whileAsync <-
96
- this.Bind(computation, (fun () -> if guard () then whileAsync else this.Zero()))
97
-
98
- whileAsync
99
- else
100
- this.Zero()
101
-
102
- /// <summary>
103
- /// Method lets us transform data types into our internal representation. This is the identity method to recognize the self type.
104
- ///
105
- /// See https://stackoverflow.com/questions/35286541/why-would-you-use-builder-source-in-a-custom-computation-expression-builder
106
- /// </summary>
107
- member inline _.Source
108
- (result: AsyncResultOption<'ok, 'error>)
109
- : AsyncResultOption<'ok, 'error> =
110
- result
111
- #if !FABLE_COMPILER
112
-
113
- /// <summary>
114
- /// Method lets us transform data types into our internal representation. This is the identity method to recognize the self type.
115
- ///
116
- /// See https://stackoverflow.com/questions/35286541/why-would-you-use-builder-source-in-a-custom-computation-expression-builder
117
- /// </summary>
118
- member inline _.Source
119
- (result: Task<Result<Option<'ok>, 'error>>)
120
- : AsyncResultOption<'ok, 'error> =
121
- result
122
- |> Async.AwaitTask
123
- #endif
124
- let asyncResultOption = new AsyncResultOptionBuilder()
125
-
126
-
127
- [<AutoOpen>]
128
- module AsyncResultOptionCEExtensions =
129
-
130
- type AsyncResultOptionBuilder with
131
-
132
- /// <summary>
133
- /// Needed to allow `for..in` and `for..do` functionality
134
- /// </summary>
135
- member inline _.Source(s: #seq<'value>) : #seq<'value> = s
136
-
137
- /// <summary>
138
- /// Method lets us transform data types into our internal representation.
139
- /// </summary>
140
- member inline _.Source(result: Result<'ok, 'error>) : AsyncResultOption<'ok, 'error> =
141
- AsyncResultOption.ofResult result
142
-
143
- /// <summary>
144
- /// Method lets us transform data types into our internal representation.
145
- /// </summary>
146
- member inline this.Source(result: Choice<'ok, 'error>) : AsyncResultOption<'ok, 'error> =
147
- this.Source(Result.ofChoice result)
148
-
149
- /// <summary>
150
- /// Method lets us transform data types into our internal representation.
151
- /// </summary>
152
- member inline this.Source(optional: Option<'ok>) : AsyncResultOption<'ok, 'error> =
153
- AsyncResultOption.ofOption optional
154
-
155
- /// <summary>
156
- /// Method lets us transform data types into our internal representation.
157
- /// </summary>
158
- member inline this.Source(async: Async<'ok>) : AsyncResultOption<'ok, 'error> =
159
- Async.map (Some >> Ok) async
160
-
161
-
162
- member inline _.Using
163
- (
164
- resource: 'ok :> IDisposable,
165
- [<InlineIfLambda>] binder: 'ok -> AsyncResultOption<'okOutput, 'error>
166
- ) : AsyncResultOption<'okOutput, 'error> =
167
- async.Using(resource, binder)
168
-
169
-
170
- member inline this.For
171
- (
172
- sequence: #seq<'ok>,
173
- [<InlineIfLambda>] binder: 'ok -> AsyncResultOption<unit, 'error>
174
- ) : AsyncResultOption<unit, 'error> =
175
- this.Using(
176
- sequence.GetEnumerator(),
177
- fun enum ->
178
- this.While(
179
- (fun () -> enum.MoveNext()),
180
- this.Delay(fun () -> binder enum.Current)
181
- )
182
- )
183
-
184
-
185
- #if !FABLE_COMPILER
186
- /// <summary>
187
- /// Method lets us transform data types into our internal representation.
188
- /// </summary>
189
- member inline this.Source(async: Task<'ok>) : AsyncResultOption<'ok, 'error> =
190
- async
191
- |> Async.AwaitTask
192
- |> Async.map (Some >> Ok)
193
-
194
- /// <summary>
195
- /// Method lets us transform data types into our internal representation.
196
- /// </summary>
197
- member inline this.Source(async: Task) : AsyncResultOption<unit, 'error> =
198
- async
199
- |> Async.AwaitTask
200
- |> Async.map (Some >> Ok)
201
- #endif
202
- [<AutoOpen>]
203
- module AsyncResultOptionCEExtensionsHighPriority =
204
-
205
- type AsyncResultOptionBuilder with
206
-
207
- /// <summary>
208
- /// Method lets us transform data types into our internal representation.
209
- /// </summary>
210
- member inline _.Source
211
- (result: Async<Result<'ok, 'error>>)
212
- : AsyncResultOption<'ok, 'error> =
213
- AsyncResultOption.ofAsyncResult result
214
-
215
- /// <summary>
216
- /// Method lets us transform data types into our internal representation.
217
- /// </summary>
218
- member inline _.Source(result: Async<Option<'ok>>) : AsyncResultOption<'ok, 'error> =
219
- AsyncResultOption.ofAsyncOption result
220
-
221
-
222
- #if !FABLE_COMPILER
223
- /// <summary>
224
- /// Method lets us transform data types into our internal representation.
225
- /// </summary>
226
- member inline _.Source(result: Task<Result<'ok, 'error>>) : AsyncResultOption<'ok, 'error> =
227
- result
228
- |> Async.AwaitTask
229
- |> AsyncResultOption.ofAsyncResult
230
-
231
- /// <summary>
232
- /// Method lets us transform data types into our internal representation.
233
- /// </summary>
234
- member inline _.Source(result: Task<Option<'ok>>) : AsyncResultOption<'ok, 'error> =
235
- result
236
- |> Async.AwaitTask
237
- |> AsyncResultOption.ofAsyncOption
238
- #endif
@@ -1,18 +0,0 @@
1
- import { class_type } from "../fable-library-js.4.14.0/Reflection.js";
2
-
3
- export class AsyncResultOptionCE_AsyncResultOptionBuilder {
4
- constructor() {
5
- }
6
- }
7
-
8
- export function AsyncResultOptionCE_AsyncResultOptionBuilder_$reflection() {
9
- return class_type("FsToolkit.ErrorHandling.AsyncResultOptionCE.AsyncResultOptionBuilder", void 0, AsyncResultOptionCE_AsyncResultOptionBuilder);
10
- }
11
-
12
- export function AsyncResultOptionCE_AsyncResultOptionBuilder_$ctor() {
13
- return new AsyncResultOptionCE_AsyncResultOptionBuilder();
14
- }
15
-
16
- export const AsyncResultOptionCE_asyncResultOption = AsyncResultOptionCE_AsyncResultOptionBuilder_$ctor();
17
-
18
- //# sourceMappingURL=AsyncResultOptionCE.fs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["./AsyncResultOptionCE.fs"],"names":["\u0060\u0060.ctor\u0060\u0060"],"mappings":";;;;;;;;;;;;;;;qDA2H4B,AAAAA","file":null,"sourcesContent":null,"sourceRoot":null}
@@ -1,24 +0,0 @@
1
- namespace FsToolkit.ErrorHandling.Operator.AsyncResultOption
2
-
3
- open FsToolkit.ErrorHandling
4
-
5
- [<AutoOpen>]
6
- module AsyncResultOption =
7
-
8
- let inline (<!>)
9
- ([<InlineIfLambda>] mapper: 'okInput -> 'okOutput)
10
- (input: Async<Result<'okInput option, 'error>>)
11
- : Async<Result<'okOutput option, 'error>> =
12
- AsyncResultOption.map mapper input
13
-
14
- let inline (<*>)
15
- (applier: Async<Result<('okInput -> 'okOutput) option, 'error>>)
16
- (input: Async<Result<'okInput option, 'error>>)
17
- : Async<Result<'okOutput option, 'error>> =
18
- AsyncResultOption.apply applier input
19
-
20
- let inline (>>=)
21
- (input: Async<Result<'okInput option, 'error>>)
22
- ([<InlineIfLambda>] binder: 'okInput -> Async<Result<'okOutput option, 'error>>)
23
- : Async<Result<'okOutput option, 'error>> =
24
- AsyncResultOption.bind binder input
@@ -1,190 +0,0 @@
1
- namespace FsToolkit.ErrorHandling
2
-
3
- /// AsyncValidation<'a, 'err> is defined as Async<Result<'a, 'err list>> meaning you can use many of the functions found in the Result and Async module.
4
- type AsyncValidation<'ok, 'error> = Async<Result<'ok, 'error list>>
5
-
6
- [<RequireQualifiedAccess>]
7
- module AsyncValidation =
8
- let inline ok (value: 'ok) : AsyncValidation<'ok, 'error> =
9
- Ok value
10
- |> async.Return
11
-
12
- let inline error (error: 'error) : AsyncValidation<'ok, 'error> =
13
- Error [ error ]
14
- |> async.Return
15
-
16
- let inline ofResult (result: Result<'ok, 'error>) : AsyncValidation<'ok, 'error> =
17
- Result.mapError List.singleton result
18
- |> async.Return
19
-
20
- let inline ofChoice (choice: Choice<'ok, 'error>) : AsyncValidation<'ok, 'error> =
21
- match choice with
22
- | Choice1Of2 x -> ok x
23
- | Choice2Of2 e -> error e
24
-
25
- let inline apply
26
- (applier: AsyncValidation<'okInput -> 'okOutput, 'error>)
27
- (input: AsyncValidation<'okInput, 'error>)
28
- : AsyncValidation<'okOutput, 'error> =
29
- async {
30
- let! applier = applier
31
- let! input = input
32
-
33
- return
34
- match applier, input with
35
- | Ok f, Ok x -> Ok(f x)
36
- | Error errs, Ok _
37
- | Ok _, Error errs -> Error errs
38
- | Error errs1, Error errs2 ->
39
- Error(
40
- errs1
41
- @ errs2
42
- )
43
- }
44
-
45
- let inline retn (value: 'ok) : AsyncValidation<'ok, 'error> = ok value
46
-
47
- let inline returnError (error: 'error) : AsyncValidation<'ok, 'error> =
48
- Error [ error ]
49
- |> async.Return
50
-
51
- let inline orElse
52
- (ifError: AsyncValidation<'ok, 'errorOutput>)
53
- (result: AsyncValidation<'ok, 'errorInput>)
54
- : AsyncValidation<'ok, 'errorOutput> =
55
- async {
56
- let! result = result
57
-
58
- return!
59
- result
60
- |> Result.either ok (fun _ -> ifError)
61
- }
62
-
63
- let inline orElseWith
64
- ([<InlineIfLambda>] ifErrorFunc: 'errorInput list -> AsyncValidation<'ok, 'errorOutput>)
65
- (result: AsyncValidation<'ok, 'errorInput>)
66
- : AsyncValidation<'ok, 'errorOutput> =
67
- async {
68
- let! result = result
69
-
70
- return!
71
- match result with
72
- | Ok x -> ok x
73
- | Error err -> ifErrorFunc err
74
- }
75
-
76
- let inline map
77
- ([<InlineIfLambda>] mapper: 'okInput -> 'okOutput)
78
- (input: AsyncValidation<'okInput, 'error>)
79
- : AsyncValidation<'okOutput, 'error> =
80
- async {
81
- let! input = input
82
- return Result.map mapper input
83
- }
84
-
85
- let inline map2
86
- ([<InlineIfLambda>] mapper: 'okInput1 -> 'okInput2 -> 'okOutput)
87
- (input1: AsyncValidation<'okInput1, 'error>)
88
- (input2: AsyncValidation<'okInput2, 'error>)
89
- : AsyncValidation<'okOutput, 'error> =
90
- async {
91
- let! input1 = input1
92
- let! input2 = input2
93
-
94
- return
95
- match input1, input2 with
96
- | Ok x, Ok y -> Ok(mapper x y)
97
- | Ok _, Error errs -> Error errs
98
- | Error errs, Ok _ -> Error errs
99
- | Error errs1, Error errs2 ->
100
- Error(
101
- errs1
102
- @ errs2
103
- )
104
- }
105
-
106
- let inline map3
107
- ([<InlineIfLambda>] mapper: 'okInput1 -> 'okInput2 -> 'okInput3 -> 'okOutput)
108
- (input1: AsyncValidation<'okInput1, 'error>)
109
- (input2: AsyncValidation<'okInput2, 'error>)
110
- (input3: AsyncValidation<'okInput3, 'error>)
111
- : AsyncValidation<'okOutput, 'error> =
112
- async {
113
- let! input1 = input1
114
- let! input2 = input2
115
- let! input3 = input3
116
-
117
- return
118
- match input1, input2, input3 with
119
- | Ok x, Ok y, Ok z -> Ok(mapper x y z)
120
- | Error errs, Ok _, Ok _ -> Error errs
121
- | Ok _, Error errs, Ok _ -> Error errs
122
- | Ok _, Ok _, Error errs -> Error errs
123
- | Error errs1, Error errs2, Ok _ ->
124
- Error(
125
- errs1
126
- @ errs2
127
- )
128
- | Ok _, Error errs1, Error errs2 ->
129
- Error(
130
- errs1
131
- @ errs2
132
- )
133
- | Error errs1, Ok _, Error errs2 ->
134
- Error(
135
- errs1
136
- @ errs2
137
- )
138
- | Error errs1, Error errs2, Error errs3 ->
139
- Error(
140
- errs1
141
- @ errs2
142
- @ errs3
143
- )
144
- }
145
-
146
- let inline mapError
147
- ([<InlineIfLambda>] errorMapper: 'errorInput -> 'errorOutput)
148
- (input: AsyncValidation<'ok, 'errorInput>)
149
- : AsyncValidation<'ok, 'errorOutput> =
150
- async {
151
- let! input = input
152
- return Result.mapError (List.map errorMapper) input
153
- }
154
-
155
- let inline mapErrors
156
- ([<InlineIfLambda>] errorMapper: 'errorInput list -> 'errorOutput list)
157
- (input: AsyncValidation<'ok, 'errorInput>)
158
- : AsyncValidation<'ok, 'errorOutput> =
159
- async {
160
- let! input = input
161
- return Result.mapError errorMapper input
162
- }
163
-
164
- let inline bind
165
- ([<InlineIfLambda>] binder: 'okInput -> AsyncValidation<'okOutput, 'error>)
166
- (input: AsyncValidation<'okInput, 'error>)
167
- : AsyncValidation<'okOutput, 'error> =
168
- async {
169
- let! input = input
170
-
171
- match input with
172
- | Ok x -> return! binder x
173
- | Error e -> return Error e
174
- }
175
-
176
- let inline zip
177
- (left: AsyncValidation<'left, 'error>)
178
- (right: AsyncValidation<'right, 'error>)
179
- : AsyncValidation<'left * 'right, 'error> =
180
- async {
181
- let! left = left
182
- let! right = right
183
-
184
- return
185
- match left, right with
186
- | Ok x1res, Ok x2res -> Ok(x1res, x2res)
187
- | Error e, Ok _ -> Error e
188
- | Ok _, Error e -> Error e
189
- | Error e1, Error e2 -> Error(e1 @ e2)
190
- }