@magnusopera/fscript 0.87.2 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/FScript.Language/Ast.js +2 -2
- package/dist/FScript.Language/BuiltinFunctions.js +81 -69
- package/dist/FScript.Language/BuiltinSignatures.js +9 -8
- package/dist/FScript.Language/BuiltinTypes.js +1 -1
- package/dist/FScript.Language/Error.js +2 -2
- package/dist/FScript.Language/Eval.js +176 -127
- package/dist/FScript.Language/Execution.js +8 -7
- package/dist/FScript.Language/ExportSignatures.js +5 -5
- package/dist/FScript.Language/HostInterop.js +41 -11
- package/dist/FScript.Language/IncludeResolver.js +15 -19
- package/dist/FScript.Language/Interactive.js +9 -9
- package/dist/FScript.Language/Lexer.js +39 -39
- package/dist/FScript.Language/Parser.js +17 -17
- package/dist/FScript.Language/Pretty.js +5 -5
- package/dist/FScript.Language/Span.js +2 -2
- package/dist/FScript.Language/SupportCollections.js +2871 -0
- package/dist/FScript.Language/SupportLibrary.js +1998 -0
- package/dist/FScript.Language/TaskFunctions.js +51 -7
- package/dist/FScript.Language/TaskSharingAnalysis.js +310 -129
- package/dist/FScript.Language/Token.js +2 -2
- package/dist/FScript.Language/TypeInfer.js +21 -25
- package/dist/FScript.Language/Types.js +9 -9
- package/dist/FScript.Language/Value.js +11 -8
- package/dist/Library.js +54 -28
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Array.js +325 -198
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/BigInt.js +18 -6
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/CHANGELOG.md +64 -1
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Date.js +1 -1
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Decimal.js +33 -47
- package/dist/fable_modules/fable-library-js.5.27.0/Double.js +78 -0
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/FSharp.Core.js +7 -1
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Global.js +1 -1
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Int32.js +10 -1
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/List.js +230 -157
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Long.js +7 -2
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Map.js +46 -39
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/MutableMap.js +76 -96
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/MutableSet.js +58 -80
- package/dist/fable_modules/fable-library-js.5.27.0/NumberStyles.js +56 -0
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Numeric.js +72 -4
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Random.js +26 -17
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Range.js +4 -3
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Reflection.js +7 -1
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/RegExp.js +3 -2
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Seq.js +149 -70
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Seq2.js +4 -8
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Set.js +66 -59
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/String.js +160 -39
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/System.Collections.Generic.js +3 -2
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/System.Text.js +10 -10
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/System.js +5 -5
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/TimeOnly.js +1 -1
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Types.js +28 -10
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Util.js +151 -54
- package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/package.json +1 -1
- package/dist/fable_modules/project_cracked.json +1 -1
- package/package.json +1 -1
- package/dist/fable_modules/fable-library-js.5.24.0/Double.js +0 -53
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Async.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/AsyncBuilder.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/BitConverter.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Boolean.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Char.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Choice.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/CollectionUtil.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/ConditionalWeakTable.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/DateOffset.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/DateOnly.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/DateOnlyTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/DateTimeFormat.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/DateTimeOffsetTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/DateTimeTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Directory.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Encoding.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Environment.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Event.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/FSharp.Collections.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/FSharp.Core.CompilerServices.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/File.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Guid.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/MailboxProcessor.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/MapUtil.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Native.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Observable.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Option.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Path.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/README.md +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Result.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Stopwatch.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Task.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/TaskBuilder.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/TimeOnlyTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/TimeSpan.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/TimeSpanTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Timer.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Unicode.13.0.0.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/Uri.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/big.d.ts +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/lib/big.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.24.0 → fable-library-js.5.27.0}/quotation.js +0 -0
package/README.md
CHANGED
|
@@ -13,3 +13,18 @@ See the [JavaScript hosting reference](https://fscript.magnusopera.io/manual/emb
|
|
|
13
13
|
## Exit status
|
|
14
14
|
|
|
15
15
|
JavaScript treats `Env.setExitCode` as a no-op for source portability. It does not change process status or enforce a shell-code range. Arguments are still evaluated normally, and the program's returned value is unchanged. The website continues displaying that value. Existing `run`, `evaluate`, and `invoke` APIs retain their tagged-value results.
|
|
16
|
+
|
|
17
|
+
## Hosted interpreter permissions
|
|
18
|
+
|
|
19
|
+
JavaScript hosting grants no capabilities by default. Pass `permissions: ['IO']` (or `Interactive`, `Threading`, `Native`) in run/load/parse/session options to grant them explicitly. `extern` and `HostFunctions.create` accept `requiredPermissions: ['IO']`; omitted requirements declare a host-authored callback as requiring none. Loaded exports and sessions retain grants; returned callables and invocation-context operations check the active policy. For example:
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
const write = HostFunctions.create({
|
|
23
|
+
name: 'Host.write', parameters: [T.string], result: T.unit,
|
|
24
|
+
requiredPermissions: ['IO'],
|
|
25
|
+
invoke: ([text]) => { console.log(text.value); return {kind: 'unit'}; }
|
|
26
|
+
});
|
|
27
|
+
run('Host.write "hello"', {externs: [write], permissions: ['IO']});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
These declarations rely on truthful host classification; arbitrary JavaScript handlers are trusted code. Granting `Threading` does not add Task implementation support to Fable: task operations remain unsupported. See the [host permissions guide](https://fscript.magnusopera.io/manual/embedding/host-permissions) for the capability model and .NET host API.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { Union, Record } from "../fable_modules/fable-library-js.5.
|
|
3
|
-
import { float64_type, int64_type, union_type, option_type, list_type, tuple_type, bool_type, record_type, string_type } from "../fable_modules/fable-library-js.5.
|
|
2
|
+
import { Union, Record } from "../fable_modules/fable-library-js.5.27.0/Types.js";
|
|
3
|
+
import { float64_type, int64_type, union_type, option_type, list_type, tuple_type, bool_type, record_type, string_type } from "../fable_modules/fable-library-js.5.27.0/Reflection.js";
|
|
4
4
|
import { Span_$reflection } from "./Span.js";
|
|
5
5
|
|
|
6
6
|
export class BackendImport extends Record {
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
|
|
2
2
|
import { Span, Position } from "./Span.js";
|
|
3
3
|
import { EvalException, EvalError$ } from "./Error.js";
|
|
4
|
-
import { FSharpMap__Remove, toList, add, FSharpMap__Add, FSharpMap__ContainsKey, FSharpMap__TryFind, empty as empty_1, forAll, FSharpMap__get_Count, tryFind } from "../fable_modules/fable-library-js.5.
|
|
4
|
+
import { FSharpMap__Remove, toList, add, FSharpMap__Add, FSharpMap__ContainsKey, FSharpMap__TryFind, empty as empty_1, forAll, FSharpMap__get_Count, tryFind } from "../fable_modules/fable-library-js.5.27.0/Map.js";
|
|
5
5
|
import { builtinSchemes } from "./BuiltinSignatures.js";
|
|
6
|
-
import { compare as compare_1, equals as equals_1, curry2, defaultOf, Exception } from "../fable_modules/fable-library-js.5.
|
|
7
|
-
import { endsWith, split, join, substring, indexOf, replace, format, concat } from "../fable_modules/fable-library-js.5.
|
|
8
|
-
import { FSharpRef, Record } from "../fable_modules/fable-library-js.5.
|
|
6
|
+
import { uncurry2, compare as compare_1, equals as equals_1, curry2, defaultOf, Exception } from "../fable_modules/fable-library-js.5.27.0/Util.js";
|
|
7
|
+
import { endsWith, split, join, substring, indexOf, replace, format, concat } from "../fable_modules/fable-library-js.5.27.0/String.js";
|
|
8
|
+
import { FSharpRef, Record } from "../fable_modules/fable-library-js.5.27.0/Types.js";
|
|
9
9
|
import { Value, MapKey, ExternalFunction, Value_$reflection } from "./Value.js";
|
|
10
|
-
import { Execution_fold, Execution_execution, Execution_Builder__For_Z3A5BE4A, Execution$1__get_IsImmediate, Execution_map, Execution$1, Execution_run, Execution$1_$reflection } from "./Execution.js";
|
|
11
|
-
import { record_type, list_type, lambda_type } from "../fable_modules/fable-library-js.5.
|
|
12
|
-
import { Dictionary } from "../fable_modules/fable-library-js.5.
|
|
13
|
-
import { HashIdentity_Reference } from "../fable_modules/fable-library-js.5.
|
|
14
|
-
import { tryGetValue, addToDict } from "../fable_modules/fable-library-js.5.
|
|
15
|
-
import { tryParse } from "../fable_modules/fable-library-js.5.
|
|
16
|
-
import { tryParse as tryParse_1 } from "../fable_modules/fable-library-js.5.
|
|
17
|
-
import { append, tryHead, choose, concat as concat_1, ofArray, map, exists as exists_1, fold, forAll2, length as length_1, empty, reverse, cons, tail as tail_1, head as head_1, isEmpty } from "../fable_modules/fable-library-js.5.
|
|
18
|
-
import { compare, op_Addition, toInt32_unchecked, fromInt32, toInt64_unchecked, equals } from "../fable_modules/fable-library-js.5.
|
|
19
|
-
import { exists } from "../fable_modules/fable-library-js.5.
|
|
20
|
-
import { some, toArray } from "../fable_modules/fable-library-js.5.
|
|
10
|
+
import { Execution_Builder__TryWith_1CEB6EA5, Execution_fold, Execution_execution, Execution_Builder__For_Z3A5BE4A, Execution$1__get_IsImmediate, Execution_map, Execution$1, Execution_run, Execution$1_$reflection } from "./Execution.js";
|
|
11
|
+
import { record_type, list_type, lambda_type } from "../fable_modules/fable-library-js.5.27.0/Reflection.js";
|
|
12
|
+
import { Dictionary } from "../fable_modules/fable-library-js.5.27.0/MutableMap.js";
|
|
13
|
+
import { HashIdentity_Reference } from "../fable_modules/fable-library-js.5.27.0/FSharp.Collections.js";
|
|
14
|
+
import { tryGetValue, addToDict } from "../fable_modules/fable-library-js.5.27.0/MapUtil.js";
|
|
15
|
+
import { tryParse } from "../fable_modules/fable-library-js.5.27.0/Long.js";
|
|
16
|
+
import { tryParse as tryParse_1 } from "../fable_modules/fable-library-js.5.27.0/Double.js";
|
|
17
|
+
import { append, tryHead, choose, concat as concat_1, ofArray, map, exists as exists_1, fold, forAll2, length as length_1, empty, reverse, cons, tail as tail_1, head as head_1, isEmpty } from "../fable_modules/fable-library-js.5.27.0/List.js";
|
|
18
|
+
import { compare, op_Addition, toInt32_unchecked, fromInt32, toInt64_unchecked, equals } from "../fable_modules/fable-library-js.5.27.0/BigInt.js";
|
|
19
|
+
import { exists } from "../fable_modules/fable-library-js.5.27.0/Seq.js";
|
|
20
|
+
import { some, toArray } from "../fable_modules/fable-library-js.5.27.0/Option.js";
|
|
21
21
|
import { $007CRecordFields$007C_$007C } from "./HostInterop.js";
|
|
22
|
-
import { tryParse as tryParse_2 } from "../fable_modules/fable-library-js.5.
|
|
22
|
+
import { tryParse as tryParse_2 } from "../fable_modules/fable-library-js.5.27.0/Boolean.js";
|
|
23
|
+
import { invoke } from "./SupportCollections.js";
|
|
24
|
+
import { OverflowException, ArgumentException } from "../fable_modules/fable-library-js.5.27.0/System.js";
|
|
25
|
+
import { signatures } from "./SupportLibrary.js";
|
|
23
26
|
|
|
24
27
|
const unknownSpan = new Span(new Position(undefined, 0, 0), new Position(undefined, 0, 0));
|
|
25
28
|
|
|
@@ -51,17 +54,15 @@ function ResumableImplementation_$reflection() {
|
|
|
51
54
|
const implementations = new Dictionary([], HashIdentity_Reference());
|
|
52
55
|
|
|
53
56
|
function resumable(name, arity, implementation) {
|
|
54
|
-
const descriptor = new ExternalFunction(name, scheme(name), (context, arguments$) => Execution_run(implementation((f) => ((a) => (new Execution$1(context.Apply(f, a), defaultOf()))), arguments$)), arity);
|
|
57
|
+
const descriptor = new ExternalFunction(0, name, scheme(name), (context, arguments$) => Execution_run(implementation((f) => ((a) => (new Execution$1(context.Apply(f, a), defaultOf()))), arguments$)), arity);
|
|
55
58
|
addToDict(implementations, descriptor, new ResumableImplementation(implementation));
|
|
56
59
|
return descriptor;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
export function tryExecution(descriptor) {
|
|
60
63
|
let matchValue;
|
|
61
|
-
|
|
62
|
-
matchValue = [tryGetValue(implementations, descriptor,
|
|
63
|
-
outArg = v;
|
|
64
|
-
})), outArg];
|
|
64
|
+
const cell = new FSharpRef(defaultOf());
|
|
65
|
+
matchValue = [tryGetValue(implementations, descriptor, cell), cell.contents];
|
|
65
66
|
if (matchValue[0]) {
|
|
66
67
|
return curry2(matchValue[1].Invoke);
|
|
67
68
|
}
|
|
@@ -72,10 +73,8 @@ export function tryExecution(descriptor) {
|
|
|
72
73
|
|
|
73
74
|
function tryParseInt64(text) {
|
|
74
75
|
let matchValue;
|
|
75
|
-
|
|
76
|
-
matchValue = [tryParse(text, 511, false, 64,
|
|
77
|
-
outArg = v;
|
|
78
|
-
})), outArg];
|
|
76
|
+
const cell = new FSharpRef(0n);
|
|
77
|
+
matchValue = [tryParse(text, 511, false, 64, cell), cell.contents];
|
|
79
78
|
if (matchValue[0]) {
|
|
80
79
|
return matchValue[1];
|
|
81
80
|
}
|
|
@@ -86,10 +85,8 @@ function tryParseInt64(text) {
|
|
|
86
85
|
|
|
87
86
|
function tryParseDouble(text) {
|
|
88
87
|
let matchValue;
|
|
89
|
-
|
|
90
|
-
matchValue = [tryParse_1(text,
|
|
91
|
-
outArg = v;
|
|
92
|
-
})), outArg];
|
|
88
|
+
const cell = new FSharpRef(0);
|
|
89
|
+
matchValue = [tryParse_1(text, 231, cell), cell.contents];
|
|
93
90
|
if (matchValue[0]) {
|
|
94
91
|
return matchValue[1];
|
|
95
92
|
}
|
|
@@ -697,30 +694,29 @@ function distinctValues(values) {
|
|
|
697
694
|
}, empty(), values));
|
|
698
695
|
}
|
|
699
696
|
|
|
700
|
-
const builtinIgnore = new ExternalFunction("ignore", scheme("ignore"), (_arg, _arg_1) => Value.VUnit, 1);
|
|
697
|
+
const builtinIgnore = new ExternalFunction(0, "ignore", scheme("ignore"), (_arg, _arg_1) => Value.VUnit, 1);
|
|
701
698
|
|
|
702
|
-
const builtinIntTryParse = new ExternalFunction("Int.tryParse", scheme("Int.tryParse"), (_arg, args) => {
|
|
699
|
+
const builtinIntTryParse = new ExternalFunction(0, "Int.tryParse", scheme("Int.tryParse"), (_arg, args) => {
|
|
703
700
|
const matchValue = tryParseInt64(expectString("Int.tryParse", args));
|
|
704
701
|
return (matchValue == null) ? (new Value(/* VOption */ 9, [undefined])) : (new Value(/* VOption */ 9, [new Value(/* VInt */ 1, [matchValue])]));
|
|
705
702
|
}, 1);
|
|
706
703
|
|
|
707
|
-
const builtinFloatTryParse = new ExternalFunction("Float.tryParse", scheme("Float.tryParse"), (_arg, args) => {
|
|
704
|
+
const builtinFloatTryParse = new ExternalFunction(0, "Float.tryParse", scheme("Float.tryParse"), (_arg, args) => {
|
|
708
705
|
const matchValue = tryParseDouble(expectString("Float.tryParse", args));
|
|
709
706
|
return (matchValue == null) ? (new Value(/* VOption */ 9, [undefined])) : (new Value(/* VOption */ 9, [new Value(/* VFloat */ 2, [matchValue])]));
|
|
710
707
|
}, 1);
|
|
711
708
|
|
|
712
|
-
const builtinBoolTryParse = new ExternalFunction("Bool.tryParse", scheme("Bool.tryParse"), (_arg, args) => {
|
|
709
|
+
const builtinBoolTryParse = new ExternalFunction(0, "Bool.tryParse", scheme("Bool.tryParse"), (_arg, args) => {
|
|
710
|
+
const text = expectString("Bool.tryParse", args);
|
|
713
711
|
let matchValue;
|
|
714
|
-
|
|
715
|
-
matchValue = [tryParse_2(
|
|
716
|
-
outArg = v;
|
|
717
|
-
})), outArg];
|
|
712
|
+
const cell = new FSharpRef(false);
|
|
713
|
+
matchValue = [tryParse_2(text, cell), cell.contents];
|
|
718
714
|
return matchValue[0] ? (new Value(/* VOption */ 9, [new Value(/* VBool */ 3, [matchValue[1]])])) : (new Value(/* VOption */ 9, [undefined]));
|
|
719
715
|
}, 1);
|
|
720
716
|
|
|
721
|
-
const builtinIntToString = new ExternalFunction("Int.toString", scheme("Int.toString"), (_arg, args) => (new Value(/* VString */ 4, [String(expectInt("Int.toString", args))])), 1);
|
|
717
|
+
const builtinIntToString = new ExternalFunction(0, "Int.toString", scheme("Int.toString"), (_arg, args) => (new Value(/* VString */ 4, [String(expectInt("Int.toString", args))])), 1);
|
|
722
718
|
|
|
723
|
-
const builtinFloatToString = new ExternalFunction("Float.toString", scheme("Float.toString"), (_arg, args) => {
|
|
719
|
+
const builtinFloatToString = new ExternalFunction(0, "Float.toString", scheme("Float.toString"), (_arg, args) => {
|
|
724
720
|
let matchResult, value;
|
|
725
721
|
if (!isEmpty(args)) {
|
|
726
722
|
if (head_1(args).tag === 2) {
|
|
@@ -747,9 +743,9 @@ const builtinFloatToString = new ExternalFunction("Float.toString", scheme("Floa
|
|
|
747
743
|
}
|
|
748
744
|
}, 1);
|
|
749
745
|
|
|
750
|
-
const builtinBoolToString = new ExternalFunction("Bool.toString", scheme("Bool.toString"), (_arg, args) => (new Value(/* VString */ 4, [expectBool("Bool.toString", args) ? "true" : "false"])), 1);
|
|
746
|
+
const builtinBoolToString = new ExternalFunction(0, "Bool.toString", scheme("Bool.toString"), (_arg, args) => (new Value(/* VString */ 4, [expectBool("Bool.toString", args) ? "true" : "false"])), 1);
|
|
751
747
|
|
|
752
|
-
const builtinStringReplace = new ExternalFunction("String.replace", scheme("String.replace"), (_arg, args) => {
|
|
748
|
+
const builtinStringReplace = new ExternalFunction(0, "String.replace", scheme("String.replace"), (_arg, args) => {
|
|
753
749
|
let matchResult, newValue, oldValue, source;
|
|
754
750
|
if (!isEmpty(args)) {
|
|
755
751
|
if (head_1(args).tag === 4) {
|
|
@@ -798,7 +794,7 @@ const builtinStringReplace = new ExternalFunction("String.replace", scheme("Stri
|
|
|
798
794
|
}
|
|
799
795
|
}, 3);
|
|
800
796
|
|
|
801
|
-
const builtinStringIndexOf = new ExternalFunction("String.indexOf", scheme("String.indexOf"), (_arg, args) => {
|
|
797
|
+
const builtinStringIndexOf = new ExternalFunction(0, "String.indexOf", scheme("String.indexOf"), (_arg, args) => {
|
|
802
798
|
let matchResult, source, value;
|
|
803
799
|
if (!isEmpty(args)) {
|
|
804
800
|
if (head_1(args).tag === 4) {
|
|
@@ -838,17 +834,17 @@ const builtinStringIndexOf = new ExternalFunction("String.indexOf", scheme("Stri
|
|
|
838
834
|
}
|
|
839
835
|
}, 2);
|
|
840
836
|
|
|
841
|
-
const builtinStringToLower = new ExternalFunction("String.toLower", scheme("String.toLower"), (_arg, args) => {
|
|
837
|
+
const builtinStringToLower = new ExternalFunction(0, "String.toLower", scheme("String.toLower"), (_arg, args) => {
|
|
842
838
|
const source = expectString("String.toLower", args);
|
|
843
839
|
return new Value(/* VString */ 4, [source.toLowerCase()]);
|
|
844
840
|
}, 1);
|
|
845
841
|
|
|
846
|
-
const builtinStringToUpper = new ExternalFunction("String.toUpper", scheme("String.toUpper"), (_arg, args) => {
|
|
842
|
+
const builtinStringToUpper = new ExternalFunction(0, "String.toUpper", scheme("String.toUpper"), (_arg, args) => {
|
|
847
843
|
const source = expectString("String.toUpper", args);
|
|
848
844
|
return new Value(/* VString */ 4, [source.toUpperCase()]);
|
|
849
845
|
}, 1);
|
|
850
846
|
|
|
851
|
-
const builtinStringSubstring = new ExternalFunction("String.substring", scheme("String.substring"), (_arg, args) => {
|
|
847
|
+
const builtinStringSubstring = new ExternalFunction(0, "String.substring", scheme("String.substring"), (_arg, args) => {
|
|
852
848
|
let matchResult, length, source, start;
|
|
853
849
|
if (!isEmpty(args)) {
|
|
854
850
|
if (head_1(args).tag === 1) {
|
|
@@ -900,7 +896,7 @@ const builtinStringSubstring = new ExternalFunction("String.substring", scheme("
|
|
|
900
896
|
}
|
|
901
897
|
}, 3);
|
|
902
898
|
|
|
903
|
-
const builtinStringConcat = new ExternalFunction("String.concat", scheme("String.concat"), (_arg, args) => {
|
|
899
|
+
const builtinStringConcat = new ExternalFunction(0, "String.concat", scheme("String.concat"), (_arg, args) => {
|
|
904
900
|
let matchResult, separator, values;
|
|
905
901
|
if (!isEmpty(args)) {
|
|
906
902
|
if (head_1(args).tag === 4) {
|
|
@@ -938,7 +934,7 @@ const builtinStringConcat = new ExternalFunction("String.concat", scheme("String
|
|
|
938
934
|
}
|
|
939
935
|
}, 2);
|
|
940
936
|
|
|
941
|
-
const builtinStringSplit = new ExternalFunction("String.split", scheme("String.split"), (_arg, args) => {
|
|
937
|
+
const builtinStringSplit = new ExternalFunction(0, "String.split", scheme("String.split"), (_arg, args) => {
|
|
942
938
|
let matchResult, separator, source;
|
|
943
939
|
if (!isEmpty(args)) {
|
|
944
940
|
if (head_1(args).tag === 4) {
|
|
@@ -976,7 +972,7 @@ const builtinStringSplit = new ExternalFunction("String.split", scheme("String.s
|
|
|
976
972
|
}
|
|
977
973
|
}, 2);
|
|
978
974
|
|
|
979
|
-
const builtinStringEndsWith = new ExternalFunction("String.endsWith", scheme("String.endsWith"), (_arg, args) => {
|
|
975
|
+
const builtinStringEndsWith = new ExternalFunction(0, "String.endsWith", scheme("String.endsWith"), (_arg, args) => {
|
|
980
976
|
let matchResult, source, suffix;
|
|
981
977
|
if (!isEmpty(args)) {
|
|
982
978
|
if (head_1(args).tag === 4) {
|
|
@@ -1014,7 +1010,7 @@ const builtinStringEndsWith = new ExternalFunction("String.endsWith", scheme("St
|
|
|
1014
1010
|
}
|
|
1015
1011
|
}, 2);
|
|
1016
1012
|
|
|
1017
|
-
const builtinListEmpty = new ExternalFunction("List.empty", scheme("List.empty"), (_arg, _arg_1) => (new Value(/* VList */ 5, [empty()])), 0);
|
|
1013
|
+
const builtinListEmpty = new ExternalFunction(0, "List.empty", scheme("List.empty"), (_arg, _arg_1) => (new Value(/* VList */ 5, [empty()])), 0);
|
|
1018
1014
|
|
|
1019
1015
|
const builtinListMap = resumable("List.map", 2, (apply, args) => {
|
|
1020
1016
|
let matchResult, mapper, values;
|
|
@@ -1457,7 +1453,7 @@ const builtinListExists = resumable("List.exists", 2, (apply, args) => {
|
|
|
1457
1453
|
}
|
|
1458
1454
|
});
|
|
1459
1455
|
|
|
1460
|
-
const builtinListContains = new ExternalFunction("List.contains", scheme("List.contains"), (_arg, args) => {
|
|
1456
|
+
const builtinListContains = new ExternalFunction(0, "List.contains", scheme("List.contains"), (_arg, args) => {
|
|
1461
1457
|
let matchResult, needle, values;
|
|
1462
1458
|
if (!isEmpty(args)) {
|
|
1463
1459
|
if (!isEmpty(tail_1(args))) {
|
|
@@ -1563,9 +1559,9 @@ const builtinListContains = new ExternalFunction("List.contains", scheme("List.c
|
|
|
1563
1559
|
}
|
|
1564
1560
|
}, 2);
|
|
1565
1561
|
|
|
1566
|
-
const builtinListRev = new ExternalFunction("List.rev", scheme("List.rev"), (_arg, args) => (new Value(/* VList */ 5, [reverse(expectList("List.rev", args))])), 1);
|
|
1562
|
+
const builtinListRev = new ExternalFunction(0, "List.rev", scheme("List.rev"), (_arg, args) => (new Value(/* VList */ 5, [reverse(expectList("List.rev", args))])), 1);
|
|
1567
1563
|
|
|
1568
|
-
const builtinListDistinct = new ExternalFunction("List.distinct", scheme("List.distinct"), (_arg, args) => (new Value(/* VList */ 5, [distinctValues(expectList("List.distinct", args))])), 1);
|
|
1564
|
+
const builtinListDistinct = new ExternalFunction(0, "List.distinct", scheme("List.distinct"), (_arg, args) => (new Value(/* VList */ 5, [distinctValues(expectList("List.distinct", args))])), 1);
|
|
1569
1565
|
|
|
1570
1566
|
const builtinListFold = resumable("List.fold", 3, (apply, args) => {
|
|
1571
1567
|
let matchResult, folder, state, values;
|
|
@@ -1724,7 +1720,7 @@ const builtinListFilter = resumable("List.filter", 2, (apply, args) => {
|
|
|
1724
1720
|
}
|
|
1725
1721
|
});
|
|
1726
1722
|
|
|
1727
|
-
const builtinListLength = new ExternalFunction("List.length", scheme("List.length"), (_arg, args) => (new Value(/* VInt */ 1, [toInt64_unchecked(fromInt32(length_1(expectList("List.length", args))))])), 1);
|
|
1723
|
+
const builtinListLength = new ExternalFunction(0, "List.length", scheme("List.length"), (_arg, args) => (new Value(/* VInt */ 1, [toInt64_unchecked(fromInt32(length_1(expectList("List.length", args))))])), 1);
|
|
1728
1724
|
|
|
1729
1725
|
const builtinListTryFind = resumable("List.tryFind", 2, (apply, args) => {
|
|
1730
1726
|
let matchResult, predicate, values;
|
|
@@ -1907,7 +1903,7 @@ const builtinListTryGet = resumable("List.tryGet", 2, (apply, args) => {
|
|
|
1907
1903
|
}
|
|
1908
1904
|
});
|
|
1909
1905
|
|
|
1910
|
-
const builtinListTryItem = new ExternalFunction("List.tryItem", scheme("List.tryItem"), (_arg, args) => {
|
|
1906
|
+
const builtinListTryItem = new ExternalFunction(0, "List.tryItem", scheme("List.tryItem"), (_arg, args) => {
|
|
1911
1907
|
let matchResult, index, values;
|
|
1912
1908
|
if (!isEmpty(args)) {
|
|
1913
1909
|
if (head_1(args).tag === 1) {
|
|
@@ -1966,14 +1962,14 @@ const builtinListTryItem = new ExternalFunction("List.tryItem", scheme("List.try
|
|
|
1966
1962
|
}
|
|
1967
1963
|
}, 2);
|
|
1968
1964
|
|
|
1969
|
-
const builtinListTryHead = new ExternalFunction("List.tryHead", scheme("List.tryHead"), (_arg, args) => (new Value(/* VOption */ 9, [tryHead(expectList("List.tryHead", args))])), 1);
|
|
1965
|
+
const builtinListTryHead = new ExternalFunction(0, "List.tryHead", scheme("List.tryHead"), (_arg, args) => (new Value(/* VOption */ 9, [tryHead(expectList("List.tryHead", args))])), 1);
|
|
1970
1966
|
|
|
1971
|
-
const builtinListTail = new ExternalFunction("List.tail", scheme("List.tail"), (_arg, args) => {
|
|
1967
|
+
const builtinListTail = new ExternalFunction(0, "List.tail", scheme("List.tail"), (_arg, args) => {
|
|
1972
1968
|
const matchValue = expectList("List.tail", args);
|
|
1973
1969
|
return !isEmpty(matchValue) ? (new Value(/* VList */ 5, [tail_1(matchValue)])) : fail("List.tail expects a non-empty list");
|
|
1974
1970
|
}, 1);
|
|
1975
1971
|
|
|
1976
|
-
const builtinListAppend = new ExternalFunction("List.append", scheme("List.append"), (_arg, args) => {
|
|
1972
|
+
const builtinListAppend = new ExternalFunction(0, "List.append", scheme("List.append"), (_arg, args) => {
|
|
1977
1973
|
let matchResult, left, right;
|
|
1978
1974
|
if (!isEmpty(args)) {
|
|
1979
1975
|
if (head_1(args).tag === 5) {
|
|
@@ -2011,7 +2007,7 @@ const builtinListAppend = new ExternalFunction("List.append", scheme("List.appen
|
|
|
2011
2007
|
}
|
|
2012
2008
|
}, 2);
|
|
2013
2009
|
|
|
2014
|
-
const builtinOptionDefaultValue = new ExternalFunction("Option.defaultValue", scheme("Option.defaultValue"), (_arg, args) => {
|
|
2010
|
+
const builtinOptionDefaultValue = new ExternalFunction(0, "Option.defaultValue", scheme("Option.defaultValue"), (_arg, args) => {
|
|
2015
2011
|
let matchResult, current, fallback, fallback_1;
|
|
2016
2012
|
if (!isEmpty(args)) {
|
|
2017
2013
|
if (!isEmpty(tail_1(args))) {
|
|
@@ -2098,7 +2094,7 @@ const builtinOptionDefaultWith = resumable("Option.defaultWith", 2, (apply, args
|
|
|
2098
2094
|
}
|
|
2099
2095
|
});
|
|
2100
2096
|
|
|
2101
|
-
const builtinOptionIsNone = new ExternalFunction("Option.isNone", scheme("Option.isNone"), (_arg, args) => {
|
|
2097
|
+
const builtinOptionIsNone = new ExternalFunction(0, "Option.isNone", scheme("Option.isNone"), (_arg, args) => {
|
|
2102
2098
|
let matchResult;
|
|
2103
2099
|
if (!isEmpty(args)) {
|
|
2104
2100
|
if (head_1(args).tag === 9) {
|
|
@@ -2134,7 +2130,7 @@ const builtinOptionIsNone = new ExternalFunction("Option.isNone", scheme("Option
|
|
|
2134
2130
|
}
|
|
2135
2131
|
}, 1);
|
|
2136
2132
|
|
|
2137
|
-
const builtinOptionIsSome = new ExternalFunction("Option.isSome", scheme("Option.isSome"), (_arg, args) => {
|
|
2133
|
+
const builtinOptionIsSome = new ExternalFunction(0, "Option.isSome", scheme("Option.isSome"), (_arg, args) => {
|
|
2138
2134
|
let matchResult;
|
|
2139
2135
|
if (!isEmpty(args)) {
|
|
2140
2136
|
if (head_1(args).tag === 9) {
|
|
@@ -2234,11 +2230,11 @@ const builtinOptionMap = resumable("Option.map", 2, (apply, args) => {
|
|
|
2234
2230
|
}
|
|
2235
2231
|
});
|
|
2236
2232
|
|
|
2237
|
-
const builtinMapEmpty = new ExternalFunction("Map.empty", scheme("Map.empty"), (_arg, _arg_1) => (new Value(/* VMap */ 8, [empty_1({
|
|
2233
|
+
const builtinMapEmpty = new ExternalFunction(0, "Map.empty", scheme("Map.empty"), (_arg, _arg_1) => (new Value(/* VMap */ 8, [empty_1({
|
|
2238
2234
|
Compare: (x, y) => (compare_1(x, y) | 0),
|
|
2239
2235
|
})])), 0);
|
|
2240
2236
|
|
|
2241
|
-
const builtinMapTryGet = new ExternalFunction("Map.tryGet", scheme("Map.tryGet"), (_arg, args) => {
|
|
2237
|
+
const builtinMapTryGet = new ExternalFunction(0, "Map.tryGet", scheme("Map.tryGet"), (_arg, args) => {
|
|
2242
2238
|
let matchResult, key, values;
|
|
2243
2239
|
if (!isEmpty(args)) {
|
|
2244
2240
|
if (!isEmpty(tail_1(args))) {
|
|
@@ -2271,7 +2267,7 @@ const builtinMapTryGet = new ExternalFunction("Map.tryGet", scheme("Map.tryGet")
|
|
|
2271
2267
|
}
|
|
2272
2268
|
}, 2);
|
|
2273
2269
|
|
|
2274
|
-
const builtinMapContainsKey = new ExternalFunction("Map.containsKey", scheme("Map.containsKey"), (_arg, args) => {
|
|
2270
|
+
const builtinMapContainsKey = new ExternalFunction(0, "Map.containsKey", scheme("Map.containsKey"), (_arg, args) => {
|
|
2275
2271
|
let matchResult, key, values;
|
|
2276
2272
|
if (!isEmpty(args)) {
|
|
2277
2273
|
if (!isEmpty(tail_1(args))) {
|
|
@@ -2304,7 +2300,7 @@ const builtinMapContainsKey = new ExternalFunction("Map.containsKey", scheme("Ma
|
|
|
2304
2300
|
}
|
|
2305
2301
|
}, 2);
|
|
2306
2302
|
|
|
2307
|
-
const builtinMapAdd = new ExternalFunction("Map.add", scheme("Map.add"), (_arg, args) => {
|
|
2303
|
+
const builtinMapAdd = new ExternalFunction(0, "Map.add", scheme("Map.add"), (_arg, args) => {
|
|
2308
2304
|
let matchResult, key, value, values;
|
|
2309
2305
|
if (!isEmpty(args)) {
|
|
2310
2306
|
if (!isEmpty(tail_1(args))) {
|
|
@@ -2343,7 +2339,7 @@ const builtinMapAdd = new ExternalFunction("Map.add", scheme("Map.add"), (_arg,
|
|
|
2343
2339
|
}
|
|
2344
2340
|
}, 3);
|
|
2345
2341
|
|
|
2346
|
-
const builtinMapOfList = new ExternalFunction("Map.ofList", scheme("Map.ofList"), (_arg, args) => {
|
|
2342
|
+
const builtinMapOfList = new ExternalFunction(0, "Map.ofList", scheme("Map.ofList"), (_arg, args) => {
|
|
2347
2343
|
let matchResult, pairs;
|
|
2348
2344
|
if (!isEmpty(args)) {
|
|
2349
2345
|
if (head_1(args).tag === 5) {
|
|
@@ -2538,7 +2534,7 @@ const builtinMapFold = resumable("Map.fold", 3, (apply, args) => {
|
|
|
2538
2534
|
}
|
|
2539
2535
|
});
|
|
2540
2536
|
|
|
2541
|
-
const builtinMapCount = new ExternalFunction("Map.count", scheme("Map.count"), (_arg, args) => (new Value(/* VInt */ 1, [toInt64_unchecked(fromInt32(FSharpMap__get_Count(expectMap("Map.count", args))))])), 1);
|
|
2537
|
+
const builtinMapCount = new ExternalFunction(0, "Map.count", scheme("Map.count"), (_arg, args) => (new Value(/* VInt */ 1, [toInt64_unchecked(fromInt32(FSharpMap__get_Count(expectMap("Map.count", args))))])), 1);
|
|
2542
2538
|
|
|
2543
2539
|
const builtinMapFilter = resumable("Map.filter", 2, (apply, args) => {
|
|
2544
2540
|
let matchResult, callback, values;
|
|
@@ -3166,7 +3162,7 @@ const builtinMapIter = resumable("Map.iter", 2, (apply, args) => {
|
|
|
3166
3162
|
}
|
|
3167
3163
|
});
|
|
3168
3164
|
|
|
3169
|
-
const builtinMapRemove = new ExternalFunction("Map.remove", scheme("Map.remove"), (_arg, args) => {
|
|
3165
|
+
const builtinMapRemove = new ExternalFunction(0, "Map.remove", scheme("Map.remove"), (_arg, args) => {
|
|
3170
3166
|
let matchResult, key, values;
|
|
3171
3167
|
if (!isEmpty(args)) {
|
|
3172
3168
|
if (!isEmpty(tail_1(args))) {
|
|
@@ -3199,7 +3195,7 @@ const builtinMapRemove = new ExternalFunction("Map.remove", scheme("Map.remove")
|
|
|
3199
3195
|
}
|
|
3200
3196
|
}, 2);
|
|
3201
3197
|
|
|
3202
|
-
const builtinSetExitCode = new ExternalFunction("Env.setExitCode", scheme("Env.setExitCode"), (context, _arg) => {
|
|
3198
|
+
const builtinSetExitCode = new ExternalFunction(0, "Env.setExitCode", scheme("Env.setExitCode"), (context, _arg) => {
|
|
3203
3199
|
let matchResult;
|
|
3204
3200
|
if (!isEmpty(_arg)) {
|
|
3205
3201
|
if (head_1(_arg).tag === 1) {
|
|
@@ -3225,5 +3221,21 @@ const builtinSetExitCode = new ExternalFunction("Env.setExitCode", scheme("Env.s
|
|
|
3225
3221
|
}
|
|
3226
3222
|
}, 1);
|
|
3227
3223
|
|
|
3228
|
-
|
|
3224
|
+
const supportExterns = map((tupledArg) => {
|
|
3225
|
+
const name = tupledArg[0];
|
|
3226
|
+
return resumable(name, length_1(tupledArg[2]), (apply, arguments$) => Execution_Builder__TryWith_1CEB6EA5(Execution_execution, () => invoke(valueEquals, uncurry2(apply), name, arguments$), (_arg_1) => {
|
|
3227
|
+
if (_arg_1 instanceof ArgumentException) {
|
|
3228
|
+
return new Execution$1(fail(concat(name, ": ", _arg_1.message)), defaultOf());
|
|
3229
|
+
}
|
|
3230
|
+
else if (_arg_1 instanceof OverflowException) {
|
|
3231
|
+
return new Execution$1(fail(concat(name, ": integer overflow.")), defaultOf());
|
|
3232
|
+
}
|
|
3233
|
+
else {
|
|
3234
|
+
throw _arg_1;
|
|
3235
|
+
return new Execution$1(null, null);
|
|
3236
|
+
}
|
|
3237
|
+
}));
|
|
3238
|
+
}, signatures);
|
|
3239
|
+
|
|
3240
|
+
export const builtinExterns = append(ofArray([builtinSetExitCode, builtinIgnore, builtinIntTryParse, builtinFloatTryParse, builtinBoolTryParse, builtinIntToString, builtinFloatToString, builtinBoolToString, builtinStringReplace, builtinStringIndexOf, builtinStringToLower, builtinStringToUpper, builtinStringSubstring, builtinStringConcat, builtinStringSplit, builtinStringEndsWith, builtinListEmpty, builtinListMap, builtinListIter, builtinListChoose, builtinListCollect, builtinListExists, builtinListContains, builtinListRev, builtinListDistinct, builtinListFold, builtinListFilter, builtinListLength, builtinListTryFind, builtinListTryGet, builtinListTryItem, builtinListTryHead, builtinListTail, builtinListAppend, builtinOptionDefaultValue, builtinOptionDefaultWith, builtinOptionIsNone, builtinOptionIsSome, builtinOptionMap, builtinMapEmpty, builtinMapTryGet, builtinMapContainsKey, builtinMapAdd, builtinMapOfList, builtinMapFold, builtinMapCount, builtinMapFilter, builtinMapChoose, builtinMapMap, builtinMapIter, builtinMapRemove]), supportExterns);
|
|
3229
3241
|
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
import { keys, ofList } from "../fable_modules/fable-library-js.5.
|
|
3
|
-
import { ofArray, singleton, empty } from "../fable_modules/fable-library-js.5.
|
|
2
|
+
import { keys, ofList } from "../fable_modules/fable-library-js.5.27.0/Map.js";
|
|
3
|
+
import { ofArray, singleton, empty, map, append } from "../fable_modules/fable-library-js.5.27.0/List.js";
|
|
4
|
+
import { names, signatures } from "./SupportLibrary.js";
|
|
4
5
|
import { Scheme, Type } from "./Types.js";
|
|
5
|
-
import { comparePrimitives } from "../fable_modules/fable-library-js.5.
|
|
6
|
-
import { ofSeq } from "../fable_modules/fable-library-js.5.
|
|
7
|
-
import { filter } from "../fable_modules/fable-library-js.5.
|
|
8
|
-
import { startsWith } from "../fable_modules/fable-library-js.5.
|
|
6
|
+
import { comparePrimitives } from "../fable_modules/fable-library-js.5.27.0/Util.js";
|
|
7
|
+
import { contains, ofSeq } from "../fable_modules/fable-library-js.5.27.0/Set.js";
|
|
8
|
+
import { filter } from "../fable_modules/fable-library-js.5.27.0/Seq.js";
|
|
9
|
+
import { startsWith } from "../fable_modules/fable-library-js.5.27.0/String.js";
|
|
9
10
|
|
|
10
|
-
export const builtinSchemes = ofList(ofArray([["Env.setExitCode", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TInt, Type.TUnit]))], ["ignore", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TUnit]))], ["Int.tryParse", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TInt])]))], ["Float.tryParse", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TFloat])]))], ["Bool.tryParse", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TBool])]))], ["Int.toString", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TInt, Type.TString]))], ["Float.toString", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TFloat, Type.TString]))], ["Bool.toString", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TBool, Type.TString]))], ["String.replace", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, Type.TString])])]))], ["String.indexOf", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TInt])])]))], ["String.toLower", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, Type.TString]))], ["String.toUpper", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, Type.TString]))], ["String.substring", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TInt, new Type(/* TFun */ 11, [Type.TInt, new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TString])])])]))], ["String.concat", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [new Type(/* TList */ 5, [Type.TString]), Type.TString])]))], ["String.split", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, new Type(/* TList */ 5, [Type.TString])])]))], ["String.endsWith", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, Type.TBool])]))], ["List.empty", new Scheme(singleton(0), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]))], ["List.map", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [1])]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [1])])])]))], ["List.iter", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TUnit]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), Type.TUnit])]))], ["List.choose", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [1])])]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [1])])])]))], ["List.collect", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [1])])]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [1])])])]))], ["List.exists", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), Type.TBool])]))], ["List.contains", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), Type.TBool])]))], ["List.rev", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])]))], ["List.distinct", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])]))], ["List.fold", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [1])])]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TVar */ 15, [1])])])]))], ["List.filter", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])])]))], ["List.length", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), Type.TInt]))], ["List.tryFind", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])])])]))], ["List.tryGet", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [Type.TInt])])]))], ["List.tryItem", new Scheme(singleton(0), new Type(/* TFun */ 11, [Type.TInt, new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])])])]))], ["List.tryHead", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])])]))], ["List.tail", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])]))], ["List.append", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])])]))], ["Option.defaultValue", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), new Type(/* TVar */ 15, [0])])]))], ["Option.defaultWith", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [Type.TUnit, new Type(/* TVar */ 15, [0])]), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), new Type(/* TVar */ 15, [0])])]))], ["Option.isNone", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), Type.TBool]))], ["Option.isSome", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), Type.TBool]))], ["Option.map", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [1])]), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [1])])])]))], ["Map.empty", new Scheme(ofArray([0, 1]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]))], ["Map.tryGet", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])])])]))], ["Map.containsKey", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), Type.TBool])]))], ["Map.add", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])])])]))], ["Map.ofList", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TTuple */ 7, [ofArray([new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])]))], ["Map.fold", new Scheme(ofArray([0, 1, 2]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [2]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [2])])])]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [2]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TVar */ 15, [2])])])]))], ["Map.count", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), Type.TInt]))], ["Map.filter", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool])]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])])]))], ["Map.choose", new Scheme(ofArray([0, 1, 2]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [2])])])]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [2])])])]))], ["Map.map", new Scheme(ofArray([0, 1, 2]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [2])]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [2])])])]))], ["Map.iter", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TUnit])]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), Type.TUnit])]))], ["Map.remove", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])])]))]]), {
|
|
11
|
+
export const builtinSchemes = ofList(append(map((tupledArg) => [tupledArg[0], tupledArg[1]], signatures), ofArray([["Env.setExitCode", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TInt, Type.TUnit]))], ["ignore", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TUnit]))], ["Int.tryParse", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TInt])]))], ["Float.tryParse", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TFloat])]))], ["Bool.tryParse", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TBool])]))], ["Int.toString", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TInt, Type.TString]))], ["Float.toString", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TFloat, Type.TString]))], ["Bool.toString", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TBool, Type.TString]))], ["String.replace", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, Type.TString])])]))], ["String.indexOf", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TInt])])]))], ["String.toLower", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, Type.TString]))], ["String.toUpper", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, Type.TString]))], ["String.substring", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TInt, new Type(/* TFun */ 11, [Type.TInt, new Type(/* TFun */ 11, [Type.TString, new Type(/* TOption */ 10, [Type.TString])])])]))], ["String.concat", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [new Type(/* TList */ 5, [Type.TString]), Type.TString])]))], ["String.split", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, new Type(/* TList */ 5, [Type.TString])])]))], ["String.endsWith", new Scheme(empty(), new Type(/* TFun */ 11, [Type.TString, new Type(/* TFun */ 11, [Type.TString, Type.TBool])]))], ["List.empty", new Scheme(singleton(0), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]))], ["List.map", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [1])]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [1])])])]))], ["List.iter", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TUnit]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), Type.TUnit])]))], ["List.choose", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [1])])]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [1])])])]))], ["List.collect", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [1])])]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [1])])])]))], ["List.exists", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), Type.TBool])]))], ["List.contains", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), Type.TBool])]))], ["List.rev", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])]))], ["List.distinct", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])]))], ["List.fold", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [1])])]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TVar */ 15, [1])])])]))], ["List.filter", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])])]))], ["List.length", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), Type.TInt]))], ["List.tryFind", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])])])]))], ["List.tryGet", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [Type.TInt])])]))], ["List.tryItem", new Scheme(singleton(0), new Type(/* TFun */ 11, [Type.TInt, new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])])])]))], ["List.tryHead", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])])]))], ["List.tail", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])]))], ["List.append", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])]), new Type(/* TList */ 5, [new Type(/* TVar */ 15, [0])])])]))], ["Option.defaultValue", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), new Type(/* TVar */ 15, [0])])]))], ["Option.defaultWith", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [Type.TUnit, new Type(/* TVar */ 15, [0])]), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), new Type(/* TVar */ 15, [0])])]))], ["Option.isNone", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), Type.TBool]))], ["Option.isSome", new Scheme(singleton(0), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), Type.TBool]))], ["Option.map", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [1])]), new Type(/* TFun */ 11, [new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [1])])])]))], ["Map.empty", new Scheme(ofArray([0, 1]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]))], ["Map.tryGet", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [0])])])]))], ["Map.containsKey", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), Type.TBool])]))], ["Map.add", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])])])]))], ["Map.ofList", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TList */ 5, [new Type(/* TTuple */ 7, [ofArray([new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])]))], ["Map.fold", new Scheme(ofArray([0, 1, 2]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [2]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [2])])])]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [2]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TVar */ 15, [2])])])]))], ["Map.count", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), Type.TInt]))], ["Map.filter", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TBool])]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])])]))], ["Map.choose", new Scheme(ofArray([0, 1, 2]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TOption */ 10, [new Type(/* TVar */ 15, [2])])])]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [2])])])]))], ["Map.map", new Scheme(ofArray([0, 1, 2]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), new Type(/* TVar */ 15, [2])]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [2])])])]))], ["Map.iter", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [0]), Type.TUnit])]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), Type.TUnit])]))], ["Map.remove", new Scheme(ofArray([0, 1]), new Type(/* TFun */ 11, [new Type(/* TVar */ 15, [1]), new Type(/* TFun */ 11, [new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])]), new Type(/* TMap */ 9, [new Type(/* TVar */ 15, [1]), new Type(/* TVar */ 15, [0])])])]))]])), {
|
|
11
12
|
Compare: (x, y) => (comparePrimitives(x, y) | 0),
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
export const builtinReservedNames = ofSeq(filter((name) => {
|
|
15
|
-
if (((name === "Env.setExitCode") ? true : startsWith(name, "List.", 4)) ? true : startsWith(name, "Option.", 4)) {
|
|
16
|
+
if (((contains(name, names) ? true : (name === "Env.setExitCode")) ? true : startsWith(name, "List.", 4)) ? true : startsWith(name, "Option.", 4)) {
|
|
16
17
|
return true;
|
|
17
18
|
}
|
|
18
19
|
else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { Span, Position } from "./Span.js";
|
|
3
3
|
import { TypeDef, TypeRef } from "./Ast.js";
|
|
4
|
-
import { empty, ofArray } from "../fable_modules/fable-library-js.5.
|
|
4
|
+
import { empty, ofArray } from "../fable_modules/fable-library-js.5.27.0/List.js";
|
|
5
5
|
|
|
6
6
|
const unknownSpan = new Span(new Position(undefined, 0, 0), new Position(undefined, 0, 0));
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { FSharpException, Record } from "../fable_modules/fable-library-js.5.
|
|
3
|
-
import { class_type, record_type, string_type } from "../fable_modules/fable-library-js.5.
|
|
2
|
+
import { FSharpException, Record } from "../fable_modules/fable-library-js.5.27.0/Types.js";
|
|
3
|
+
import { class_type, record_type, string_type } from "../fable_modules/fable-library-js.5.27.0/Reflection.js";
|
|
4
4
|
import { Span_$reflection } from "./Span.js";
|
|
5
5
|
|
|
6
6
|
export class ParseError extends Record {
|