@fable-org/fable-library-ts 1.0.0-beta-001

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 (57) hide show
  1. package/Array.ts +1362 -0
  2. package/Async.ts +207 -0
  3. package/AsyncBuilder.ts +222 -0
  4. package/BigInt.ts +337 -0
  5. package/BitConverter.ts +165 -0
  6. package/Boolean.ts +22 -0
  7. package/CHANGELOG.md +15 -0
  8. package/Char.ts +222 -0
  9. package/Choice.ts +300 -0
  10. package/Date.ts +495 -0
  11. package/DateOffset.ts +324 -0
  12. package/DateOnly.ts +146 -0
  13. package/Decimal.ts +250 -0
  14. package/Double.ts +55 -0
  15. package/Encoding.ts +170 -0
  16. package/Event.ts +119 -0
  17. package/FSharp.Collections.ts +34 -0
  18. package/FSharp.Core.CompilerServices.ts +37 -0
  19. package/FSharp.Core.ts +86 -0
  20. package/Global.ts +37 -0
  21. package/Guid.ts +143 -0
  22. package/Int32.ts +156 -0
  23. package/List.ts +1417 -0
  24. package/Long.ts +49 -0
  25. package/MailboxProcessor.ts +125 -0
  26. package/Map.ts +1552 -0
  27. package/MapUtil.ts +120 -0
  28. package/MutableMap.ts +344 -0
  29. package/MutableSet.ts +248 -0
  30. package/Native.ts +11 -0
  31. package/Numeric.ts +80 -0
  32. package/Observable.ts +156 -0
  33. package/Option.ts +137 -0
  34. package/README.md +3 -0
  35. package/Random.ts +196 -0
  36. package/Range.ts +56 -0
  37. package/Reflection.ts +539 -0
  38. package/RegExp.ts +143 -0
  39. package/Result.ts +196 -0
  40. package/Seq.ts +1526 -0
  41. package/Seq2.ts +129 -0
  42. package/Set.ts +1955 -0
  43. package/String.ts +589 -0
  44. package/System.Collections.Generic.ts +380 -0
  45. package/System.Text.ts +137 -0
  46. package/SystemException.ts +7 -0
  47. package/TimeOnly.ts +131 -0
  48. package/TimeSpan.ts +194 -0
  49. package/Timer.ts +80 -0
  50. package/Types.ts +231 -0
  51. package/Unicode.13.0.0.ts +4 -0
  52. package/Uri.ts +206 -0
  53. package/Util.ts +928 -0
  54. package/lib/big.d.ts +338 -0
  55. package/lib/big.js +1054 -0
  56. package/package.json +24 -0
  57. package/tsconfig.json +103 -0
package/Char.ts ADDED
@@ -0,0 +1,222 @@
1
+ import * as Unicode from "./Unicode.13.0.0.js";
2
+
3
+ export type char = string;
4
+
5
+ function getCategoryFunc() {
6
+ // unpack Unicode codepoint ranges (delta encoded) and general categories
7
+ const offset = 35; // offsets unprintable characters
8
+ const a1 = [...Unicode.rangeDeltas].map((ch) => (ch.codePointAt(0) ?? 0) - offset);
9
+ const a2 = [...Unicode.categories].map((ch) => (ch.codePointAt(0) ?? 0) - offset);
10
+ const codepoints = new Uint32Array(a1);
11
+ const categories = new Uint8Array(a2);
12
+ for (let i = 1; i < codepoints.length; ++i) {
13
+ codepoints[i] += codepoints[i - 1];
14
+ }
15
+ // binary search in unicode ranges
16
+ return (cp: number) => {
17
+ let hi = codepoints.length;
18
+ let lo = 0;
19
+ while (hi - lo > 1) {
20
+ const mid = Math.floor((hi + lo) / 2);
21
+ const test = codepoints[mid];
22
+ if (cp < test) {
23
+ hi = mid;
24
+ } else if (cp === test) {
25
+ hi = lo = mid;
26
+ break;
27
+ } else if (test < cp) {
28
+ lo = mid;
29
+ }
30
+ }
31
+ return categories[lo];
32
+ };
33
+ }
34
+
35
+ export const enum UnicodeCategory {
36
+ UppercaseLetter,
37
+ LowercaseLetter,
38
+ TitlecaseLetter,
39
+ ModifierLetter,
40
+ OtherLetter,
41
+ NonSpacingMark,
42
+ SpacingCombiningMark,
43
+ EnclosingMark,
44
+ DecimalDigitNumber,
45
+ LetterNumber,
46
+ OtherNumber,
47
+ SpaceSeparator,
48
+ LineSeparator,
49
+ ParagraphSeparator,
50
+ Control,
51
+ Format,
52
+ Surrogate,
53
+ PrivateUse,
54
+ ConnectorPunctuation,
55
+ DashPunctuation,
56
+ OpenPunctuation,
57
+ ClosePunctuation,
58
+ InitialQuotePunctuation,
59
+ FinalQuotePunctuation,
60
+ OtherPunctuation,
61
+ MathSymbol,
62
+ CurrencySymbol,
63
+ ModifierSymbol,
64
+ OtherSymbol,
65
+ OtherNotAssigned,
66
+ }
67
+
68
+ const isControlMask = 1 << UnicodeCategory.Control;
69
+ const isDigitMask = 1 << UnicodeCategory.DecimalDigitNumber;
70
+ const isLetterMask = 0
71
+ | 1 << UnicodeCategory.UppercaseLetter
72
+ | 1 << UnicodeCategory.LowercaseLetter
73
+ | 1 << UnicodeCategory.TitlecaseLetter
74
+ | 1 << UnicodeCategory.ModifierLetter
75
+ | 1 << UnicodeCategory.OtherLetter;
76
+ const isLetterOrDigitMask = isLetterMask | isDigitMask;
77
+ const isUpperMask = 1 << UnicodeCategory.UppercaseLetter;
78
+ const isLowerMask = 1 << UnicodeCategory.LowercaseLetter;
79
+ const isNumberMask = 0
80
+ | 1 << UnicodeCategory.DecimalDigitNumber
81
+ | 1 << UnicodeCategory.LetterNumber
82
+ | 1 << UnicodeCategory.OtherNumber;
83
+ const isPunctuationMask = 0
84
+ | 1 << UnicodeCategory.ConnectorPunctuation
85
+ | 1 << UnicodeCategory.DashPunctuation
86
+ | 1 << UnicodeCategory.OpenPunctuation
87
+ | 1 << UnicodeCategory.ClosePunctuation
88
+ | 1 << UnicodeCategory.InitialQuotePunctuation
89
+ | 1 << UnicodeCategory.FinalQuotePunctuation
90
+ | 1 << UnicodeCategory.OtherPunctuation;
91
+ const isSeparatorMask = 0
92
+ | 1 << UnicodeCategory.SpaceSeparator
93
+ | 1 << UnicodeCategory.LineSeparator
94
+ | 1 << UnicodeCategory.ParagraphSeparator;
95
+ const isSymbolMask = 0
96
+ | 1 << UnicodeCategory.MathSymbol
97
+ | 1 << UnicodeCategory.CurrencySymbol
98
+ | 1 << UnicodeCategory.ModifierSymbol
99
+ | 1 << UnicodeCategory.OtherSymbol;
100
+ const isWhiteSpaceMask = 0
101
+ | 1 << UnicodeCategory.SpaceSeparator
102
+ | 1 << UnicodeCategory.LineSeparator
103
+ | 1 << UnicodeCategory.ParagraphSeparator;
104
+
105
+ const unicodeCategoryFunc = getCategoryFunc();
106
+
107
+ function charCodeAt(s: string, index: number) {
108
+ if (index >= 0 && index < s.length) {
109
+ return s.charCodeAt(index);
110
+ } else {
111
+ throw new Error("Index out of range.");
112
+ }
113
+ }
114
+
115
+ export const getUnicodeCategory = (s: string) => getUnicodeCategory2(s, 0);
116
+ export const isControl = (s: string) => isControl2(s, 0);
117
+ export const isDigit = (s: string) => isDigit2(s, 0);
118
+ export const isLetter = (s: string) => isLetter2(s, 0);
119
+ export const isLetterOrDigit = (s: string) => isLetterOrDigit2(s, 0);
120
+ export const isUpper = (s: string) => isUpper2(s, 0);
121
+ export const isLower = (s: string) => isLower2(s, 0);
122
+ export const isNumber = (s: string) => isNumber2(s, 0);
123
+ export const isPunctuation = (s: string) => isPunctuation2(s, 0);
124
+ export const isSeparator = (s: string) => isSeparator2(s, 0);
125
+ export const isSymbol = (s: string) => isSymbol2(s, 0);
126
+ export const isWhiteSpace = (s: string) => isWhiteSpace2(s, 0);
127
+ export const isHighSurrogate = (s: string) => isHighSurrogate2(s, 0);
128
+ export const isLowSurrogate = (s: string) => isLowSurrogate2(s, 0);
129
+ export const isSurrogate = (s: string) => isSurrogate2(s, 0);
130
+
131
+ export function getUnicodeCategory2(s: string, index: number) {
132
+ const cp = charCodeAt(s, index);
133
+ return unicodeCategoryFunc(cp);
134
+ }
135
+
136
+ export function isControl2(s: string, index: number) {
137
+ const test = 1 << getUnicodeCategory2(s, index);
138
+ return (test & isControlMask) !== 0;
139
+ }
140
+
141
+ export function isDigit2(s: string, index: number) {
142
+ const test = 1 << getUnicodeCategory2(s, index);
143
+ return (test & isDigitMask) !== 0;
144
+ }
145
+
146
+ export function isLetter2(s: string, index: number) {
147
+ const test = 1 << getUnicodeCategory2(s, index);
148
+ return (test & isLetterMask) !== 0;
149
+ }
150
+
151
+ export function isLetterOrDigit2(s: string, index: number) {
152
+ const test = 1 << getUnicodeCategory2(s, index);
153
+ return (test & isLetterOrDigitMask) !== 0;
154
+ }
155
+
156
+ export function isUpper2(s: string, index: number) {
157
+ const test = 1 << getUnicodeCategory2(s, index);
158
+ return (test & isUpperMask) !== 0;
159
+ }
160
+
161
+ export function isLower2(s: string, index: number) {
162
+ const test = 1 << getUnicodeCategory2(s, index);
163
+ return (test & isLowerMask) !== 0;
164
+ }
165
+
166
+ export function isNumber2(s: string, index: number) {
167
+ const test = 1 << getUnicodeCategory2(s, index);
168
+ return (test & isNumberMask) !== 0;
169
+ }
170
+
171
+ export function isPunctuation2(s: string, index: number) {
172
+ const test = 1 << getUnicodeCategory2(s, index);
173
+ return (test & isPunctuationMask) !== 0;
174
+ }
175
+
176
+ export function isSeparator2(s: string, index: number) {
177
+ const test = 1 << getUnicodeCategory2(s, index);
178
+ return (test & isSeparatorMask) !== 0;
179
+ }
180
+
181
+ export function isSymbol2(s: string, index: number) {
182
+ const test = 1 << getUnicodeCategory2(s, index);
183
+ return (test & isSymbolMask) !== 0;
184
+ }
185
+
186
+ export function isWhiteSpace2(s: string, index: number) {
187
+ const test = 1 << getUnicodeCategory2(s, index);
188
+ if ((test & isWhiteSpaceMask) !== 0) {
189
+ return true;
190
+ }
191
+ const cp = charCodeAt(s, index);
192
+ return (0x09 <= cp && cp <= 0x0D) || cp === 0x85 || cp === 0xA0;
193
+ }
194
+
195
+ export function isHighSurrogate2(s: string, index: number) {
196
+ const cp = charCodeAt(s, index);
197
+ return (0xD800 <= cp && cp <= 0xDBFF);
198
+ }
199
+
200
+ export function isLowSurrogate2(s: string, index: number) {
201
+ const cp = charCodeAt(s, index);
202
+ return (0xDC00 <= cp && cp <= 0xDFFF);
203
+ }
204
+
205
+ export function isSurrogate2(s: string, index: number) {
206
+ const cp = charCodeAt(s, index);
207
+ return (0xD800 <= cp && cp <= 0xDFFF);
208
+ }
209
+
210
+ export function isSurrogatePair(s: string, index: string | number) {
211
+ return typeof index === "number"
212
+ ? isHighSurrogate2(s, index) && isLowSurrogate2(s, index + 1)
213
+ : isHighSurrogate(s) && isLowSurrogate(index);
214
+ }
215
+
216
+ export function parse(input: string) {
217
+ if (input.length === 1) {
218
+ return input[0];
219
+ } else {
220
+ throw new Error("String must be exactly one character long.");
221
+ }
222
+ }
package/Choice.ts ADDED
@@ -0,0 +1,300 @@
1
+ import { Union } from "./Types.js";
2
+ import { union_type, TypeInfo } from "./Reflection.js";
3
+ import { Option, some } from "./Option.js";
4
+
5
+ export type FSharpChoice$2_$union<T1, T2> =
6
+ | FSharpChoice$2<T1, T2, 0>
7
+ | FSharpChoice$2<T1, T2, 1>
8
+
9
+ export type FSharpChoice$2_$cases<T1, T2> = {
10
+ 0: ["Choice1Of2", [T1]],
11
+ 1: ["Choice2Of2", [T2]]
12
+ }
13
+
14
+ export function FSharpChoice$2_Choice1Of2<T1, T2>(Item: T1) {
15
+ return new FSharpChoice$2<T1, T2, 0>(0, [Item]);
16
+ }
17
+
18
+ export function FSharpChoice$2_Choice2Of2<T1, T2>(Item: T2) {
19
+ return new FSharpChoice$2<T1, T2, 1>(1, [Item]);
20
+ }
21
+
22
+ export class FSharpChoice$2<T1, T2, Tag extends keyof FSharpChoice$2_$cases<T1, T2>> extends Union<Tag, FSharpChoice$2_$cases<T1, T2>[Tag][0]> {
23
+ constructor(readonly tag: Tag, readonly fields: FSharpChoice$2_$cases<T1, T2>[Tag][1]) {
24
+ super();
25
+ }
26
+ cases() {
27
+ return ["Choice1Of2", "Choice2Of2"];
28
+ }
29
+ }
30
+
31
+ export function FSharpChoice$2_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo {
32
+ return union_type("FSharp.Core.FSharpChoice`2", [gen0, gen1], FSharpChoice$2, () => [[["Item", gen0]], [["Item", gen1]]]);
33
+ }
34
+
35
+ export type FSharpChoice$3_$union<T1, T2, T3> =
36
+ | FSharpChoice$3<T1, T2, T3, 0>
37
+ | FSharpChoice$3<T1, T2, T3, 1>
38
+ | FSharpChoice$3<T1, T2, T3, 2>
39
+
40
+ export type FSharpChoice$3_$cases<T1, T2, T3> = {
41
+ 0: ["Choice1Of3", [T1]],
42
+ 1: ["Choice2Of3", [T2]],
43
+ 2: ["Choice3Of3", [T3]]
44
+ }
45
+
46
+ export function FSharpChoice$3_Choice1Of3<T1, T2, T3>(Item: T1) {
47
+ return new FSharpChoice$3<T1, T2, T3, 0>(0, [Item]);
48
+ }
49
+
50
+ export function FSharpChoice$3_Choice2Of3<T1, T2, T3>(Item: T2) {
51
+ return new FSharpChoice$3<T1, T2, T3, 1>(1, [Item]);
52
+ }
53
+
54
+ export function FSharpChoice$3_Choice3Of3<T1, T2, T3>(Item: T3) {
55
+ return new FSharpChoice$3<T1, T2, T3, 2>(2, [Item]);
56
+ }
57
+
58
+ export class FSharpChoice$3<T1, T2, T3, Tag extends keyof FSharpChoice$3_$cases<T1, T2, T3>> extends Union<Tag, FSharpChoice$3_$cases<T1, T2, T3>[Tag][0]> {
59
+ constructor(readonly tag: Tag, readonly fields: FSharpChoice$3_$cases<T1, T2, T3>[Tag][1]) {
60
+ super();
61
+ }
62
+ cases() {
63
+ return ["Choice1Of3", "Choice2Of3", "Choice3Of3"];
64
+ }
65
+ }
66
+
67
+ export function FSharpChoice$3_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo): TypeInfo {
68
+ return union_type("FSharp.Core.FSharpChoice`3", [gen0, gen1, gen2], FSharpChoice$3, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]]]);
69
+ }
70
+
71
+ export type FSharpChoice$4_$union<T1, T2, T3, T4> =
72
+ | FSharpChoice$4<T1, T2, T3, T4, 0>
73
+ | FSharpChoice$4<T1, T2, T3, T4, 1>
74
+ | FSharpChoice$4<T1, T2, T3, T4, 2>
75
+ | FSharpChoice$4<T1, T2, T3, T4, 3>
76
+
77
+ export type FSharpChoice$4_$cases<T1, T2, T3, T4> = {
78
+ 0: ["Choice1Of4", [T1]],
79
+ 1: ["Choice2Of4", [T2]],
80
+ 2: ["Choice3Of4", [T3]],
81
+ 3: ["Choice4Of4", [T4]]
82
+ }
83
+
84
+ export function FSharpChoice$4_Choice1Of4<T1, T2, T3, T4>(Item: T1) {
85
+ return new FSharpChoice$4<T1, T2, T3, T4, 0>(0, [Item]);
86
+ }
87
+
88
+ export function FSharpChoice$4_Choice2Of4<T1, T2, T3, T4>(Item: T2) {
89
+ return new FSharpChoice$4<T1, T2, T3, T4, 1>(1, [Item]);
90
+ }
91
+
92
+ export function FSharpChoice$4_Choice3Of4<T1, T2, T3, T4>(Item: T3) {
93
+ return new FSharpChoice$4<T1, T2, T3, T4, 2>(2, [Item]);
94
+ }
95
+
96
+ export function FSharpChoice$4_Choice4Of4<T1, T2, T3, T4>(Item: T4) {
97
+ return new FSharpChoice$4<T1, T2, T3, T4, 3>(3, [Item]);
98
+ }
99
+
100
+ export class FSharpChoice$4<T1, T2, T3, T4, Tag extends keyof FSharpChoice$4_$cases<T1, T2, T3, T4>> extends Union<Tag, FSharpChoice$4_$cases<T1, T2, T3, T4>[Tag][0]> {
101
+ constructor(readonly tag: Tag, readonly fields: FSharpChoice$4_$cases<T1, T2, T3, T4>[Tag][1]) {
102
+ super();
103
+ }
104
+ cases() {
105
+ return ["Choice1Of4", "Choice2Of4", "Choice3Of4", "Choice4Of4"];
106
+ }
107
+ }
108
+
109
+ export function FSharpChoice$4_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo, gen3: TypeInfo): TypeInfo {
110
+ return union_type("FSharp.Core.FSharpChoice`4", [gen0, gen1, gen2, gen3], FSharpChoice$4, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]]]);
111
+ }
112
+
113
+ export type FSharpChoice$5_$union<T1, T2, T3, T4, T5> =
114
+ | FSharpChoice$5<T1, T2, T3, T4, T5, 0>
115
+ | FSharpChoice$5<T1, T2, T3, T4, T5, 1>
116
+ | FSharpChoice$5<T1, T2, T3, T4, T5, 2>
117
+ | FSharpChoice$5<T1, T2, T3, T4, T5, 3>
118
+ | FSharpChoice$5<T1, T2, T3, T4, T5, 4>
119
+
120
+ export type FSharpChoice$5_$cases<T1, T2, T3, T4, T5> = {
121
+ 0: ["Choice1Of5", [T1]],
122
+ 1: ["Choice2Of5", [T2]],
123
+ 2: ["Choice3Of5", [T3]],
124
+ 3: ["Choice4Of5", [T4]],
125
+ 4: ["Choice5Of5", [T5]]
126
+ }
127
+
128
+ export function FSharpChoice$5_Choice1Of5<T1, T2, T3, T4, T5>(Item: T1) {
129
+ return new FSharpChoice$5<T1, T2, T3, T4, T5, 0>(0, [Item]);
130
+ }
131
+
132
+ export function FSharpChoice$5_Choice2Of5<T1, T2, T3, T4, T5>(Item: T2) {
133
+ return new FSharpChoice$5<T1, T2, T3, T4, T5, 1>(1, [Item]);
134
+ }
135
+
136
+ export function FSharpChoice$5_Choice3Of5<T1, T2, T3, T4, T5>(Item: T3) {
137
+ return new FSharpChoice$5<T1, T2, T3, T4, T5, 2>(2, [Item]);
138
+ }
139
+
140
+ export function FSharpChoice$5_Choice4Of5<T1, T2, T3, T4, T5>(Item: T4) {
141
+ return new FSharpChoice$5<T1, T2, T3, T4, T5, 3>(3, [Item]);
142
+ }
143
+
144
+ export function FSharpChoice$5_Choice5Of5<T1, T2, T3, T4, T5>(Item: T5) {
145
+ return new FSharpChoice$5<T1, T2, T3, T4, T5, 4>(4, [Item]);
146
+ }
147
+
148
+ export class FSharpChoice$5<T1, T2, T3, T4, T5, Tag extends keyof FSharpChoice$5_$cases<T1, T2, T3, T4, T5>> extends Union<Tag, FSharpChoice$5_$cases<T1, T2, T3, T4, T5>[Tag][0]> {
149
+ constructor(readonly tag: Tag, readonly fields: FSharpChoice$5_$cases<T1, T2, T3, T4, T5>[Tag][1]) {
150
+ super();
151
+ }
152
+ cases() {
153
+ return ["Choice1Of5", "Choice2Of5", "Choice3Of5", "Choice4Of5", "Choice5Of5"];
154
+ }
155
+ }
156
+
157
+ export function FSharpChoice$5_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo, gen3: TypeInfo, gen4: TypeInfo): TypeInfo {
158
+ return union_type("FSharp.Core.FSharpChoice`5", [gen0, gen1, gen2, gen3, gen4], FSharpChoice$5, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]], [["Item", gen4]]]);
159
+ }
160
+
161
+ export type FSharpChoice$6_$union<T1, T2, T3, T4, T5, T6> =
162
+ | FSharpChoice$6<T1, T2, T3, T4, T5, T6, 0>
163
+ | FSharpChoice$6<T1, T2, T3, T4, T5, T6, 1>
164
+ | FSharpChoice$6<T1, T2, T3, T4, T5, T6, 2>
165
+ | FSharpChoice$6<T1, T2, T3, T4, T5, T6, 3>
166
+ | FSharpChoice$6<T1, T2, T3, T4, T5, T6, 4>
167
+ | FSharpChoice$6<T1, T2, T3, T4, T5, T6, 5>
168
+
169
+ export type FSharpChoice$6_$cases<T1, T2, T3, T4, T5, T6> = {
170
+ 0: ["Choice1Of6", [T1]],
171
+ 1: ["Choice2Of6", [T2]],
172
+ 2: ["Choice3Of6", [T3]],
173
+ 3: ["Choice4Of6", [T4]],
174
+ 4: ["Choice5Of6", [T5]],
175
+ 5: ["Choice6Of6", [T6]]
176
+ }
177
+
178
+ export function FSharpChoice$6_Choice1Of6<T1, T2, T3, T4, T5, T6>(Item: T1) {
179
+ return new FSharpChoice$6<T1, T2, T3, T4, T5, T6, 0>(0, [Item]);
180
+ }
181
+
182
+ export function FSharpChoice$6_Choice2Of6<T1, T2, T3, T4, T5, T6>(Item: T2) {
183
+ return new FSharpChoice$6<T1, T2, T3, T4, T5, T6, 1>(1, [Item]);
184
+ }
185
+
186
+ export function FSharpChoice$6_Choice3Of6<T1, T2, T3, T4, T5, T6>(Item: T3) {
187
+ return new FSharpChoice$6<T1, T2, T3, T4, T5, T6, 2>(2, [Item]);
188
+ }
189
+
190
+ export function FSharpChoice$6_Choice4Of6<T1, T2, T3, T4, T5, T6>(Item: T4) {
191
+ return new FSharpChoice$6<T1, T2, T3, T4, T5, T6, 3>(3, [Item]);
192
+ }
193
+
194
+ export function FSharpChoice$6_Choice5Of6<T1, T2, T3, T4, T5, T6>(Item: T5) {
195
+ return new FSharpChoice$6<T1, T2, T3, T4, T5, T6, 4>(4, [Item]);
196
+ }
197
+
198
+ export function FSharpChoice$6_Choice6Of6<T1, T2, T3, T4, T5, T6>(Item: T6) {
199
+ return new FSharpChoice$6<T1, T2, T3, T4, T5, T6, 5>(5, [Item]);
200
+ }
201
+
202
+ export class FSharpChoice$6<T1, T2, T3, T4, T5, T6, Tag extends keyof FSharpChoice$6_$cases<T1, T2, T3, T4, T5, T6>> extends Union<Tag, FSharpChoice$6_$cases<T1, T2, T3, T4, T5, T6>[Tag][0]> {
203
+ constructor(readonly tag: Tag, readonly fields: FSharpChoice$6_$cases<T1, T2, T3, T4, T5, T6>[Tag][1]) {
204
+ super();
205
+ }
206
+ cases() {
207
+ return ["Choice1Of6", "Choice2Of6", "Choice3Of6", "Choice4Of6", "Choice5Of6", "Choice6Of6"];
208
+ }
209
+ }
210
+
211
+ export function FSharpChoice$6_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo, gen3: TypeInfo, gen4: TypeInfo, gen5: TypeInfo): TypeInfo {
212
+ return union_type("FSharp.Core.FSharpChoice`6", [gen0, gen1, gen2, gen3, gen4, gen5], FSharpChoice$6, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]], [["Item", gen4]], [["Item", gen5]]]);
213
+ }
214
+
215
+ export type FSharpChoice$7_$union<T1, T2, T3, T4, T5, T6, T7> =
216
+ | FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 0>
217
+ | FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 1>
218
+ | FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 2>
219
+ | FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 3>
220
+ | FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 4>
221
+ | FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 5>
222
+ | FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 6>
223
+
224
+ export type FSharpChoice$7_$cases<T1, T2, T3, T4, T5, T6, T7> = {
225
+ 0: ["Choice1Of7", [T1]],
226
+ 1: ["Choice2Of7", [T2]],
227
+ 2: ["Choice3Of7", [T3]],
228
+ 3: ["Choice4Of7", [T4]],
229
+ 4: ["Choice5Of7", [T5]],
230
+ 5: ["Choice6Of7", [T6]],
231
+ 6: ["Choice7Of7", [T7]]
232
+ }
233
+
234
+ export function FSharpChoice$7_Choice1Of7<T1, T2, T3, T4, T5, T6, T7>(Item: T1) {
235
+ return new FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 0>(0, [Item]);
236
+ }
237
+
238
+ export function FSharpChoice$7_Choice2Of7<T1, T2, T3, T4, T5, T6, T7>(Item: T2) {
239
+ return new FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 1>(1, [Item]);
240
+ }
241
+
242
+ export function FSharpChoice$7_Choice3Of7<T1, T2, T3, T4, T5, T6, T7>(Item: T3) {
243
+ return new FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 2>(2, [Item]);
244
+ }
245
+
246
+ export function FSharpChoice$7_Choice4Of7<T1, T2, T3, T4, T5, T6, T7>(Item: T4) {
247
+ return new FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 3>(3, [Item]);
248
+ }
249
+
250
+ export function FSharpChoice$7_Choice5Of7<T1, T2, T3, T4, T5, T6, T7>(Item: T5) {
251
+ return new FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 4>(4, [Item]);
252
+ }
253
+
254
+ export function FSharpChoice$7_Choice6Of7<T1, T2, T3, T4, T5, T6, T7>(Item: T6) {
255
+ return new FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 5>(5, [Item]);
256
+ }
257
+
258
+ export function FSharpChoice$7_Choice7Of7<T1, T2, T3, T4, T5, T6, T7>(Item: T7) {
259
+ return new FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, 6>(6, [Item]);
260
+ }
261
+
262
+ export class FSharpChoice$7<T1, T2, T3, T4, T5, T6, T7, Tag extends keyof FSharpChoice$7_$cases<T1, T2, T3, T4, T5, T6, T7>> extends Union<Tag, FSharpChoice$7_$cases<T1, T2, T3, T4, T5, T6, T7>[Tag][0]> {
263
+ constructor(readonly tag: Tag, readonly fields: FSharpChoice$7_$cases<T1, T2, T3, T4, T5, T6, T7>[Tag][1]) {
264
+ super();
265
+ }
266
+ cases() {
267
+ return ["Choice1Of7", "Choice2Of7", "Choice3Of7", "Choice4Of7", "Choice5Of7", "Choice6Of7", "Choice7Of7"];
268
+ }
269
+ }
270
+
271
+ export function FSharpChoice$7_$reflection(gen0: TypeInfo, gen1: TypeInfo, gen2: TypeInfo, gen3: TypeInfo, gen4: TypeInfo, gen5: TypeInfo, gen6: TypeInfo): TypeInfo {
272
+ return union_type("FSharp.Core.FSharpChoice`7", [gen0, gen1, gen2, gen3, gen4, gen5, gen6], FSharpChoice$7, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]], [["Item", gen4]], [["Item", gen5]], [["Item", gen6]]]);
273
+ }
274
+
275
+ export function Choice_makeChoice1Of2<T1, a>(x: T1): FSharpChoice$2_$union<T1, a> {
276
+ return FSharpChoice$2_Choice1Of2<T1, a>(x);
277
+ }
278
+
279
+ export function Choice_makeChoice2Of2<T2, a>(x: T2): FSharpChoice$2_$union<a, T2> {
280
+ return FSharpChoice$2_Choice2Of2<a, T2>(x);
281
+ }
282
+
283
+ export function Choice_tryValueIfChoice1Of2<T1, T2>(x: FSharpChoice$2_$union<T1, T2>): Option<T1> {
284
+ if (x.tag === /* Choice1Of2 */ 0) {
285
+ return some(x.fields[0]);
286
+ }
287
+ else {
288
+ return void 0;
289
+ }
290
+ }
291
+
292
+ export function Choice_tryValueIfChoice2Of2<T1, T2>(x: FSharpChoice$2_$union<T1, T2>): Option<T2> {
293
+ if (x.tag === /* Choice2Of2 */ 1) {
294
+ return some(x.fields[0]);
295
+ }
296
+ else {
297
+ return void 0;
298
+ }
299
+ }
300
+