@fable-org/fable-library-ts 1.10.0 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Array.ts +1378 -1378
- package/Async.ts +13 -14
- package/BigInt.ts +48 -22
- package/CHANGELOG.md +18 -1
- package/Choice.ts +301 -301
- package/Date.ts +47 -41
- package/Decimal.ts +29 -1
- package/FSharp.Collections.ts +34 -34
- package/FSharp.Core.CompilerServices.ts +37 -37
- package/FSharp.Core.ts +184 -184
- package/Global.ts +37 -37
- package/List.ts +1417 -1417
- package/Map.ts +1552 -1552
- package/MapUtil.ts +3 -0
- package/MutableMap.ts +345 -345
- package/MutableSet.ts +249 -249
- package/Native.ts +11 -11
- package/Numeric.ts +8 -3
- package/Random.ts +181 -181
- package/Range.ts +56 -56
- package/Result.ts +196 -196
- package/Seq.ts +1525 -1525
- package/Seq2.ts +129 -129
- package/Set.ts +1955 -1955
- package/String.ts +81 -10
- package/System.Collections.Generic.ts +380 -380
- package/System.Text.ts +203 -203
- package/Types.ts +1 -1
- package/package.json +1 -1
package/FSharp.Core.ts
CHANGED
|
@@ -1,184 +1,184 @@
|
|
|
1
|
-
import { IDisposable, disposeSafe, defaultOf, IEqualityComparer, IComparer, structuralHash, equals } from "./Util.js";
|
|
2
|
-
import { int32 } from "./Int32.js";
|
|
3
|
-
import { HashIdentity_Structural, ComparisonIdentity_Structural } from "./FSharp.Collections.js";
|
|
4
|
-
import { value as value_1, Nullable, Option } from "./Option.js";
|
|
5
|
-
import { FSharpChoice$2_$union, FSharpChoice$2_Choice2Of2, FSharpChoice$2_Choice1Of2 } from "./Choice.js";
|
|
6
|
-
import { StringBuilder, StringBuilder__Append_Z721C83C5 } from "./System.Text.js";
|
|
7
|
-
|
|
8
|
-
export const LanguagePrimitives_GenericEqualityComparer: any = {
|
|
9
|
-
"System.Collections.IEqualityComparer.Equals541DA560"(x: any, y: any): boolean {
|
|
10
|
-
return equals(x, y);
|
|
11
|
-
},
|
|
12
|
-
"System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1: any): int32 {
|
|
13
|
-
return structuralHash(x_1);
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const LanguagePrimitives_GenericEqualityERComparer: any = {
|
|
18
|
-
"System.Collections.IEqualityComparer.Equals541DA560"(x: any, y: any): boolean {
|
|
19
|
-
return equals(x, y);
|
|
20
|
-
},
|
|
21
|
-
"System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1: any): int32 {
|
|
22
|
-
return structuralHash(x_1);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export function LanguagePrimitives_FastGenericComparer<T>(): IComparer<T> {
|
|
27
|
-
return ComparisonIdentity_Structural<T>();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function LanguagePrimitives_FastGenericComparerFromTable<T>(): IComparer<T> {
|
|
31
|
-
return ComparisonIdentity_Structural<T>();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function LanguagePrimitives_FastGenericEqualityComparer<T>(): IEqualityComparer<T> {
|
|
35
|
-
return HashIdentity_Structural<T>();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function LanguagePrimitives_FastGenericEqualityComparerFromTable<T>(): IEqualityComparer<T> {
|
|
39
|
-
return HashIdentity_Structural<T>();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function Operators_Failure(message: string): Error {
|
|
43
|
-
return new Error(message);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function Operators_FailurePattern(exn: Error): Option<string> {
|
|
47
|
-
return exn.message;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function Operators_NullArg<$a>(x: string): $a {
|
|
51
|
-
throw new Error(x);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function Operators_Using<T extends IDisposable, R>(resource: T, action: ((arg0: T) => R)): R {
|
|
55
|
-
try {
|
|
56
|
-
return action(resource);
|
|
57
|
-
}
|
|
58
|
-
finally {
|
|
59
|
-
if (equals(resource, defaultOf())) {
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
let copyOfStruct: T = resource;
|
|
63
|
-
disposeSafe(copyOfStruct);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function Operators_Lock<$a, $b>(_lockObj: $a, action: (() => $b)): $b {
|
|
69
|
-
return action();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function Operators_IsNull<T>(value: T): boolean {
|
|
73
|
-
if (equals(value, defaultOf())) {
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function Operators_IsNotNull<T>(value: T): boolean {
|
|
82
|
-
if (equals(value, defaultOf())) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export function Operators_IsNullV<T extends any>(value: Nullable<T>): boolean {
|
|
91
|
-
return !(value != null);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export function Operators_NonNull<T>(value: T): T {
|
|
95
|
-
if (equals(value, defaultOf())) {
|
|
96
|
-
throw new Error();
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
return value;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function Operators_NonNullV<T extends any>(value: Nullable<T>): T {
|
|
104
|
-
if (value != null) {
|
|
105
|
-
return value_1(value);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
throw new Error();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export function Operators_NullMatchPattern<T>(value: T): FSharpChoice$2_$union<void, T> {
|
|
113
|
-
if (equals(value, defaultOf())) {
|
|
114
|
-
return FSharpChoice$2_Choice1Of2<void, T>(undefined);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
return FSharpChoice$2_Choice2Of2<void, T>(value);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export function Operators_NullValueMatchPattern<T extends any>(value: Nullable<T>): FSharpChoice$2_$union<void, T> {
|
|
122
|
-
if (value != null) {
|
|
123
|
-
return FSharpChoice$2_Choice2Of2<void, T>(value_1(value));
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
return FSharpChoice$2_Choice1Of2<void, T>(undefined);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function Operators_NonNullQuickPattern<T>(value: T): T {
|
|
131
|
-
if (equals(value, defaultOf())) {
|
|
132
|
-
throw new Error();
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
return value;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export function Operators_NonNullQuickValuePattern<T extends any>(value: Nullable<T>): T {
|
|
140
|
-
if (value != null) {
|
|
141
|
-
return value_1(value);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
throw new Error();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export function Operators_WithNull<T>(value: T): T {
|
|
149
|
-
return value;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export function Operators_WithNullV<T extends any>(value: T): T {
|
|
153
|
-
return value;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export function Operators_NullV<T extends any>(): Nullable<T> {
|
|
157
|
-
return defaultOf();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export function Operators_NullArgCheck<T>(argumentName: string, value: T): T {
|
|
161
|
-
if (equals(value, defaultOf())) {
|
|
162
|
-
throw new Error(argumentName);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
return value;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export function ExtraTopLevelOperators_LazyPattern<$a>(input: any): $a {
|
|
170
|
-
return input.Value;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export function PrintfModule_PrintFormatToStringBuilderThen<$a, $b>(continuation: (() => $a), builder: StringBuilder, format: any): $b {
|
|
174
|
-
return format.cont((s: string): $a => {
|
|
175
|
-
StringBuilder__Append_Z721C83C5(builder, s);
|
|
176
|
-
return continuation();
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export function PrintfModule_PrintFormatToStringBuilder<$a>(builder: StringBuilder, format: any): $a {
|
|
181
|
-
return PrintfModule_PrintFormatToStringBuilderThen<void, $a>((): void => {
|
|
182
|
-
}, builder, format);
|
|
183
|
-
}
|
|
184
|
-
|
|
1
|
+
import { IDisposable, disposeSafe, defaultOf, IEqualityComparer, IComparer, structuralHash, equals } from "./Util.js";
|
|
2
|
+
import { int32 } from "./Int32.js";
|
|
3
|
+
import { HashIdentity_Structural, ComparisonIdentity_Structural } from "./FSharp.Collections.js";
|
|
4
|
+
import { value as value_1, Nullable, Option } from "./Option.js";
|
|
5
|
+
import { FSharpChoice$2_$union, FSharpChoice$2_Choice2Of2, FSharpChoice$2_Choice1Of2 } from "./Choice.js";
|
|
6
|
+
import { StringBuilder, StringBuilder__Append_Z721C83C5 } from "./System.Text.js";
|
|
7
|
+
|
|
8
|
+
export const LanguagePrimitives_GenericEqualityComparer: any = {
|
|
9
|
+
"System.Collections.IEqualityComparer.Equals541DA560"(x: any, y: any): boolean {
|
|
10
|
+
return equals(x, y);
|
|
11
|
+
},
|
|
12
|
+
"System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1: any): int32 {
|
|
13
|
+
return structuralHash(x_1) | 0;
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const LanguagePrimitives_GenericEqualityERComparer: any = {
|
|
18
|
+
"System.Collections.IEqualityComparer.Equals541DA560"(x: any, y: any): boolean {
|
|
19
|
+
return equals(x, y);
|
|
20
|
+
},
|
|
21
|
+
"System.Collections.IEqualityComparer.GetHashCode4E60E31B"(x_1: any): int32 {
|
|
22
|
+
return structuralHash(x_1) | 0;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function LanguagePrimitives_FastGenericComparer<T>(): IComparer<T> {
|
|
27
|
+
return ComparisonIdentity_Structural<T>();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function LanguagePrimitives_FastGenericComparerFromTable<T>(): IComparer<T> {
|
|
31
|
+
return ComparisonIdentity_Structural<T>();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function LanguagePrimitives_FastGenericEqualityComparer<T>(): IEqualityComparer<T> {
|
|
35
|
+
return HashIdentity_Structural<T>();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function LanguagePrimitives_FastGenericEqualityComparerFromTable<T>(): IEqualityComparer<T> {
|
|
39
|
+
return HashIdentity_Structural<T>();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function Operators_Failure(message: string): Error {
|
|
43
|
+
return new Error(message);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function Operators_FailurePattern(exn: Error): Option<string> {
|
|
47
|
+
return exn.message;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function Operators_NullArg<$a>(x: string): $a {
|
|
51
|
+
throw new Error(x);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function Operators_Using<T extends IDisposable, R>(resource: T, action: ((arg0: T) => R)): R {
|
|
55
|
+
try {
|
|
56
|
+
return action(resource);
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
if (equals(resource, defaultOf())) {
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
let copyOfStruct: T = resource;
|
|
63
|
+
disposeSafe(copyOfStruct);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function Operators_Lock<$a, $b>(_lockObj: $a, action: (() => $b)): $b {
|
|
69
|
+
return action();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function Operators_IsNull<T>(value: T): boolean {
|
|
73
|
+
if (equals(value, defaultOf())) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function Operators_IsNotNull<T>(value: T): boolean {
|
|
82
|
+
if (equals(value, defaultOf())) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function Operators_IsNullV<T extends any>(value: Nullable<T>): boolean {
|
|
91
|
+
return !(value != null);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function Operators_NonNull<T>(value: T): T {
|
|
95
|
+
if (equals(value, defaultOf())) {
|
|
96
|
+
throw new Error();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function Operators_NonNullV<T extends any>(value: Nullable<T>): T {
|
|
104
|
+
if (value != null) {
|
|
105
|
+
return value_1(value);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
throw new Error();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function Operators_NullMatchPattern<T>(value: T): FSharpChoice$2_$union<void, T> {
|
|
113
|
+
if (equals(value, defaultOf())) {
|
|
114
|
+
return FSharpChoice$2_Choice1Of2<void, T>(undefined);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
return FSharpChoice$2_Choice2Of2<void, T>(value);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function Operators_NullValueMatchPattern<T extends any>(value: Nullable<T>): FSharpChoice$2_$union<void, T> {
|
|
122
|
+
if (value != null) {
|
|
123
|
+
return FSharpChoice$2_Choice2Of2<void, T>(value_1(value));
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
return FSharpChoice$2_Choice1Of2<void, T>(undefined);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function Operators_NonNullQuickPattern<T>(value: T): T {
|
|
131
|
+
if (equals(value, defaultOf())) {
|
|
132
|
+
throw new Error();
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return value;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function Operators_NonNullQuickValuePattern<T extends any>(value: Nullable<T>): T {
|
|
140
|
+
if (value != null) {
|
|
141
|
+
return value_1(value);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
throw new Error();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function Operators_WithNull<T>(value: T): T {
|
|
149
|
+
return value;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function Operators_WithNullV<T extends any>(value: T): T {
|
|
153
|
+
return value;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function Operators_NullV<T extends any>(): Nullable<T> {
|
|
157
|
+
return defaultOf();
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function Operators_NullArgCheck<T>(argumentName: string, value: T): T {
|
|
161
|
+
if (equals(value, defaultOf())) {
|
|
162
|
+
throw new Error(argumentName);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
return value;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function ExtraTopLevelOperators_LazyPattern<$a>(input: any): $a {
|
|
170
|
+
return input.Value;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function PrintfModule_PrintFormatToStringBuilderThen<$a, $b>(continuation: (() => $a), builder: StringBuilder, format: any): $b {
|
|
174
|
+
return format.cont((s: string): $a => {
|
|
175
|
+
StringBuilder__Append_Z721C83C5(builder, s);
|
|
176
|
+
return continuation();
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function PrintfModule_PrintFormatToStringBuilder<$a>(builder: StringBuilder, format: any): $a {
|
|
181
|
+
return PrintfModule_PrintFormatToStringBuilderThen<void, $a>((): void => {
|
|
182
|
+
}, builder, format);
|
|
183
|
+
}
|
|
184
|
+
|
package/Global.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { int32 } from "./Int32.js";
|
|
2
|
-
|
|
3
|
-
export interface Fable_Core_IGenericAdder$1<T> {
|
|
4
|
-
Add(arg0: T, arg1: T): T,
|
|
5
|
-
GetZero(): T
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface Fable_Core_IGenericAverager$1<T> {
|
|
9
|
-
Add(arg0: T, arg1: T): T,
|
|
10
|
-
DivideByInt(arg0: T, arg1: int32): T,
|
|
11
|
-
GetZero(): T
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface Fable_Core_Symbol_wellknown {
|
|
15
|
-
[Symbol.toStringTag]: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface Fable_Core_IJsonSerializable {
|
|
19
|
-
toJSON(): any
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const SR_indexOutOfBounds = "The index was outside the range of elements in the collection.";
|
|
23
|
-
|
|
24
|
-
export const SR_inputWasEmpty = "Collection was empty.";
|
|
25
|
-
|
|
26
|
-
export const SR_inputMustBeNonNegative = "The input must be non-negative.";
|
|
27
|
-
|
|
28
|
-
export const SR_inputSequenceEmpty = "The input sequence was empty.";
|
|
29
|
-
|
|
30
|
-
export const SR_inputSequenceTooLong = "The input sequence contains more than one element.";
|
|
31
|
-
|
|
32
|
-
export const SR_keyNotFoundAlt = "An index satisfying the predicate was not found in the collection.";
|
|
33
|
-
|
|
34
|
-
export const SR_differentLengths = "The collections had different lengths.";
|
|
35
|
-
|
|
36
|
-
export const SR_notEnoughElements = "The input sequence has an insufficient number of elements.";
|
|
37
|
-
|
|
1
|
+
import { int32 } from "./Int32.js";
|
|
2
|
+
|
|
3
|
+
export interface Fable_Core_IGenericAdder$1<T> {
|
|
4
|
+
Add(arg0: T, arg1: T): T,
|
|
5
|
+
GetZero(): T
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Fable_Core_IGenericAverager$1<T> {
|
|
9
|
+
Add(arg0: T, arg1: T): T,
|
|
10
|
+
DivideByInt(arg0: T, arg1: int32): T,
|
|
11
|
+
GetZero(): T
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Fable_Core_Symbol_wellknown {
|
|
15
|
+
[Symbol.toStringTag]: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Fable_Core_IJsonSerializable {
|
|
19
|
+
toJSON(): any
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const SR_indexOutOfBounds = "The index was outside the range of elements in the collection.";
|
|
23
|
+
|
|
24
|
+
export const SR_inputWasEmpty = "Collection was empty.";
|
|
25
|
+
|
|
26
|
+
export const SR_inputMustBeNonNegative = "The input must be non-negative.";
|
|
27
|
+
|
|
28
|
+
export const SR_inputSequenceEmpty = "The input sequence was empty.";
|
|
29
|
+
|
|
30
|
+
export const SR_inputSequenceTooLong = "The input sequence contains more than one element.";
|
|
31
|
+
|
|
32
|
+
export const SR_keyNotFoundAlt = "An index satisfying the predicate was not found in the collection.";
|
|
33
|
+
|
|
34
|
+
export const SR_differentLengths = "The collections had different lengths.";
|
|
35
|
+
|
|
36
|
+
export const SR_notEnoughElements = "The input sequence has an insufficient number of elements.";
|
|
37
|
+
|