@magnusopera/fscript 0.83.2 → 0.84.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 +10 -0
- package/dist/FScript.Language/Ast.js +82 -5
- package/dist/FScript.Language/BuiltinFunctions.js +28 -2
- package/dist/FScript.Language/BuiltinSignatures.js +3 -3
- package/dist/FScript.Language/BuiltinTypes.js +2 -2
- package/dist/FScript.Language/Eval.js +534 -253
- package/dist/FScript.Language/ExportSignatures.js +136 -0
- package/dist/FScript.Language/IncludeResolver.js +56 -35
- package/dist/FScript.Language/Interactive.js +7 -3
- package/dist/FScript.Language/Lexer.js +7 -3
- package/dist/FScript.Language/Library.js +5 -1
- package/dist/FScript.Language/Parser.js +296 -159
- package/dist/FScript.Language/TypeInfer.js +2542 -289
- package/dist/FScript.Language/Types.js +23 -1
- package/dist/FScript.Language/Value.js +3 -2
- package/dist/Library.js +1087 -102
- package/dist/fable_modules/project_cracked.json +1 -1
- package/examples/hosting.mjs +36 -0
- package/package.json +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import { Record, Union } from "../fable_modules/fable-library-js.5.13.0/Types.js";
|
|
3
3
|
import { record_type, union_type, bool_type, int32_type, option_type, class_type, string_type, list_type } from "../fable_modules/fable-library-js.5.13.0/Reflection.js";
|
|
4
|
-
import { comparePrimitives, Exception } from "../fable_modules/fable-library-js.5.13.0/Util.js";
|
|
5
4
|
import { toList, isEmpty, ofList, difference, singleton, add, union, empty } from "../fable_modules/fable-library-js.5.13.0/Set.js";
|
|
5
|
+
import { Exception, comparePrimitives } from "../fable_modules/fable-library-js.5.13.0/Util.js";
|
|
6
6
|
import { empty as empty_1, fold, map } from "../fable_modules/fable-library-js.5.13.0/List.js";
|
|
7
7
|
import { fold as fold_1, map as map_1 } from "../fable_modules/fable-library-js.5.13.0/Seq.js";
|
|
8
8
|
import { toList as toList_1, values } from "../fable_modules/fable-library-js.5.13.0/Map.js";
|
|
@@ -72,6 +72,28 @@ export function Scheme_$reflection() {
|
|
|
72
72
|
return union_type("FScript.Language.Scheme", [], Scheme, () => [[["Item1", list_type(int32_type)], ["Item2", Type_$reflection()]]]);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Trusted host contracts. Function purity includes deterministic, effect-free,
|
|
77
|
+
* successful termination; type purity means deeply immutable values and payloads.
|
|
78
|
+
*/
|
|
79
|
+
export class PurityContracts extends Record {
|
|
80
|
+
constructor(PureFunctions, PureTypes) {
|
|
81
|
+
super();
|
|
82
|
+
this.PureFunctions = PureFunctions;
|
|
83
|
+
this.PureTypes = PureTypes;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function PurityContracts_$reflection() {
|
|
88
|
+
return record_type("FScript.Language.PurityContracts", [], PurityContracts, () => [["PureFunctions", class_type("Microsoft.FSharp.Collections.FSharpSet`1", [string_type])], ["PureTypes", class_type("Microsoft.FSharp.Collections.FSharpSet`1", [string_type])]]);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const PurityContractsModule_empty = new PurityContracts(empty({
|
|
92
|
+
Compare: (x, y) => (comparePrimitives(x, y) | 0),
|
|
93
|
+
}), empty({
|
|
94
|
+
Compare: (x_1, y_1) => (comparePrimitives(x_1, y_1) | 0),
|
|
95
|
+
}));
|
|
96
|
+
|
|
75
97
|
let Types_nextId = 0;
|
|
76
98
|
|
|
77
99
|
export function Types_freshVar() {
|
|
@@ -76,7 +76,7 @@ export function TaskHandle_$reflection() {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
export class ExternalCallContext extends Record {
|
|
79
|
-
constructor(Session, IsActive, Apply, SpawnTask, AwaitTask, CheckRuntime) {
|
|
79
|
+
constructor(Session, IsActive, Apply, SpawnTask, AwaitTask, CheckRuntime, SetExitCode) {
|
|
80
80
|
super();
|
|
81
81
|
this.Session = Session;
|
|
82
82
|
this.IsActive = IsActive;
|
|
@@ -84,11 +84,12 @@ export class ExternalCallContext extends Record {
|
|
|
84
84
|
this.SpawnTask = SpawnTask;
|
|
85
85
|
this.AwaitTask = AwaitTask;
|
|
86
86
|
this.CheckRuntime = CheckRuntime;
|
|
87
|
+
this.SetExitCode = SetExitCode;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
export function ExternalCallContext_$reflection() {
|
|
91
|
-
return record_type("FScript.Language.ExternalCallContext", [], ExternalCallContext, () => [["Session", obj_type], ["IsActive", lambda_type(unit_type, bool_type)], ["Apply", lambda_type(Value_$reflection(), lambda_type(Value_$reflection(), Value_$reflection()))], ["SpawnTask", lambda_type(Value_$reflection(), Value_$reflection())], ["AwaitTask", lambda_type(Value_$reflection(), Value_$reflection())], ["CheckRuntime", lambda_type(unit_type, unit_type)]]);
|
|
92
|
+
return record_type("FScript.Language.ExternalCallContext", [], ExternalCallContext, () => [["Session", obj_type], ["IsActive", lambda_type(unit_type, bool_type)], ["Apply", lambda_type(Value_$reflection(), lambda_type(Value_$reflection(), Value_$reflection()))], ["SpawnTask", lambda_type(Value_$reflection(), Value_$reflection())], ["AwaitTask", lambda_type(Value_$reflection(), Value_$reflection())], ["CheckRuntime", lambda_type(unit_type, unit_type)], ["SetExitCode", lambda_type(int32_type, unit_type)]]);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
export class ExternalFunction extends Record {
|