@magnusopera/fscript 0.87.1 → 0.88.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.
@@ -3,11 +3,11 @@ import { Span, Position } from "./Span.js";
3
3
  import { EvalException, EvalError$ } from "./Error.js";
4
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.24.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.24.0/Util.js";
6
+ import { uncurry2, compare as compare_1, equals as equals_1, curry2, defaultOf, Exception } from "../fable_modules/fable-library-js.5.24.0/Util.js";
7
7
  import { endsWith, split, join, substring, indexOf, replace, format, concat } from "../fable_modules/fable-library-js.5.24.0/String.js";
8
8
  import { FSharpRef, Record } from "../fable_modules/fable-library-js.5.24.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";
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
11
  import { record_type, list_type, lambda_type } from "../fable_modules/fable-library-js.5.24.0/Reflection.js";
12
12
  import { Dictionary } from "../fable_modules/fable-library-js.5.24.0/MutableMap.js";
13
13
  import { HashIdentity_Reference } from "../fable_modules/fable-library-js.5.24.0/FSharp.Collections.js";
@@ -20,6 +20,9 @@ import { exists } from "../fable_modules/fable-library-js.5.24.0/Seq.js";
20
20
  import { some, toArray } from "../fable_modules/fable-library-js.5.24.0/Option.js";
21
21
  import { $007CRecordFields$007C_$007C } from "./HostInterop.js";
22
22
  import { tryParse as tryParse_2 } from "../fable_modules/fable-library-js.5.24.0/Boolean.js";
23
+ import { invoke } from "./SupportCollections.js";
24
+ import { OverflowException, ArgumentException } from "../fable_modules/fable-library-js.5.24.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
 
@@ -3225,5 +3228,21 @@ const builtinSetExitCode = new ExternalFunction("Env.setExitCode", scheme("Env.s
3225
3228
  }
3226
3229
  }, 1);
3227
3230
 
3228
- export const builtinExterns = 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]);
3231
+ const supportExterns = map((tupledArg) => {
3232
+ const name = tupledArg[0];
3233
+ return resumable(name, length_1(tupledArg[2]), (apply, arguments$) => Execution_Builder__TryWith_1CEB6EA5(Execution_execution, () => invoke(valueEquals, uncurry2(apply), name, arguments$), (_arg_1) => {
3234
+ if (_arg_1 instanceof ArgumentException) {
3235
+ return new Execution$1(fail(concat(name, ": ", _arg_1.message)), defaultOf());
3236
+ }
3237
+ else if (_arg_1 instanceof OverflowException) {
3238
+ return new Execution$1(fail(concat(name, ": integer overflow.")), defaultOf());
3239
+ }
3240
+ else {
3241
+ throw _arg_1;
3242
+ return new Execution$1(null, null);
3243
+ }
3244
+ }));
3245
+ }, signatures);
3246
+
3247
+ 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
3248
 
@@ -1,18 +1,19 @@
1
1
 
2
2
  import { keys, ofList } from "../fable_modules/fable-library-js.5.24.0/Map.js";
3
- import { ofArray, singleton, empty } from "../fable_modules/fable-library-js.5.24.0/List.js";
3
+ import { ofArray, singleton, empty, map, append } from "../fable_modules/fable-library-js.5.24.0/List.js";
4
+ import { names, signatures } from "./SupportLibrary.js";
4
5
  import { Scheme, Type } from "./Types.js";
5
6
  import { comparePrimitives } from "../fable_modules/fable-library-js.5.24.0/Util.js";
6
- import { ofSeq } from "../fable_modules/fable-library-js.5.24.0/Set.js";
7
+ import { contains, ofSeq } from "../fable_modules/fable-library-js.5.24.0/Set.js";
7
8
  import { filter } from "../fable_modules/fable-library-js.5.24.0/Seq.js";
8
9
  import { startsWith } from "../fable_modules/fable-library-js.5.24.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 {