@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.
- package/README.md +19 -1
- package/dist/Glutinum.Converter/Abbreviations.js +246 -0
- package/dist/Glutinum.Converter/FsharpAST.js +87 -28
- package/dist/Glutinum.Converter/Generate.js +55 -8
- package/dist/Glutinum.Converter/GlueAST.js +333 -34
- package/dist/Glutinum.Converter/Log.js +7 -8
- package/dist/Glutinum.Converter/Merge.js +683 -31
- package/dist/Glutinum.Converter/Packages.js +308 -0
- package/dist/Glutinum.Converter/Printer.js +323 -186
- package/dist/Glutinum.Converter/Read.js +279 -6
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +13 -7
- package/dist/Glutinum.Converter/Reader/Declaration.js +102 -17
- package/dist/Glutinum.Converter/Reader/Documentation.js +168 -73
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +7 -51
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +64 -15
- package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +165 -0
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +30 -5
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +122 -4
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +83 -7
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +8 -8
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +11 -9
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +3 -2
- package/dist/Glutinum.Converter/Reader/Node.js +24 -10
- package/dist/Glutinum.Converter/Reader/Parameters.js +110 -7
- package/dist/Glutinum.Converter/Reader/Report.js +31 -12
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +4 -3
- package/dist/Glutinum.Converter/Reader/TypeNode.js +1524 -253
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +75 -20
- package/dist/Glutinum.Converter/Reader/TypeParameters.js +8 -5
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +184 -50
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +32 -13
- package/dist/Glutinum.Converter/Reader/Types.js +180 -0
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +99 -43
- package/dist/Glutinum.Converter/Reader/Utils.js +1143 -55
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +59 -14
- package/dist/Glutinum.Converter/Transform.js +8292 -1119
- package/dist/Glutinum.Converter/TypeScript.Extensions.js +3 -3
- package/dist/Glutinum.Converter/TypeScript.js +3 -3
- package/dist/Glutinum.Converter/Utils/Keywords.js +6 -6
- package/dist/Glutinum.Converter/Utils/List.js +3 -3
- package/dist/Glutinum.Converter/Utils/Naming.js +61 -12
- package/dist/Glutinum.Converter/Utils/String.js +7 -3
- package/dist/Program.js +230 -72
- package/dist/fable_modules/Fable.Promise.3.2.1/AsyncIterable.fs +89 -0
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/AsyncIterable.fs.js +29 -29
- package/dist/fable_modules/Fable.Promise.3.2.1/Fable.Promise.fableproj +25 -0
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs +842 -766
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs.js +26 -12
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs +31 -31
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs.js +5 -5
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs +235 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs.js +384 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AssemblyInfo.fs +4 -4
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs +89 -9
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs.js +13 -12
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOption.fs +50 -4
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs +30 -39
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs.js +10 -10
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResult.fs +52 -8
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs +26 -42
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs.js +3 -3
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOption.fs +17 -5
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOption.fs.js +26 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs +31 -33
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs.js +3 -3
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidation.fs +1 -6
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs +10 -18
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs.js +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/FsToolkit.ErrorHandling.fableproj +69 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs +68 -10
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs.js +47 -41
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Nullness.fs +81 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Option.fs +133 -2
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs +139 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs.js +48 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/OptionOp.fs +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs +88 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs.js +30 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs +200 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidation.fs +34 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs +244 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs.js +18 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs +87 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs.js +8 -8
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs +8 -23
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs.js +5 -5
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs +1 -1
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs.js +10 -10
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs +7 -18
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs.js +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs +503 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs.js +295 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Validation.fs +0 -5
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs +7 -13
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs.js +3 -3
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValueOption.fs +1 -4
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOption.fs +102 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionCE.fs +587 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionOp.fs +10 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.fs +3 -0
- 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
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +4 -4
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Array.js +192 -86
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Async.js +58 -53
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/AsyncBuilder.js +29 -8
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BigInt.js +71 -46
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BitConverter.js +2 -2
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Boolean.js +4 -3
- package/dist/fable_modules/fable-library-js.5.17.2/CHANGELOG.md +348 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Char.js +64 -31
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Choice.js +2 -2
- package/dist/fable_modules/fable-library-js.5.17.2/CollectionUtil.js +182 -0
- package/dist/fable_modules/fable-library-js.5.17.2/ConditionalWeakTable.js +21 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Date.js +197 -112
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOffset.js +46 -62
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOnly.js +6 -6
- package/dist/fable_modules/fable-library-js.5.17.2/DateOnlyTemporal.js +146 -0
- package/dist/fable_modules/fable-library-js.5.17.2/DateTimeFormat.js +523 -0
- package/dist/fable_modules/fable-library-js.5.17.2/DateTimeOffsetTemporal.js +283 -0
- package/dist/fable_modules/fable-library-js.5.17.2/DateTimeTemporal.js +243 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Decimal.js +39 -13
- package/dist/fable_modules/fable-library-js.5.17.2/Directory.js +11 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Double.js +10 -3
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Encoding.js +20 -8
- package/dist/fable_modules/fable-library-js.5.17.2/Environment.js +3 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Event.js +10 -1
- package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Collections.js +45 -0
- package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Core.js +156 -0
- package/dist/fable_modules/fable-library-js.5.17.2/File.js +27 -0
- package/dist/fable_modules/fable-library-js.5.17.2/Global.js +29 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Guid.js +33 -12
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Int32.js +17 -17
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/List.js +170 -106
- package/dist/fable_modules/fable-library-js.5.17.2/Long.js +38 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MailboxProcessor.js +13 -6
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Map.js +65 -61
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MapUtil.js +22 -4
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableMap.js +28 -16
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableSet.js +7 -7
- package/dist/fable_modules/fable-library-js.5.17.2/Native.js +14 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Numeric.js +44 -3
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Observable.js +5 -3
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Option.js +11 -20
- package/dist/fable_modules/fable-library-js.5.17.2/Path.js +31 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Random.js +22 -20
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Range.js +12 -12
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Reflection.js +50 -22
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/RegExp.js +68 -30
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Result.js +6 -6
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq.js +229 -104
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq2.js +1 -1
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Set.js +153 -113
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/String.js +238 -50
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Collections.Generic.js +30 -14
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Text.js +69 -31
- package/dist/fable_modules/fable-library-js.5.17.2/System.js +289 -0
- package/dist/fable_modules/fable-library-js.5.17.2/Task.js +27 -0
- package/dist/fable_modules/fable-library-js.5.17.2/TaskBuilder.js +72 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeOnly.js +6 -6
- package/dist/fable_modules/fable-library-js.5.17.2/TimeOnlyTemporal.js +142 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeSpan.js +18 -15
- package/dist/fable_modules/fable-library-js.5.17.2/TimeSpanTemporal.js +259 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Types.js +14 -24
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Uri.js +44 -21
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Util.js +49 -12
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/lib/big.js +14 -11
- package/dist/fable_modules/fable-library-js.5.17.2/package.json +24 -0
- package/dist/fable_modules/fable-library-js.5.17.2/quotation.js +682 -0
- package/package.json +4 -4
- package/src/Glutinum.Converter/js/bootstrap.js +109 -2
- package/src/Glutinum.Converter/js/host.js +144 -0
- package/src/Glutinum.Converter/js/npm.js +137 -0
- package/src/Glutinum.Converter/js/resolve.js +402 -0
- package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
- package/dist/Glutinum.Converter/Generate.js.map +0 -1
- package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
- package/dist/Glutinum.Converter/Log.js.map +0 -1
- package/dist/Glutinum.Converter/Merge.js.map +0 -1
- package/dist/Glutinum.Converter/Printer.js.map +0 -1
- package/dist/Glutinum.Converter/Read.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
- package/dist/Glutinum.Converter/Transform.js.map +0 -1
- package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
- package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
- package/dist/Program.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
- package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
- package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
- package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
- package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
- package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
- package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
- package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
- package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
- package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
- package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
- package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
- package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
- package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
- package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
- package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
- package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
- package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
- package/dist/fable_modules/project_cracked.json +0 -1
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationOp.fs +0 -0
- /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
- /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
- /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
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/FSharp.Core.CompilerServices.js +0 -0
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/README.md +0 -0
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Timer.js +0 -0
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Unicode.13.0.0.js +0 -0
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/big.d.ts +0 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
|
|
2
|
+
import { append, skip, head, reverse, equalsWith } from "../fable-library-js.5.17.2/Array.js";
|
|
3
|
+
import { defaultOf, equals } from "../fable-library-js.5.17.2/Util.js";
|
|
4
|
+
import { FSharpResult$2 } from "../fable-library-js.5.17.2/Result.js";
|
|
5
|
+
import { singleton } from "../fable-library-js.5.17.2/AsyncBuilder.js";
|
|
6
|
+
import { some, value as value_10 } from "../fable-library-js.5.17.2/Option.js";
|
|
7
|
+
|
|
8
|
+
function traverseResultM$0027(state_mut, f_mut, xs_mut) {
|
|
9
|
+
traverseResultM$0027:
|
|
10
|
+
while (true) {
|
|
11
|
+
const state = state_mut, f = f_mut, xs = xs_mut;
|
|
12
|
+
if (!equalsWith(equals, xs, defaultOf()) && (xs.length === 0)) {
|
|
13
|
+
const input_1 = state;
|
|
14
|
+
if (input_1.tag === 1) {
|
|
15
|
+
return new FSharpResult$2(/* Error */ 1, [input_1.fields[0]]);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return new FSharpResult$2(/* Ok */ 0, [reverse(input_1.fields[0])]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const arr = xs;
|
|
23
|
+
const x_2 = head(arr);
|
|
24
|
+
const xs_1 = skip(1, arr);
|
|
25
|
+
let res;
|
|
26
|
+
const input_4 = f(x_2);
|
|
27
|
+
if (input_4.tag === 1) {
|
|
28
|
+
res = (new FSharpResult$2(/* Error */ 1, [input_4.fields[0]]));
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const input_2 = state;
|
|
32
|
+
res = ((input_2.tag === 1) ? (new FSharpResult$2(/* Error */ 1, [input_2.fields[0]])) : (new FSharpResult$2(/* Ok */ 0, [append([input_4.fields[0]], input_2.fields[0])])));
|
|
33
|
+
}
|
|
34
|
+
if (res.tag === 1) {
|
|
35
|
+
return res;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
state_mut = res;
|
|
39
|
+
f_mut = f;
|
|
40
|
+
xs_mut = xs_1;
|
|
41
|
+
continue traverseResultM$0027;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function traverseAsyncResultM$0027(state, f, xs) {
|
|
49
|
+
if (!equalsWith(equals, xs, defaultOf()) && (xs.length === 0)) {
|
|
50
|
+
return singleton.Bind(state, (x$0027) => {
|
|
51
|
+
let value;
|
|
52
|
+
const input_2 = x$0027;
|
|
53
|
+
value = ((input_2.tag === 1) ? (new FSharpResult$2(/* Error */ 1, [input_2.fields[0]])) : (new FSharpResult$2(/* Ok */ 0, [reverse(input_2.fields[0])])));
|
|
54
|
+
return singleton.Return(value);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const arr = xs;
|
|
59
|
+
const x_2 = head(arr);
|
|
60
|
+
const xs_1 = skip(1, arr);
|
|
61
|
+
return singleton.Delay(() => singleton.Bind(singleton.Delay(() => singleton.Bind(state, (input_1_3) => {
|
|
62
|
+
const input_10 = input_1_3;
|
|
63
|
+
if (input_10.tag === 1) {
|
|
64
|
+
return singleton.Return(new FSharpResult$2(/* Error */ 1, [input_10.fields[0]]));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const x_3 = f(x_2);
|
|
68
|
+
return singleton.Bind(x_3, (x$0027_1) => {
|
|
69
|
+
let value_2;
|
|
70
|
+
const input_6 = x$0027_1;
|
|
71
|
+
value_2 = ((input_6.tag === 1) ? (new FSharpResult$2(/* Error */ 1, [input_6.fields[0]])) : (new FSharpResult$2(/* Ok */ 0, [append([input_6.fields[0]], input_10.fields[0])])));
|
|
72
|
+
return singleton.Return(value_2);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
})), (_arg_2) => {
|
|
76
|
+
const r = _arg_2;
|
|
77
|
+
return (r.tag === 1) ? singleton.Return(r) : singleton.ReturnFrom(traverseAsyncResultM$0027(singleton.Return(r), f, xs_1));
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function traverseResultM(f, xs) {
|
|
83
|
+
return traverseResultM$0027(new FSharpResult$2(/* Ok */ 0, [[]]), f, xs);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function sequenceResultM(xs) {
|
|
87
|
+
return traverseResultM((x) => x, xs);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function traverseAsyncResultM(f, xs) {
|
|
91
|
+
return traverseAsyncResultM$0027(singleton.Return(new FSharpResult$2(/* Ok */ 0, [[]])), f, xs);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function sequenceAsyncResultM(xs) {
|
|
95
|
+
return traverseAsyncResultM((x) => x, xs);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function traverseResultA$0027(state_mut, f_mut, xs_mut) {
|
|
99
|
+
traverseResultA$0027:
|
|
100
|
+
while (true) {
|
|
101
|
+
const state = state_mut, f = f_mut, xs = xs_mut;
|
|
102
|
+
if (!equalsWith(equals, xs, defaultOf()) && (xs.length === 0)) {
|
|
103
|
+
const input_1 = state;
|
|
104
|
+
if (input_1.tag === 1) {
|
|
105
|
+
return new FSharpResult$2(/* Error */ 1, [reverse(input_1.fields[0])]);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return new FSharpResult$2(/* Ok */ 0, [reverse(input_1.fields[0])]);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
const arr = xs;
|
|
113
|
+
const x_2 = head(arr);
|
|
114
|
+
const xs_1 = skip(1, arr);
|
|
115
|
+
const matchValue = f(x_2);
|
|
116
|
+
const copyOfStruct = state;
|
|
117
|
+
if (copyOfStruct.tag === 1) {
|
|
118
|
+
const copyOfStruct_1 = matchValue;
|
|
119
|
+
if (copyOfStruct_1.tag === 0) {
|
|
120
|
+
state_mut = (new FSharpResult$2(/* Error */ 1, [copyOfStruct.fields[0]]));
|
|
121
|
+
f_mut = f;
|
|
122
|
+
xs_mut = xs_1;
|
|
123
|
+
continue traverseResultA$0027;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
state_mut = (new FSharpResult$2(/* Error */ 1, [append([copyOfStruct_1.fields[0]], copyOfStruct.fields[0])]));
|
|
127
|
+
f_mut = f;
|
|
128
|
+
xs_mut = xs_1;
|
|
129
|
+
continue traverseResultA$0027;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const copyOfStruct_2 = matchValue;
|
|
134
|
+
if (copyOfStruct_2.tag === 1) {
|
|
135
|
+
state_mut = (new FSharpResult$2(/* Error */ 1, [[copyOfStruct_2.fields[0]]]));
|
|
136
|
+
f_mut = f;
|
|
137
|
+
xs_mut = xs_1;
|
|
138
|
+
continue traverseResultA$0027;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
state_mut = (new FSharpResult$2(/* Ok */ 0, [append([copyOfStruct_2.fields[0]], copyOfStruct.fields[0])]));
|
|
142
|
+
f_mut = f;
|
|
143
|
+
xs_mut = xs_1;
|
|
144
|
+
continue traverseResultA$0027;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function traverseAsyncResultA$0027(state, f, xs) {
|
|
153
|
+
if (!equalsWith(equals, xs, defaultOf()) && (xs.length === 0)) {
|
|
154
|
+
return singleton.Bind(state, (x$0027) => {
|
|
155
|
+
let value;
|
|
156
|
+
const input_2 = x$0027;
|
|
157
|
+
value = ((input_2.tag === 1) ? (new FSharpResult$2(/* Error */ 1, [reverse(input_2.fields[0])])) : (new FSharpResult$2(/* Ok */ 0, [reverse(input_2.fields[0])])));
|
|
158
|
+
return singleton.Return(value);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
const arr = xs;
|
|
163
|
+
const x_2 = head(arr);
|
|
164
|
+
const xs_1 = skip(1, arr);
|
|
165
|
+
return singleton.Delay(() => singleton.Bind(state, (_arg) => singleton.Bind(f(x_2), (_arg_1) => {
|
|
166
|
+
let value_4, value_6, value_1_2;
|
|
167
|
+
const fR = _arg_1;
|
|
168
|
+
const copyOfStruct = _arg;
|
|
169
|
+
if (copyOfStruct.tag === 1) {
|
|
170
|
+
const copyOfStruct_1 = fR;
|
|
171
|
+
return (copyOfStruct_1.tag === 0) ? singleton.ReturnFrom(traverseAsyncResultA$0027(singleton.Return(new FSharpResult$2(/* Error */ 1, [copyOfStruct.fields[0]])), f, xs_1)) : singleton.ReturnFrom(traverseAsyncResultA$0027((value_4 = (new FSharpResult$2(/* Error */ 1, [append([copyOfStruct_1.fields[0]], copyOfStruct.fields[0])])), singleton.Return(value_4)), f, xs_1));
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
const copyOfStruct_2 = fR;
|
|
175
|
+
return (copyOfStruct_2.tag === 1) ? singleton.ReturnFrom(traverseAsyncResultA$0027((value_6 = (new FSharpResult$2(/* Error */ 1, [[copyOfStruct_2.fields[0]]])), singleton.Return(value_6)), f, xs_1)) : singleton.ReturnFrom(traverseAsyncResultA$0027((value_1_2 = (new FSharpResult$2(/* Ok */ 0, [append([copyOfStruct_2.fields[0]], copyOfStruct.fields[0])])), singleton.Return(value_1_2)), f, xs_1));
|
|
176
|
+
}
|
|
177
|
+
})));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function traverseResultA(f, xs) {
|
|
182
|
+
return traverseResultA$0027(new FSharpResult$2(/* Ok */ 0, [[]]), f, xs);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function sequenceResultA(xs) {
|
|
186
|
+
return traverseResultA((x) => x, xs);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function traverseValidationA$0027(state_mut, f_mut, xs_mut) {
|
|
190
|
+
traverseValidationA$0027:
|
|
191
|
+
while (true) {
|
|
192
|
+
const state = state_mut, f = f_mut, xs = xs_mut;
|
|
193
|
+
if (!equalsWith(equals, xs, defaultOf()) && (xs.length === 0)) {
|
|
194
|
+
const input_1 = state;
|
|
195
|
+
if (input_1.tag === 1) {
|
|
196
|
+
return new FSharpResult$2(/* Error */ 1, [reverse(input_1.fields[0])]);
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
return new FSharpResult$2(/* Ok */ 0, [reverse(input_1.fields[0])]);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
const arr = xs;
|
|
204
|
+
const x_2 = head(arr);
|
|
205
|
+
const xs_1 = skip(1, arr);
|
|
206
|
+
const fR = f(x_2);
|
|
207
|
+
let matchResult, y_1, ys, errs1, errs2, errs_1;
|
|
208
|
+
const copyOfStruct = state;
|
|
209
|
+
if (copyOfStruct.tag === 1) {
|
|
210
|
+
const copyOfStruct_1 = fR;
|
|
211
|
+
if (copyOfStruct_1.tag === 0) {
|
|
212
|
+
matchResult = 2;
|
|
213
|
+
errs_1 = copyOfStruct.fields[0];
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
matchResult = 1;
|
|
217
|
+
errs1 = copyOfStruct.fields[0];
|
|
218
|
+
errs2 = copyOfStruct_1.fields[0];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
const copyOfStruct_2 = fR;
|
|
223
|
+
if (copyOfStruct_2.tag === 1) {
|
|
224
|
+
matchResult = 2;
|
|
225
|
+
errs_1 = copyOfStruct_2.fields[0];
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
matchResult = 0;
|
|
229
|
+
y_1 = copyOfStruct_2.fields[0];
|
|
230
|
+
ys = copyOfStruct.fields[0];
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
switch (matchResult) {
|
|
234
|
+
case 0: {
|
|
235
|
+
state_mut = (new FSharpResult$2(/* Ok */ 0, [append([y_1], ys)]));
|
|
236
|
+
f_mut = f;
|
|
237
|
+
xs_mut = xs_1;
|
|
238
|
+
continue traverseValidationA$0027;
|
|
239
|
+
}
|
|
240
|
+
case 1: {
|
|
241
|
+
state_mut = (new FSharpResult$2(/* Error */ 1, [append(errs2, errs1)]));
|
|
242
|
+
f_mut = f;
|
|
243
|
+
xs_mut = xs_1;
|
|
244
|
+
continue traverseValidationA$0027;
|
|
245
|
+
}
|
|
246
|
+
default: {
|
|
247
|
+
state_mut = (new FSharpResult$2(/* Error */ 1, [errs_1]));
|
|
248
|
+
f_mut = f;
|
|
249
|
+
xs_mut = xs_1;
|
|
250
|
+
continue traverseValidationA$0027;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export function traverseValidationA(f, xs) {
|
|
259
|
+
return traverseValidationA$0027(new FSharpResult$2(/* Ok */ 0, [[]]), f, xs);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function sequenceValidationA(xs) {
|
|
263
|
+
return traverseValidationA((x) => x, xs);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function traverseAsyncResultA(f, xs) {
|
|
267
|
+
return traverseAsyncResultA$0027(singleton.Return(new FSharpResult$2(/* Ok */ 0, [[]])), f, xs);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export function sequenceAsyncResultA(xs) {
|
|
271
|
+
return traverseAsyncResultA((x) => x, xs);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function traverseOptionM$0027(state_mut, f_mut, xs_mut) {
|
|
275
|
+
traverseOptionM$0027:
|
|
276
|
+
while (true) {
|
|
277
|
+
const state = state_mut, f = f_mut, xs = xs_mut;
|
|
278
|
+
if (!equalsWith(equals, xs, defaultOf()) && (xs.length === 0)) {
|
|
279
|
+
const input_1 = state;
|
|
280
|
+
if (input_1 == null) {
|
|
281
|
+
return undefined;
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
return reverse(input_1);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
const arr = xs;
|
|
289
|
+
const x_1 = head(arr);
|
|
290
|
+
const xs_1 = skip(1, arr);
|
|
291
|
+
let r;
|
|
292
|
+
let matchValue;
|
|
293
|
+
let x_5;
|
|
294
|
+
const opt = f(x_1);
|
|
295
|
+
x_5 = ((opt == null) ? undefined : some(value_10(opt)));
|
|
296
|
+
if (x_5 == null) {
|
|
297
|
+
matchValue = undefined;
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
const _arg = value_10(x_5);
|
|
301
|
+
let x_3;
|
|
302
|
+
const opt_1 = state;
|
|
303
|
+
x_3 = ((opt_1 == null) ? undefined : opt_1);
|
|
304
|
+
matchValue = ((x_3 == null) ? undefined : append([_arg], x_3));
|
|
305
|
+
}
|
|
306
|
+
r = ((matchValue == null) ? undefined : matchValue);
|
|
307
|
+
if (r == null) {
|
|
308
|
+
return r;
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
state_mut = r;
|
|
312
|
+
f_mut = f;
|
|
313
|
+
xs_mut = xs_1;
|
|
314
|
+
continue traverseOptionM$0027;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
function traverseAsyncOptionM$0027(state, f, xs) {
|
|
322
|
+
if (!equalsWith(equals, xs, defaultOf()) && (xs.length === 0)) {
|
|
323
|
+
return singleton.Bind(state, (x$0027) => {
|
|
324
|
+
let value;
|
|
325
|
+
const input_2 = x$0027;
|
|
326
|
+
value = ((input_2 == null) ? undefined : reverse(input_2));
|
|
327
|
+
return singleton.Return(value);
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
const arr = xs;
|
|
332
|
+
const x_1 = head(arr);
|
|
333
|
+
const xs_1 = skip(1, arr);
|
|
334
|
+
return singleton.Delay(() => singleton.Bind(singleton.Delay(() => {
|
|
335
|
+
const input_8 = f(x_1);
|
|
336
|
+
return singleton.Bind(input_8, (x_3) => {
|
|
337
|
+
if (x_3 == null) {
|
|
338
|
+
return singleton.Return(undefined);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
const _arg = value_10(x_3);
|
|
342
|
+
return singleton.Bind(state, (x_2) => {
|
|
343
|
+
if (x_2 == null) {
|
|
344
|
+
return singleton.Return(undefined);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
const value_1_2 = append([_arg], x_2);
|
|
348
|
+
return singleton.Return(value_1_2);
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}), (_arg_2) => {
|
|
354
|
+
const o = _arg_2;
|
|
355
|
+
return (o == null) ? singleton.Return(o) : singleton.ReturnFrom(traverseAsyncOptionM$0027(singleton.Return(o), f, xs_1));
|
|
356
|
+
}));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Applies the given function <paramref name="f"/> to each element in the input list <paramref name="xs"/>,
|
|
362
|
+
* and returns an option containing a list of the results. If any of the function applications return None,
|
|
363
|
+
* the entire result will be None.
|
|
364
|
+
*/
|
|
365
|
+
export function traverseOptionM(f, xs) {
|
|
366
|
+
return traverseOptionM$0027([], f, xs);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Applies the monadic function <paramref name="id"/> to each element in the input list <paramref name="xs"/>,
|
|
371
|
+
* and returns the result as an option. If any element in the list is None, the entire result will be None.
|
|
372
|
+
*/
|
|
373
|
+
export function sequenceOptionM(xs) {
|
|
374
|
+
return traverseOptionM((x) => x, xs);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export function traverseAsyncOptionM(f, xs) {
|
|
378
|
+
return traverseAsyncOptionM$0027(singleton.Return([]), f, xs);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export function sequenceAsyncOptionM(xs) {
|
|
382
|
+
return traverseAsyncOptionM((x) => x, xs);
|
|
383
|
+
}
|
|
384
|
+
|
|
@@ -5,8 +5,8 @@ open System.Reflection
|
|
|
5
5
|
[<assembly: AssemblyTitleAttribute("FsToolkit.ErrorHandling")>]
|
|
6
6
|
[<assembly: AssemblyProductAttribute("FsToolkit.ErrorHandling")>]
|
|
7
7
|
[<assembly: AssemblyDescriptionAttribute("FsToolkit.ErrorHandling is a utility library to work with the Result type in F#, and allows you to do clear, simple and powerful error handling.")>]
|
|
8
|
-
[<assembly: AssemblyVersionAttribute("
|
|
9
|
-
[<assembly: AssemblyFileVersionAttribute("
|
|
8
|
+
[<assembly: AssemblyVersionAttribute("5.2.0")>]
|
|
9
|
+
[<assembly: AssemblyFileVersionAttribute("5.2.0")>]
|
|
10
10
|
[<assembly: AssemblyConfigurationAttribute("Release")>]
|
|
11
11
|
do ()
|
|
12
12
|
|
|
@@ -14,6 +14,6 @@ module internal AssemblyVersionInformation =
|
|
|
14
14
|
let [<Literal>] AssemblyTitle = "FsToolkit.ErrorHandling"
|
|
15
15
|
let [<Literal>] AssemblyProduct = "FsToolkit.ErrorHandling"
|
|
16
16
|
let [<Literal>] AssemblyDescription = "FsToolkit.ErrorHandling is a utility library to work with the Result type in F#, and allows you to do clear, simple and powerful error handling."
|
|
17
|
-
let [<Literal>] AssemblyVersion = "
|
|
18
|
-
let [<Literal>] AssemblyFileVersion = "
|
|
17
|
+
let [<Literal>] AssemblyVersion = "5.2.0"
|
|
18
|
+
let [<Literal>] AssemblyFileVersion = "5.2.0"
|
|
19
19
|
let [<Literal>] AssemblyConfiguration = "Release"
|
package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs
RENAMED
|
@@ -15,15 +15,6 @@ module Async =
|
|
|
15
15
|
value
|
|
16
16
|
|> async.Return
|
|
17
17
|
|
|
18
|
-
/// <summary>
|
|
19
|
-
/// Converts a value to an <c>Async</c> value
|
|
20
|
-
/// </summary>
|
|
21
|
-
/// <param name="value">The value to convert to an <c>Async</c> value.</param>
|
|
22
|
-
/// <returns>The <c>Async</c> value.</returns>
|
|
23
|
-
let inline retn (value: 'value) : Async<'value> =
|
|
24
|
-
value
|
|
25
|
-
|> async.Return
|
|
26
|
-
|
|
27
18
|
/// <summary>
|
|
28
19
|
/// Takes a transformation function and applies it to the value of an <c>Async</c> value.
|
|
29
20
|
/// </summary>
|
|
@@ -123,6 +114,95 @@ module Async =
|
|
|
123
114
|
let inline zip (left: Async<'left>) (right: Async<'right>) : Async<'left * 'right> =
|
|
124
115
|
bind (fun l -> bind (fun r -> singleton (l, r)) right) left
|
|
125
116
|
|
|
117
|
+
/// <summary>
|
|
118
|
+
/// Executes two asyncs concurrently <see cref='M:Microsoft.FSharp.Control.FSharpAsync.Parallel``1'/> and returns a mapping of the values
|
|
119
|
+
/// </summary>
|
|
120
|
+
/// <param name="mapper">The function to apply to the values of the <c>Async</c> values.</param>
|
|
121
|
+
/// <param name="input1">The first <c>Async</c> to execute</param>
|
|
122
|
+
/// <param name="input2">The second <c>Async</c> to execute</param>
|
|
123
|
+
/// <returns>The transformed <c>Async</c> value.</returns>
|
|
124
|
+
let inline parallelMap2
|
|
125
|
+
([<InlineIfLambda>] mapper: 'input1 -> 'input2 -> 'output)
|
|
126
|
+
(input1: Async<'input1>)
|
|
127
|
+
(input2: Async<'input2>)
|
|
128
|
+
: Async<'output> =
|
|
129
|
+
|
|
130
|
+
#if FABLE_COMPILER && FABLE_COMPILER_PYTHON
|
|
131
|
+
Async.Parallel(
|
|
132
|
+
[|
|
|
133
|
+
map box input1
|
|
134
|
+
map box input2
|
|
135
|
+
|]
|
|
136
|
+
)
|
|
137
|
+
#else
|
|
138
|
+
Async.Parallel(
|
|
139
|
+
[|
|
|
140
|
+
map box input1
|
|
141
|
+
map box input2
|
|
142
|
+
|],
|
|
143
|
+
maxDegreeOfParallelism = 2
|
|
144
|
+
)
|
|
145
|
+
#endif
|
|
146
|
+
|> map (fun results ->
|
|
147
|
+
let a =
|
|
148
|
+
results[0]
|
|
149
|
+
|> unbox<'input1>
|
|
150
|
+
|
|
151
|
+
let b =
|
|
152
|
+
results[1]
|
|
153
|
+
|> unbox<'input2>
|
|
154
|
+
|
|
155
|
+
mapper a b
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
/// <summary>
|
|
159
|
+
/// Executes three asyncs concurrently <see cref='M:Microsoft.FSharp.Control.FSharpAsync.Parallel``1'/> and returns a mapping of the values
|
|
160
|
+
/// </summary>
|
|
161
|
+
/// <param name="mapper">The function to apply to the values of the <c>Async</c> values.</param>
|
|
162
|
+
/// <param name="input1">The first <c>Async</c> to execute</param>
|
|
163
|
+
/// <param name="input2">The second <c>Async</c> to execute</param>
|
|
164
|
+
/// <param name="input3">The third <c>Async</c> value to transform.</param>
|
|
165
|
+
/// <returns>The transformed <c>Async</c> value.</returns>
|
|
166
|
+
let inline parallelMap3
|
|
167
|
+
([<InlineIfLambda>] mapper: 'input1 -> 'input2 -> 'input3 -> 'output)
|
|
168
|
+
(input1: Async<'input1>)
|
|
169
|
+
(input2: Async<'input2>)
|
|
170
|
+
(input3: Async<'input3>)
|
|
171
|
+
: Async<'output> =
|
|
172
|
+
#if FABLE_COMPILER && FABLE_COMPILER_PYTHON
|
|
173
|
+
Async.Parallel(
|
|
174
|
+
[|
|
|
175
|
+
map box input1
|
|
176
|
+
map box input2
|
|
177
|
+
map box input3
|
|
178
|
+
|]
|
|
179
|
+
)
|
|
180
|
+
#else
|
|
181
|
+
Async.Parallel(
|
|
182
|
+
[|
|
|
183
|
+
map box input1
|
|
184
|
+
map box input2
|
|
185
|
+
map box input3
|
|
186
|
+
|],
|
|
187
|
+
maxDegreeOfParallelism = 3
|
|
188
|
+
)
|
|
189
|
+
#endif
|
|
190
|
+
|> map (fun results ->
|
|
191
|
+
let a =
|
|
192
|
+
results[0]
|
|
193
|
+
|> unbox<'input1>
|
|
194
|
+
|
|
195
|
+
let b =
|
|
196
|
+
results[1]
|
|
197
|
+
|> unbox<'input2>
|
|
198
|
+
|
|
199
|
+
let c =
|
|
200
|
+
results[2]
|
|
201
|
+
|> unbox<'input3>
|
|
202
|
+
|
|
203
|
+
mapper a b c
|
|
204
|
+
)
|
|
205
|
+
|
|
126
206
|
/// <summary>
|
|
127
207
|
/// Operators for working with the <c>Async</c> type.
|
|
128
208
|
/// </summary>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
|
|
2
|
+
import { Exception } from "../fable-library-js.5.17.2/Util.js";
|
|
3
|
+
import { fromContinuations, cancellationToken, startWithContinuations } from "../fable-library-js.5.17.2/Async.js";
|
|
4
|
+
import { FSharpChoice$3 } from "../fable-library-js.5.17.2/Choice.js";
|
|
5
|
+
import { singleton } from "../fable-library-js.5.17.2/AsyncBuilder.js";
|
|
4
6
|
|
|
5
7
|
export function Microsoft_FSharp_Control_FSharpAsync__Async_TryFinallyAsync_Static_Z753D11A1(comp, deferred) {
|
|
6
8
|
const finish = (tupledArg, tupledArg_1) => {
|
|
@@ -85,7 +87,7 @@ export function Microsoft_FSharp_Control_FSharpAsync__Async_TryFinallyAsync_Stat
|
|
|
85
87
|
break;
|
|
86
88
|
}
|
|
87
89
|
case 4: {
|
|
88
|
-
econt(new
|
|
90
|
+
econt(new Exception([compExn_2, deferredExn_1]));
|
|
89
91
|
break;
|
|
90
92
|
}
|
|
91
93
|
case 5: {
|
|
@@ -93,7 +95,7 @@ export function Microsoft_FSharp_Control_FSharpAsync__Async_TryFinallyAsync_Stat
|
|
|
93
95
|
break;
|
|
94
96
|
}
|
|
95
97
|
case 6: {
|
|
96
|
-
econt(new
|
|
98
|
+
econt(new Exception("Unexpected cancellation.", deferredExn_3));
|
|
97
99
|
break;
|
|
98
100
|
}
|
|
99
101
|
}
|
|
@@ -103,11 +105,11 @@ export function Microsoft_FSharp_Control_FSharpAsync__Async_TryFinallyAsync_Stat
|
|
|
103
105
|
const econt_1 = tupledArg_2[1];
|
|
104
106
|
const ccont_1 = tupledArg_2[2];
|
|
105
107
|
startWithContinuations(deferred, () => {
|
|
106
|
-
finish([compResult_1, new FSharpChoice$3(0, [
|
|
108
|
+
finish([compResult_1, new FSharpChoice$3(/* Choice1Of3 */ 0, [undefined])], [cont_1, econt_1, ccont_1]);
|
|
107
109
|
}, (exn) => {
|
|
108
|
-
finish([compResult_1, new FSharpChoice$3(1, [exn])], [cont_1, econt_1, ccont_1]);
|
|
110
|
+
finish([compResult_1, new FSharpChoice$3(/* Choice2Of3 */ 1, [exn])], [cont_1, econt_1, ccont_1]);
|
|
109
111
|
}, (exn_1) => {
|
|
110
|
-
finish([compResult_1, new FSharpChoice$3(2, [exn_1])], [cont_1, econt_1, ccont_1]);
|
|
112
|
+
finish([compResult_1, new FSharpChoice$3(/* Choice3Of3 */ 2, [exn_1])], [cont_1, econt_1, ccont_1]);
|
|
111
113
|
});
|
|
112
114
|
};
|
|
113
115
|
return singleton.Delay(() => singleton.Bind(cancellationToken(), (_arg) => singleton.ReturnFrom(fromContinuations((tupledArg_3) => {
|
|
@@ -115,13 +117,12 @@ export function Microsoft_FSharp_Control_FSharpAsync__Async_TryFinallyAsync_Stat
|
|
|
115
117
|
const econt_2 = tupledArg_3[1];
|
|
116
118
|
const ccont_2 = tupledArg_3[2];
|
|
117
119
|
startWithContinuations(comp, (x_1) => {
|
|
118
|
-
startDeferred(new FSharpChoice$3(0, [x_1]), [cont_2, econt_2, ccont_2]);
|
|
120
|
+
startDeferred(new FSharpChoice$3(/* Choice1Of3 */ 0, [x_1]), [cont_2, econt_2, ccont_2]);
|
|
119
121
|
}, (exn_2) => {
|
|
120
|
-
startDeferred(new FSharpChoice$3(1, [exn_2]), [cont_2, econt_2, ccont_2]);
|
|
122
|
+
startDeferred(new FSharpChoice$3(/* Choice2Of3 */ 1, [exn_2]), [cont_2, econt_2, ccont_2]);
|
|
121
123
|
}, (exn_3) => {
|
|
122
|
-
startDeferred(new FSharpChoice$3(2, [exn_3]), [cont_2, econt_2, ccont_2]);
|
|
124
|
+
startDeferred(new FSharpChoice$3(/* Choice3Of3 */ 2, [exn_3]), [cont_2, econt_2, ccont_2]);
|
|
123
125
|
}, _arg);
|
|
124
126
|
}))));
|
|
125
127
|
}
|
|
126
128
|
|
|
127
|
-
//# sourceMappingURL=Async.fs.js.map
|
|
@@ -21,16 +21,13 @@ module AsyncOption =
|
|
|
21
21
|
)
|
|
22
22
|
input
|
|
23
23
|
|
|
24
|
-
let inline retn (value: 'value) : Async<'value option> = Async.singleton (Some value)
|
|
25
|
-
|
|
26
|
-
|
|
27
24
|
let inline some (value: 'value) : Async<'value option> = Async.singleton (Some value)
|
|
28
25
|
|
|
29
26
|
let inline apply
|
|
30
27
|
(applier: Async<('input -> 'output) option>)
|
|
31
28
|
(input: Async<'input option>)
|
|
32
29
|
: Async<'output option> =
|
|
33
|
-
bind (fun f' -> bind (fun x' ->
|
|
30
|
+
bind (fun f' -> bind (fun x' -> some (f' x')) input) applier
|
|
34
31
|
|
|
35
32
|
/// <summary>
|
|
36
33
|
/// Returns result of running <paramref name="onSome"/> if it is <c>Some</c>, otherwise returns result of running <paramref name="onNone"/>
|
|
@@ -79,3 +76,52 @@ module AsyncOption =
|
|
|
79
76
|
: Async<'value> =
|
|
80
77
|
asyncOption
|
|
81
78
|
|> Async.map (Option.defaultWith defThunk)
|
|
79
|
+
|
|
80
|
+
/// <summary>
|
|
81
|
+
/// Returns <paramref name="input"/> if it is <c>Some</c>, otherwise returns <paramref name="ifNone"/>
|
|
82
|
+
/// </summary>
|
|
83
|
+
/// <param name="ifNone">The value to use if <paramref name="input"/> is <c>None</c></param>
|
|
84
|
+
/// <param name="input">The input option.</param>
|
|
85
|
+
/// <remarks>
|
|
86
|
+
/// </remarks>
|
|
87
|
+
/// <example>
|
|
88
|
+
/// <code>
|
|
89
|
+
/// None |> Async.singleton |> AsyncOption.orElse (AsyncOption.some "Second") // evaluates to Some ("Second")
|
|
90
|
+
/// None |> Async.singleton |> AsyncOption.orElse (None |> Async.singleton) // evaluates to None
|
|
91
|
+
/// AsyncOption.some "First" |> AsyncOption.orElse (AsyncOption.some "Second") // evaluates to Some ("First")
|
|
92
|
+
/// AsyncOption.some "First" |> AsyncOption.orElse (None |> Async.singleton) // evaluates to Some ("First")
|
|
93
|
+
/// </code>
|
|
94
|
+
/// </example>
|
|
95
|
+
/// <returns>
|
|
96
|
+
/// The option if the option is Some, else returns <paramref name="ifNone"/>.
|
|
97
|
+
/// </returns>
|
|
98
|
+
let inline orElse
|
|
99
|
+
(ifNone: Async<'value option>)
|
|
100
|
+
(input: Async<'value option>)
|
|
101
|
+
: Async<'value option> =
|
|
102
|
+
Async.bind (Option.either some (fun _ -> ifNone)) input
|
|
103
|
+
|
|
104
|
+
/// <summary>
|
|
105
|
+
/// Returns <paramref name="input"/> if it is <c>Some</c>, otherwise executes <paramref name="ifNoneFunc"/> and returns the result.
|
|
106
|
+
/// </summary>
|
|
107
|
+
/// <param name="ifNoneFunc">A function that provides an alternate option when evaluated.</param>
|
|
108
|
+
/// <param name="input">The input option.</param>
|
|
109
|
+
/// <remarks>
|
|
110
|
+
/// <paramref name="ifNoneFunc"/> is not executed unless <paramref name="input"/> is a <c>None</c>.
|
|
111
|
+
/// </remarks>
|
|
112
|
+
/// <example>
|
|
113
|
+
/// <code>
|
|
114
|
+
/// None |> Async.singleton |> AsyncOption.orElseWith (fun _ -> AsyncOption.some "Second") // evaluates to Some ("Second")
|
|
115
|
+
/// None |> Async.singleton |> AsyncOption.orElseWith (fun _ -> None |> Async.singleton) // evaluates to None
|
|
116
|
+
/// AsyncOption.some "First" |> AsyncOption.orElseWith (fun _ -> AsyncOption.some "Second") // evaluates to Some ("First")
|
|
117
|
+
/// AsyncOption.some "First" |> AsyncOption.orElseWith (fun _ -> None |> Async.singleton) // evaluates to Ok ("First")
|
|
118
|
+
/// </code>
|
|
119
|
+
/// </example>
|
|
120
|
+
/// <returns>
|
|
121
|
+
/// The option if the option is Some, else the result of executing <paramref name="ifNoneFunc"/>.
|
|
122
|
+
/// </returns>
|
|
123
|
+
let inline orElseWith
|
|
124
|
+
([<InlineIfLambda>] ifNoneFunc: unit -> Async<'value option>)
|
|
125
|
+
(input: Async<'value option>)
|
|
126
|
+
: Async<'value option> =
|
|
127
|
+
Async.bind (Option.either some ifNoneFunc) input
|