compostjs 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/fable_modules/fable-library-js.4.28.0/Array.d.ts +123 -0
  2. package/dist/fable_modules/fable-library-js.4.28.0/Array.js +1242 -0
  3. package/dist/fable_modules/fable-library-js.4.28.0/Async.d.ts +26 -0
  4. package/dist/fable_modules/fable-library-js.4.28.0/Async.js +145 -0
  5. package/dist/fable_modules/fable-library-js.4.28.0/AsyncBuilder.d.ts +59 -0
  6. package/dist/fable_modules/fable-library-js.4.28.0/AsyncBuilder.js +183 -0
  7. package/dist/fable_modules/fable-library-js.4.28.0/BigInt.d.ts +115 -0
  8. package/dist/fable_modules/fable-library-js.4.28.0/BigInt.js +283 -0
  9. package/dist/fable_modules/fable-library-js.4.28.0/BitConverter.d.ts +27 -0
  10. package/dist/fable_modules/fable-library-js.4.28.0/BitConverter.js +138 -0
  11. package/dist/fable_modules/fable-library-js.4.28.0/Boolean.d.ts +3 -0
  12. package/dist/fable_modules/fable-library-js.4.28.0/Boolean.js +21 -0
  13. package/dist/fable_modules/fable-library-js.4.28.0/CHANGELOG.md +100 -0
  14. package/dist/fable_modules/fable-library-js.4.28.0/Char.d.ts +65 -0
  15. package/dist/fable_modules/fable-library-js.4.28.0/Char.js +169 -0
  16. package/dist/fable_modules/fable-library-js.4.28.0/Choice.d.ts +121 -0
  17. package/dist/fable_modules/fable-library-js.4.28.0/Choice.js +184 -0
  18. package/dist/fable_modules/fable-library-js.4.28.0/CollectionUtil.d.ts +7 -0
  19. package/dist/fable_modules/fable-library-js.4.28.0/CollectionUtil.js +182 -0
  20. package/dist/fable_modules/fable-library-js.4.28.0/ConditionalWeakTable.d.ts +9 -0
  21. package/dist/fable_modules/fable-library-js.4.28.0/ConditionalWeakTable.js +21 -0
  22. package/dist/fable_modules/fable-library-js.4.28.0/Date.d.ts +70 -0
  23. package/dist/fable_modules/fable-library-js.4.28.0/Date.js +748 -0
  24. package/dist/fable_modules/fable-library-js.4.28.0/DateOffset.d.ts +63 -0
  25. package/dist/fable_modules/fable-library-js.4.28.0/DateOffset.js +268 -0
  26. package/dist/fable_modules/fable-library-js.4.28.0/DateOnly.d.ts +18 -0
  27. package/dist/fable_modules/fable-library-js.4.28.0/DateOnly.js +124 -0
  28. package/dist/fable_modules/fable-library-js.4.28.0/Decimal.d.ts +45 -0
  29. package/dist/fable_modules/fable-library-js.4.28.0/Decimal.js +212 -0
  30. package/dist/fable_modules/fable-library-js.4.28.0/Double.d.ts +11 -0
  31. package/dist/fable_modules/fable-library-js.4.28.0/Double.js +46 -0
  32. package/dist/fable_modules/fable-library-js.4.28.0/Encoding.d.ts +12 -0
  33. package/dist/fable_modules/fable-library-js.4.28.0/Encoding.js +173 -0
  34. package/dist/fable_modules/fable-library-js.4.28.0/Event.d.ts +31 -0
  35. package/dist/fable_modules/fable-library-js.4.28.0/Event.js +93 -0
  36. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Collections.d.ts +7 -0
  37. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Collections.js +27 -0
  38. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Core.CompilerServices.d.ts +12 -0
  39. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Core.CompilerServices.js +27 -0
  40. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Core.d.ts +17 -0
  41. package/dist/fable_modules/fable-library-js.4.28.0/FSharp.Core.js +69 -0
  42. package/dist/fable_modules/fable-library-js.4.28.0/Global.d.ts +24 -0
  43. package/dist/fable_modules/fable-library-js.4.28.0/Global.js +8 -0
  44. package/dist/fable_modules/fable-library-js.4.28.0/Guid.d.ts +10 -0
  45. package/dist/fable_modules/fable-library-js.4.28.0/Guid.js +142 -0
  46. package/dist/fable_modules/fable-library-js.4.28.0/Int32.d.ts +28 -0
  47. package/dist/fable_modules/fable-library-js.4.28.0/Int32.js +135 -0
  48. package/dist/fable_modules/fable-library-js.4.28.0/List.d.ts +143 -0
  49. package/dist/fable_modules/fable-library-js.4.28.0/List.js +1273 -0
  50. package/dist/fable_modules/fable-library-js.4.28.0/Long.d.ts +3 -0
  51. package/dist/fable_modules/fable-library-js.4.28.0/Long.js +46 -0
  52. package/dist/fable_modules/fable-library-js.4.28.0/MailboxProcessor.d.ts +25 -0
  53. package/dist/fable_modules/fable-library-js.4.28.0/MailboxProcessor.js +93 -0
  54. package/dist/fable_modules/fable-library-js.4.28.0/Map.d.ts +178 -0
  55. package/dist/fable_modules/fable-library-js.4.28.0/Map.js +1396 -0
  56. package/dist/fable_modules/fable-library-js.4.28.0/MapUtil.d.ts +12 -0
  57. package/dist/fable_modules/fable-library-js.4.28.0/MapUtil.js +127 -0
  58. package/dist/fable_modules/fable-library-js.4.28.0/MutableMap.d.ts +52 -0
  59. package/dist/fable_modules/fable-library-js.4.28.0/MutableMap.js +327 -0
  60. package/dist/fable_modules/fable-library-js.4.28.0/MutableSet.d.ts +39 -0
  61. package/dist/fable_modules/fable-library-js.4.28.0/MutableSet.js +233 -0
  62. package/dist/fable_modules/fable-library-js.4.28.0/Native.d.ts +2 -0
  63. package/dist/fable_modules/fable-library-js.4.28.0/Native.js +8 -0
  64. package/dist/fable_modules/fable-library-js.4.28.0/Numeric.d.ts +19 -0
  65. package/dist/fable_modules/fable-library-js.4.28.0/Numeric.js +71 -0
  66. package/dist/fable_modules/fable-library-js.4.28.0/Observable.d.ts +32 -0
  67. package/dist/fable_modules/fable-library-js.4.28.0/Observable.js +113 -0
  68. package/dist/fable_modules/fable-library-js.4.28.0/Option.d.ts +28 -0
  69. package/dist/fable_modules/fable-library-js.4.28.0/Option.js +96 -0
  70. package/dist/fable_modules/fable-library-js.4.28.0/README.md +3 -0
  71. package/dist/fable_modules/fable-library-js.4.28.0/Random.d.ts +37 -0
  72. package/dist/fable_modules/fable-library-js.4.28.0/Random.js +170 -0
  73. package/dist/fable_modules/fable-library-js.4.28.0/Range.d.ts +12 -0
  74. package/dist/fable_modules/fable-library-js.4.28.0/Range.js +45 -0
  75. package/dist/fable_modules/fable-library-js.4.28.0/Reflection.d.ts +119 -0
  76. package/dist/fable_modules/fable-library-js.4.28.0/Reflection.js +461 -0
  77. package/dist/fable_modules/fable-library-js.4.28.0/RegExp.d.ts +10 -0
  78. package/dist/fable_modules/fable-library-js.4.28.0/RegExp.js +131 -0
  79. package/dist/fable_modules/fable-library-js.4.28.0/Result.d.ts +37 -0
  80. package/dist/fable_modules/fable-library-js.4.28.0/Result.js +165 -0
  81. package/dist/fable_modules/fable-library-js.4.28.0/Seq.d.ts +165 -0
  82. package/dist/fable_modules/fable-library-js.4.28.0/Seq.js +1378 -0
  83. package/dist/fable_modules/fable-library-js.4.28.0/Seq2.d.ts +18 -0
  84. package/dist/fable_modules/fable-library-js.4.28.0/Seq2.js +111 -0
  85. package/dist/fable_modules/fable-library-js.4.28.0/Set.d.ts +190 -0
  86. package/dist/fable_modules/fable-library-js.4.28.0/Set.js +1789 -0
  87. package/dist/fable_modules/fable-library-js.4.28.0/String.d.ts +58 -0
  88. package/dist/fable_modules/fable-library-js.4.28.0/String.js +554 -0
  89. package/dist/fable_modules/fable-library-js.4.28.0/System.Collections.Generic.d.ts +79 -0
  90. package/dist/fable_modules/fable-library-js.4.28.0/System.Collections.Generic.js +317 -0
  91. package/dist/fable_modules/fable-library-js.4.28.0/System.Text.d.ts +38 -0
  92. package/dist/fable_modules/fable-library-js.4.28.0/System.Text.js +162 -0
  93. package/dist/fable_modules/fable-library-js.4.28.0/SystemException.d.ts +5 -0
  94. package/dist/fable_modules/fable-library-js.4.28.0/SystemException.js +5 -0
  95. package/dist/fable_modules/fable-library-js.4.28.0/TimeOnly.d.ts +15 -0
  96. package/dist/fable_modules/fable-library-js.4.28.0/TimeOnly.js +122 -0
  97. package/dist/fable_modules/fable-library-js.4.28.0/TimeSpan.d.ts +34 -0
  98. package/dist/fable_modules/fable-library-js.4.28.0/TimeSpan.js +177 -0
  99. package/dist/fable_modules/fable-library-js.4.28.0/Timer.d.ts +19 -0
  100. package/dist/fable_modules/fable-library-js.4.28.0/Timer.js +67 -0
  101. package/dist/fable_modules/fable-library-js.4.28.0/Types.d.ts +58 -0
  102. package/dist/fable_modules/fable-library-js.4.28.0/Types.js +208 -0
  103. package/dist/fable_modules/fable-library-js.4.28.0/Unicode.13.0.0.d.ts +2 -0
  104. package/dist/fable_modules/fable-library-js.4.28.0/Unicode.13.0.0.js +4 -0
  105. package/dist/fable_modules/fable-library-js.4.28.0/Uri.d.ts +31 -0
  106. package/dist/fable_modules/fable-library-js.4.28.0/Uri.js +159 -0
  107. package/dist/fable_modules/fable-library-js.4.28.0/Util.d.ts +210 -0
  108. package/dist/fable_modules/fable-library-js.4.28.0/Util.js +769 -0
  109. package/dist/fable_modules/fable-library-js.4.28.0/big.d.ts +338 -0
  110. package/dist/fable_modules/fable-library-js.4.28.0/lib/big.d.ts +5 -0
  111. package/dist/fable_modules/fable-library-js.4.28.0/lib/big.js +825 -0
  112. package/dist/fable_modules/fable-library-js.4.28.0/package.json +24 -0
  113. package/dist/fable_modules/project_cracked.json +1 -0
  114. package/package.json +4 -3
  115. package/.claude/settings.local.json +0 -11
  116. package/copy-latest.sh +0 -1
  117. package/dist/fable-library.2.10.1/Array.js +0 -1336
  118. package/dist/fable-library.2.10.1/Async.js +0 -121
  119. package/dist/fable-library.2.10.1/AsyncBuilder.js +0 -200
  120. package/dist/fable-library.2.10.1/Date.js +0 -501
  121. package/dist/fable-library.2.10.1/Decimal.js +0 -208
  122. package/dist/fable-library.2.10.1/Event.js +0 -193
  123. package/dist/fable-library.2.10.1/Int32.js +0 -157
  124. package/dist/fable-library.2.10.1/List.js +0 -1234
  125. package/dist/fable-library.2.10.1/Long.js +0 -155
  126. package/dist/fable-library.2.10.1/Map.js +0 -1292
  127. package/dist/fable-library.2.10.1/MutableMap.js +0 -360
  128. package/dist/fable-library.2.10.1/MutableSet.js +0 -279
  129. package/dist/fable-library.2.10.1/Observable.js +0 -131
  130. package/dist/fable-library.2.10.1/Option.js +0 -118
  131. package/dist/fable-library.2.10.1/Reflection.js +0 -345
  132. package/dist/fable-library.2.10.1/RegExp.js +0 -118
  133. package/dist/fable-library.2.10.1/Seq.js +0 -917
  134. package/dist/fable-library.2.10.1/Set.js +0 -1692
  135. package/dist/fable-library.2.10.1/String.js +0 -679
  136. package/dist/fable-library.2.10.1/Types.js +0 -308
  137. package/dist/fable-library.2.10.1/Util.js +0 -761
  138. package/dist/helpers.js +0 -31
  139. package/dist/lib/big.js +0 -905
  140. package/dist/lib/long.js +0 -1375
  141. package/index.html +0 -49
@@ -1,1292 +0,0 @@
1
- import { Record, List, declare, Union } from "./Types";
2
- import { class_type, record_type, bool_type, list_type, union_type, int32_type } from "./Reflection";
3
- import { value as value$$3, some } from "./Option";
4
- import { iterate as iterate$$1, empty as empty$$1, toIterator, map as map$$2, unfold, getEnumerator, fold as fold$$1 } from "./Seq";
5
- import { compare, structuralHash, isDisposable } from "./Util";
6
- import { join, format } from "./String";
7
- import { MutableMap$00602$$$$002Ector$$6623D9B3 as MutableMap$002400602$0024$0024$0024$0024002Ector$0024$00246623D9B3 } from "./MutableMap";
8
- export const MapTree$00602 = declare(function Map_MapTree(tag, name, ...fields) {
9
- this.tag = tag | 0;
10
- this.name = name;
11
- this.fields = fields;
12
- }, Union);
13
- export function MapTree$00602$reflection($gen$$3, $gen$$4) {
14
- return union_type("Map.MapTree`2", [$gen$$3, $gen$$4], MapTree$00602, () => ["MapEmpty", ["MapOne", [["Item1", $gen$$3], ["Item2", $gen$$4]]], ["MapNode", [["Item1", $gen$$3], ["Item2", $gen$$4], ["Item3", MapTree$00602$reflection($gen$$3, $gen$$4)], ["Item4", MapTree$00602$reflection($gen$$3, $gen$$4)], ["Item5", int32_type]]]]);
15
- }
16
- export function MapTreeModule$$$sizeAux($acc$$5, $m$$6) {
17
- MapTreeModule$$$sizeAux: while (true) {
18
- const acc = $acc$$5,
19
- m = $m$$6;
20
-
21
- switch (m.tag) {
22
- case 1:
23
- {
24
- return acc + 1 | 0;
25
- }
26
-
27
- case 2:
28
- {
29
- $acc$$5 = MapTreeModule$$$sizeAux(acc + 1, m.fields[2]);
30
- $m$$6 = m.fields[3];
31
- continue MapTreeModule$$$sizeAux;
32
- }
33
-
34
- default:
35
- {
36
- return acc | 0;
37
- }
38
- }
39
-
40
- break;
41
- }
42
- }
43
- export function MapTreeModule$$$size(x) {
44
- return MapTreeModule$$$sizeAux(0, x);
45
- }
46
- export function MapTreeModule$$$empty() {
47
- return new MapTree$00602(0, "MapEmpty");
48
- }
49
- export function MapTreeModule$$$height(_arg1) {
50
- switch (_arg1.tag) {
51
- case 1:
52
- {
53
- return 1;
54
- }
55
-
56
- case 2:
57
- {
58
- return _arg1.fields[4] | 0;
59
- }
60
-
61
- default:
62
- {
63
- return 0;
64
- }
65
- }
66
- }
67
- export function MapTreeModule$$$isEmpty(m$$1) {
68
- if (m$$1.tag === 0) {
69
- return true;
70
- } else {
71
- return false;
72
- }
73
- }
74
- export function MapTreeModule$$$mk(l$$1, k, v, r$$1) {
75
- var $target$$14;
76
-
77
- if (l$$1.tag === 0) {
78
- if (r$$1.tag === 0) {
79
- $target$$14 = 0;
80
- } else {
81
- $target$$14 = 1;
82
- }
83
- } else {
84
- $target$$14 = 1;
85
- }
86
-
87
- switch ($target$$14) {
88
- case 0:
89
- {
90
- return new MapTree$00602(1, "MapOne", k, v);
91
- }
92
-
93
- case 1:
94
- {
95
- const hl = MapTreeModule$$$height(l$$1) | 0;
96
- const hr = MapTreeModule$$$height(r$$1) | 0;
97
- const m$$2 = (hl < hr ? hr : hl) | 0;
98
- return new MapTree$00602(2, "MapNode", k, v, l$$1, r$$1, m$$2 + 1);
99
- }
100
- }
101
- }
102
- export function MapTreeModule$$$rebalance(t1, k$$1, v$$1, t2) {
103
- const t1h = MapTreeModule$$$height(t1) | 0;
104
- const t2h = MapTreeModule$$$height(t2) | 0;
105
-
106
- if (t2h > t1h + 2) {
107
- if (t2.tag === 2) {
108
- if (MapTreeModule$$$height(t2.fields[2]) > t1h + 1) {
109
- if (t2.fields[2].tag === 2) {
110
- return MapTreeModule$$$mk(MapTreeModule$$$mk(t1, k$$1, v$$1, t2.fields[2].fields[2]), t2.fields[2].fields[0], t2.fields[2].fields[1], MapTreeModule$$$mk(t2.fields[2].fields[3], t2.fields[0], t2.fields[1], t2.fields[3]));
111
- } else {
112
- throw new Error("rebalance");
113
- }
114
- } else {
115
- return MapTreeModule$$$mk(MapTreeModule$$$mk(t1, k$$1, v$$1, t2.fields[2]), t2.fields[0], t2.fields[1], t2.fields[3]);
116
- }
117
- } else {
118
- throw new Error("rebalance");
119
- }
120
- } else if (t1h > t2h + 2) {
121
- if (t1.tag === 2) {
122
- if (MapTreeModule$$$height(t1.fields[3]) > t2h + 1) {
123
- if (t1.fields[3].tag === 2) {
124
- return MapTreeModule$$$mk(MapTreeModule$$$mk(t1.fields[2], t1.fields[0], t1.fields[1], t1.fields[3].fields[2]), t1.fields[3].fields[0], t1.fields[3].fields[1], MapTreeModule$$$mk(t1.fields[3].fields[3], k$$1, v$$1, t2));
125
- } else {
126
- throw new Error("re balance");
127
- }
128
- } else {
129
- return MapTreeModule$$$mk(t1.fields[2], t1.fields[0], t1.fields[1], MapTreeModule$$$mk(t1.fields[3], k$$1, v$$1, t2));
130
- }
131
- } else {
132
- throw new Error("rebalance");
133
- }
134
- } else {
135
- return MapTreeModule$$$mk(t1, k$$1, v$$1, t2);
136
- }
137
- }
138
- export function MapTreeModule$$$add(comparer, k$$2, v$$2, m$$3) {
139
- switch (m$$3.tag) {
140
- case 1:
141
- {
142
- const c = comparer.Compare(k$$2, m$$3.fields[0]) | 0;
143
-
144
- if (c < 0) {
145
- return new MapTree$00602(2, "MapNode", k$$2, v$$2, new MapTree$00602(0, "MapEmpty"), m$$3, 2);
146
- } else if (c === 0) {
147
- return new MapTree$00602(1, "MapOne", k$$2, v$$2);
148
- } else {
149
- return new MapTree$00602(2, "MapNode", k$$2, v$$2, m$$3, new MapTree$00602(0, "MapEmpty"), 2);
150
- }
151
- }
152
-
153
- case 2:
154
- {
155
- const c$$1 = comparer.Compare(k$$2, m$$3.fields[0]) | 0;
156
-
157
- if (c$$1 < 0) {
158
- return MapTreeModule$$$rebalance(MapTreeModule$$$add(comparer, k$$2, v$$2, m$$3.fields[2]), m$$3.fields[0], m$$3.fields[1], m$$3.fields[3]);
159
- } else if (c$$1 === 0) {
160
- return new MapTree$00602(2, "MapNode", k$$2, v$$2, m$$3.fields[2], m$$3.fields[3], m$$3.fields[4]);
161
- } else {
162
- return MapTreeModule$$$rebalance(m$$3.fields[2], m$$3.fields[0], m$$3.fields[1], MapTreeModule$$$add(comparer, k$$2, v$$2, m$$3.fields[3]));
163
- }
164
- }
165
-
166
- default:
167
- {
168
- return new MapTree$00602(1, "MapOne", k$$2, v$$2);
169
- }
170
- }
171
- }
172
- export function MapTreeModule$$$find($comparer$$1$$23, $k$$3$$24, $m$$4$$25) {
173
- MapTreeModule$$$find: while (true) {
174
- const comparer$$1 = $comparer$$1$$23,
175
- k$$3 = $k$$3$$24,
176
- m$$4 = $m$$4$$25;
177
-
178
- switch (m$$4.tag) {
179
- case 1:
180
- {
181
- const c$$2 = comparer$$1.Compare(k$$3, m$$4.fields[0]) | 0;
182
-
183
- if (c$$2 === 0) {
184
- return m$$4.fields[1];
185
- } else {
186
- throw new Error("key not found");
187
- }
188
- }
189
-
190
- case 2:
191
- {
192
- const c$$3 = comparer$$1.Compare(k$$3, m$$4.fields[0]) | 0;
193
-
194
- if (c$$3 < 0) {
195
- $comparer$$1$$23 = comparer$$1;
196
- $k$$3$$24 = k$$3;
197
- $m$$4$$25 = m$$4.fields[2];
198
- continue MapTreeModule$$$find;
199
- } else if (c$$3 === 0) {
200
- return m$$4.fields[1];
201
- } else {
202
- $comparer$$1$$23 = comparer$$1;
203
- $k$$3$$24 = k$$3;
204
- $m$$4$$25 = m$$4.fields[3];
205
- continue MapTreeModule$$$find;
206
- }
207
- }
208
-
209
- default:
210
- {
211
- throw new Error("key not found");
212
- }
213
- }
214
-
215
- break;
216
- }
217
- }
218
- export function MapTreeModule$$$tryFind($comparer$$2$$26, $k$$4$$27, $m$$5$$28) {
219
- MapTreeModule$$$tryFind: while (true) {
220
- const comparer$$2 = $comparer$$2$$26,
221
- k$$4 = $k$$4$$27,
222
- m$$5 = $m$$5$$28;
223
-
224
- switch (m$$5.tag) {
225
- case 1:
226
- {
227
- const c$$4 = comparer$$2.Compare(k$$4, m$$5.fields[0]) | 0;
228
-
229
- if (c$$4 === 0) {
230
- return some(m$$5.fields[1]);
231
- } else {
232
- return undefined;
233
- }
234
- }
235
-
236
- case 2:
237
- {
238
- const c$$5 = comparer$$2.Compare(k$$4, m$$5.fields[0]) | 0;
239
-
240
- if (c$$5 < 0) {
241
- $comparer$$2$$26 = comparer$$2;
242
- $k$$4$$27 = k$$4;
243
- $m$$5$$28 = m$$5.fields[2];
244
- continue MapTreeModule$$$tryFind;
245
- } else if (c$$5 === 0) {
246
- return some(m$$5.fields[1]);
247
- } else {
248
- $comparer$$2$$26 = comparer$$2;
249
- $k$$4$$27 = k$$4;
250
- $m$$5$$28 = m$$5.fields[3];
251
- continue MapTreeModule$$$tryFind;
252
- }
253
- }
254
-
255
- default:
256
- {
257
- return undefined;
258
- }
259
- }
260
-
261
- break;
262
- }
263
- }
264
- export function MapTreeModule$$$partition1(comparer$$3, f, k$$5, v$$3, acc1, acc2) {
265
- if (f(k$$5, v$$3)) {
266
- return [MapTreeModule$$$add(comparer$$3, k$$5, v$$3, acc1), acc2];
267
- } else {
268
- return [acc1, MapTreeModule$$$add(comparer$$3, k$$5, v$$3, acc2)];
269
- }
270
- }
271
- export function MapTreeModule$$$partitionAux($comparer$$4$$35, $f$$1$$36, $s$$37, $acc_0$$38, $acc_1$$39) {
272
- MapTreeModule$$$partitionAux: while (true) {
273
- const comparer$$4 = $comparer$$4$$35,
274
- f$$1 = $f$$1$$36,
275
- s = $s$$37,
276
- acc_0 = $acc_0$$38,
277
- acc_1 = $acc_1$$39;
278
-
279
- switch (s.tag) {
280
- case 1:
281
- {
282
- return MapTreeModule$$$partition1(comparer$$4, f$$1, s.fields[0], s.fields[1], acc_0, acc_1);
283
- }
284
-
285
- case 2:
286
- {
287
- const acc$$2 = MapTreeModule$$$partitionAux(comparer$$4, f$$1, s.fields[3], acc_0, acc_1);
288
- const acc$$3 = MapTreeModule$$$partition1(comparer$$4, f$$1, s.fields[0], s.fields[1], acc$$2[0], acc$$2[1]);
289
- $comparer$$4$$35 = comparer$$4;
290
- $f$$1$$36 = f$$1;
291
- $s$$37 = s.fields[2];
292
- $acc_0$$38 = acc$$3[0];
293
- $acc_1$$39 = acc$$3[1];
294
- continue MapTreeModule$$$partitionAux;
295
- }
296
-
297
- default:
298
- {
299
- return [acc_0, acc_1];
300
- }
301
- }
302
-
303
- break;
304
- }
305
- }
306
- export function MapTreeModule$$$partition(comparer$$5, f$$2, s$$1) {
307
- return MapTreeModule$$$partitionAux(comparer$$5, f$$2, s$$1, MapTreeModule$$$empty(), MapTreeModule$$$empty());
308
- }
309
- export function MapTreeModule$$$filter1(comparer$$6, f$$3, k$$8, v$$6, acc$$4) {
310
- if (f$$3(k$$8, v$$6)) {
311
- return MapTreeModule$$$add(comparer$$6, k$$8, v$$6, acc$$4);
312
- } else {
313
- return acc$$4;
314
- }
315
- }
316
- export function MapTreeModule$$$filterAux($comparer$$7$$48, $f$$4$$49, $s$$2$$50, $acc$$5$$51) {
317
- MapTreeModule$$$filterAux: while (true) {
318
- const comparer$$7 = $comparer$$7$$48,
319
- f$$4 = $f$$4$$49,
320
- s$$2 = $s$$2$$50,
321
- acc$$5 = $acc$$5$$51;
322
-
323
- switch (s$$2.tag) {
324
- case 1:
325
- {
326
- return MapTreeModule$$$filter1(comparer$$7, f$$4, s$$2.fields[0], s$$2.fields[1], acc$$5);
327
- }
328
-
329
- case 2:
330
- {
331
- const acc$$6 = MapTreeModule$$$filterAux(comparer$$7, f$$4, s$$2.fields[2], acc$$5);
332
- const acc$$7 = MapTreeModule$$$filter1(comparer$$7, f$$4, s$$2.fields[0], s$$2.fields[1], acc$$6);
333
- $comparer$$7$$48 = comparer$$7;
334
- $f$$4$$49 = f$$4;
335
- $s$$2$$50 = s$$2.fields[3];
336
- $acc$$5$$51 = acc$$7;
337
- continue MapTreeModule$$$filterAux;
338
- }
339
-
340
- default:
341
- {
342
- return acc$$5;
343
- }
344
- }
345
-
346
- break;
347
- }
348
- }
349
- export function MapTreeModule$$$filter(comparer$$8, f$$5, s$$3) {
350
- return MapTreeModule$$$filterAux(comparer$$8, f$$5, s$$3, MapTreeModule$$$empty());
351
- }
352
- export function MapTreeModule$$$spliceOutSuccessor(m$$6) {
353
- switch (m$$6.tag) {
354
- case 1:
355
- {
356
- return [m$$6.fields[0], m$$6.fields[1], new MapTree$00602(0, "MapEmpty")];
357
- }
358
-
359
- case 2:
360
- {
361
- if (m$$6.fields[2].tag === 0) {
362
- return [m$$6.fields[0], m$$6.fields[1], m$$6.fields[3]];
363
- } else {
364
- const patternInput = MapTreeModule$$$spliceOutSuccessor(m$$6.fields[2]);
365
- return [patternInput[0], patternInput[1], MapTreeModule$$$mk(patternInput[2], m$$6.fields[0], m$$6.fields[1], m$$6.fields[3])];
366
- }
367
- }
368
-
369
- default:
370
- {
371
- throw new Error("internal error: Map.spliceOutSuccessor");
372
- }
373
- }
374
- }
375
- export function MapTreeModule$$$remove(comparer$$9, k$$11, m$$7) {
376
- switch (m$$7.tag) {
377
- case 1:
378
- {
379
- const c$$6 = comparer$$9.Compare(k$$11, m$$7.fields[0]) | 0;
380
-
381
- if (c$$6 === 0) {
382
- return new MapTree$00602(0, "MapEmpty");
383
- } else {
384
- return m$$7;
385
- }
386
- }
387
-
388
- case 2:
389
- {
390
- const c$$7 = comparer$$9.Compare(k$$11, m$$7.fields[0]) | 0;
391
-
392
- if (c$$7 < 0) {
393
- return MapTreeModule$$$rebalance(MapTreeModule$$$remove(comparer$$9, k$$11, m$$7.fields[2]), m$$7.fields[0], m$$7.fields[1], m$$7.fields[3]);
394
- } else if (c$$7 === 0) {
395
- if (m$$7.fields[2].tag === 0) {
396
- return m$$7.fields[3];
397
- } else if (m$$7.fields[3].tag === 0) {
398
- return m$$7.fields[2];
399
- } else {
400
- const patternInput$$1 = MapTreeModule$$$spliceOutSuccessor(m$$7.fields[3]);
401
- return MapTreeModule$$$mk(m$$7.fields[2], patternInput$$1[0], patternInput$$1[1], patternInput$$1[2]);
402
- }
403
- } else {
404
- return MapTreeModule$$$rebalance(m$$7.fields[2], m$$7.fields[0], m$$7.fields[1], MapTreeModule$$$remove(comparer$$9, k$$11, m$$7.fields[3]));
405
- }
406
- }
407
-
408
- default:
409
- {
410
- return MapTreeModule$$$empty();
411
- }
412
- }
413
- }
414
- export function MapTreeModule$$$mem($comparer$$10$$59, $k$$12$$60, $m$$8$$61) {
415
- MapTreeModule$$$mem: while (true) {
416
- const comparer$$10 = $comparer$$10$$59,
417
- k$$12 = $k$$12$$60,
418
- m$$8 = $m$$8$$61;
419
-
420
- switch (m$$8.tag) {
421
- case 1:
422
- {
423
- return comparer$$10.Compare(k$$12, m$$8.fields[0]) === 0;
424
- }
425
-
426
- case 2:
427
- {
428
- const c$$8 = comparer$$10.Compare(k$$12, m$$8.fields[0]) | 0;
429
-
430
- if (c$$8 < 0) {
431
- $comparer$$10$$59 = comparer$$10;
432
- $k$$12$$60 = k$$12;
433
- $m$$8$$61 = m$$8.fields[2];
434
- continue MapTreeModule$$$mem;
435
- } else if (c$$8 === 0) {
436
- return true;
437
- } else {
438
- $comparer$$10$$59 = comparer$$10;
439
- $k$$12$$60 = k$$12;
440
- $m$$8$$61 = m$$8.fields[3];
441
- continue MapTreeModule$$$mem;
442
- }
443
- }
444
-
445
- default:
446
- {
447
- return false;
448
- }
449
- }
450
-
451
- break;
452
- }
453
- }
454
- export function MapTreeModule$$$iter($f$$6$$62, $m$$9$$63) {
455
- MapTreeModule$$$iter: while (true) {
456
- const f$$6 = $f$$6$$62,
457
- m$$9 = $m$$9$$63;
458
-
459
- switch (m$$9.tag) {
460
- case 1:
461
- {
462
- f$$6(m$$9.fields[0], m$$9.fields[1]);
463
- break;
464
- }
465
-
466
- case 2:
467
- {
468
- MapTreeModule$$$iter(f$$6, m$$9.fields[2]);
469
- f$$6(m$$9.fields[0], m$$9.fields[1]);
470
- $f$$6$$62 = f$$6;
471
- $m$$9$$63 = m$$9.fields[3];
472
- continue MapTreeModule$$$iter;
473
- break;
474
- }
475
-
476
- default:
477
- {
478
- void null;
479
- }
480
- }
481
-
482
- break;
483
- }
484
- }
485
- export function MapTreeModule$$$tryPick($f$$7$$64, $m$$10$$65) {
486
- MapTreeModule$$$tryPick: while (true) {
487
- const f$$7 = $f$$7$$64,
488
- m$$10 = $m$$10$$65;
489
-
490
- switch (m$$10.tag) {
491
- case 1:
492
- {
493
- return f$$7(m$$10.fields[0], m$$10.fields[1]);
494
- }
495
-
496
- case 2:
497
- {
498
- const matchValue$$2 = MapTreeModule$$$tryPick(f$$7, m$$10.fields[2]);
499
-
500
- if (matchValue$$2 == null) {
501
- const matchValue$$3 = f$$7(m$$10.fields[0], m$$10.fields[1]);
502
-
503
- if (matchValue$$3 == null) {
504
- $f$$7$$64 = f$$7;
505
- $m$$10$$65 = m$$10.fields[3];
506
- continue MapTreeModule$$$tryPick;
507
- } else {
508
- return matchValue$$3;
509
- }
510
- } else {
511
- return matchValue$$2;
512
- }
513
- }
514
-
515
- default:
516
- {
517
- return undefined;
518
- }
519
- }
520
-
521
- break;
522
- }
523
- }
524
- export function MapTreeModule$$$exists($f$$8$$66, $m$$11$$67) {
525
- MapTreeModule$$$exists: while (true) {
526
- const f$$8 = $f$$8$$66,
527
- m$$11 = $m$$11$$67;
528
-
529
- switch (m$$11.tag) {
530
- case 1:
531
- {
532
- return f$$8(m$$11.fields[0], m$$11.fields[1]);
533
- }
534
-
535
- case 2:
536
- {
537
- if (MapTreeModule$$$exists(f$$8, m$$11.fields[2]) ? true : f$$8(m$$11.fields[0], m$$11.fields[1])) {
538
- return true;
539
- } else {
540
- $f$$8$$66 = f$$8;
541
- $m$$11$$67 = m$$11.fields[3];
542
- continue MapTreeModule$$$exists;
543
- }
544
- }
545
-
546
- default:
547
- {
548
- return false;
549
- }
550
- }
551
-
552
- break;
553
- }
554
- }
555
- export function MapTreeModule$$$forall($f$$9$$68, $m$$12$$69) {
556
- MapTreeModule$$$forall: while (true) {
557
- const f$$9 = $f$$9$$68,
558
- m$$12 = $m$$12$$69;
559
-
560
- switch (m$$12.tag) {
561
- case 1:
562
- {
563
- return f$$9(m$$12.fields[0], m$$12.fields[1]);
564
- }
565
-
566
- case 2:
567
- {
568
- if (MapTreeModule$$$forall(f$$9, m$$12.fields[2]) ? f$$9(m$$12.fields[0], m$$12.fields[1]) : false) {
569
- $f$$9$$68 = f$$9;
570
- $m$$12$$69 = m$$12.fields[3];
571
- continue MapTreeModule$$$forall;
572
- } else {
573
- return false;
574
- }
575
- }
576
-
577
- default:
578
- {
579
- return true;
580
- }
581
- }
582
-
583
- break;
584
- }
585
- }
586
- export function MapTreeModule$$$map(f$$10, m$$13) {
587
- switch (m$$13.tag) {
588
- case 1:
589
- {
590
- return new MapTree$00602(1, "MapOne", m$$13.fields[0], f$$10(m$$13.fields[1]));
591
- }
592
-
593
- case 2:
594
- {
595
- const l2 = MapTreeModule$$$map(f$$10, m$$13.fields[2]);
596
- const v2$$16 = f$$10(m$$13.fields[1]);
597
- const r2 = MapTreeModule$$$map(f$$10, m$$13.fields[3]);
598
- return new MapTree$00602(2, "MapNode", m$$13.fields[0], v2$$16, l2, r2, m$$13.fields[4]);
599
- }
600
-
601
- default:
602
- {
603
- return MapTreeModule$$$empty();
604
- }
605
- }
606
- }
607
- export function MapTreeModule$$$mapi(f$$11, m$$14) {
608
- switch (m$$14.tag) {
609
- case 1:
610
- {
611
- return new MapTree$00602(1, "MapOne", m$$14.fields[0], f$$11(m$$14.fields[0], m$$14.fields[1]));
612
- }
613
-
614
- case 2:
615
- {
616
- const l2$$1 = MapTreeModule$$$mapi(f$$11, m$$14.fields[2]);
617
- const v2$$17 = f$$11(m$$14.fields[0], m$$14.fields[1]);
618
- const r2$$1 = MapTreeModule$$$mapi(f$$11, m$$14.fields[3]);
619
- return new MapTree$00602(2, "MapNode", m$$14.fields[0], v2$$17, l2$$1, r2$$1, m$$14.fields[4]);
620
- }
621
-
622
- default:
623
- {
624
- return MapTreeModule$$$empty();
625
- }
626
- }
627
- }
628
- export function MapTreeModule$$$foldBack($f$$12$$74, $m$$15$$75, $x$$1$$76) {
629
- MapTreeModule$$$foldBack: while (true) {
630
- const f$$12 = $f$$12$$74,
631
- m$$15 = $m$$15$$75,
632
- x$$1 = $x$$1$$76;
633
-
634
- switch (m$$15.tag) {
635
- case 1:
636
- {
637
- return f$$12(m$$15.fields[0], m$$15.fields[1], x$$1);
638
- }
639
-
640
- case 2:
641
- {
642
- const x$$2 = MapTreeModule$$$foldBack(f$$12, m$$15.fields[3], x$$1);
643
- const x$$3 = f$$12(m$$15.fields[0], m$$15.fields[1], x$$2);
644
- $f$$12$$74 = f$$12;
645
- $m$$15$$75 = m$$15.fields[2];
646
- $x$$1$$76 = x$$3;
647
- continue MapTreeModule$$$foldBack;
648
- }
649
-
650
- default:
651
- {
652
- return x$$1;
653
- }
654
- }
655
-
656
- break;
657
- }
658
- }
659
- export function MapTreeModule$$$fold($f$$13$$77, $x$$4$$78, $m$$16$$79) {
660
- MapTreeModule$$$fold: while (true) {
661
- const f$$13 = $f$$13$$77,
662
- x$$4 = $x$$4$$78,
663
- m$$16 = $m$$16$$79;
664
-
665
- switch (m$$16.tag) {
666
- case 1:
667
- {
668
- return f$$13(x$$4, m$$16.fields[0], m$$16.fields[1]);
669
- }
670
-
671
- case 2:
672
- {
673
- const x$$5 = MapTreeModule$$$fold(f$$13, x$$4, m$$16.fields[2]);
674
- const x$$6 = f$$13(x$$5, m$$16.fields[0], m$$16.fields[1]);
675
- $f$$13$$77 = f$$13;
676
- $x$$4$$78 = x$$6;
677
- $m$$16$$79 = m$$16.fields[3];
678
- continue MapTreeModule$$$fold;
679
- }
680
-
681
- default:
682
- {
683
- return x$$4;
684
- }
685
- }
686
-
687
- break;
688
- }
689
- }
690
- export function MapTreeModule$$$foldFromTo(comparer$$11, lo, hi, f$$14, m$$17, x$$7) {
691
- switch (m$$17.tag) {
692
- case 1:
693
- {
694
- const cLoKey = comparer$$11.Compare(lo, m$$17.fields[0]) | 0;
695
- const cKeyHi = comparer$$11.Compare(m$$17.fields[0], hi) | 0;
696
- const x$$8 = (cLoKey <= 0 ? cKeyHi <= 0 : false) ? f$$14(m$$17.fields[0], m$$17.fields[1], x$$7) : x$$7;
697
- return x$$8;
698
- }
699
-
700
- case 2:
701
- {
702
- const cLoKey$$1 = comparer$$11.Compare(lo, m$$17.fields[0]) | 0;
703
- const cKeyHi$$1 = comparer$$11.Compare(m$$17.fields[0], hi) | 0;
704
- const x$$9 = cLoKey$$1 < 0 ? MapTreeModule$$$foldFromTo(comparer$$11, lo, hi, f$$14, m$$17.fields[2], x$$7) : x$$7;
705
- const x$$10 = (cLoKey$$1 <= 0 ? cKeyHi$$1 <= 0 : false) ? f$$14(m$$17.fields[0], m$$17.fields[1], x$$9) : x$$9;
706
- const x$$11 = cKeyHi$$1 < 0 ? MapTreeModule$$$foldFromTo(comparer$$11, lo, hi, f$$14, m$$17.fields[3], x$$10) : x$$10;
707
- return x$$11;
708
- }
709
-
710
- default:
711
- {
712
- return x$$7;
713
- }
714
- }
715
- }
716
- export function MapTreeModule$$$foldSection(comparer$$12, lo$$1, hi$$1, f$$15, m$$18, x$$12) {
717
- if (comparer$$12.Compare(lo$$1, hi$$1) === 1) {
718
- return x$$12;
719
- } else {
720
- return MapTreeModule$$$foldFromTo(comparer$$12, lo$$1, hi$$1, f$$15, m$$18, x$$12);
721
- }
722
- }
723
- export function MapTreeModule$$$loop($m$$19$$92, $acc$$8$$93) {
724
- MapTreeModule$$$loop: while (true) {
725
- const m$$19 = $m$$19$$92,
726
- acc$$8 = $acc$$8$$93;
727
-
728
- switch (m$$19.tag) {
729
- case 1:
730
- {
731
- return new List([m$$19.fields[0], m$$19.fields[1]], acc$$8);
732
- }
733
-
734
- case 2:
735
- {
736
- $m$$19$$92 = m$$19.fields[2];
737
- $acc$$8$$93 = new List([m$$19.fields[0], m$$19.fields[1]], MapTreeModule$$$loop(m$$19.fields[3], acc$$8));
738
- continue MapTreeModule$$$loop;
739
- }
740
-
741
- default:
742
- {
743
- return acc$$8;
744
- }
745
- }
746
-
747
- break;
748
- }
749
- }
750
- export function MapTreeModule$$$toList(m$$20) {
751
- return MapTreeModule$$$loop(m$$20, new List());
752
- }
753
- export function MapTreeModule$$$ofList(comparer$$13, l$$20) {
754
- return fold$$1(function (acc$$9, tupledArg) {
755
- return MapTreeModule$$$add(comparer$$13, tupledArg[0], tupledArg[1], acc$$9);
756
- }, MapTreeModule$$$empty(), l$$20);
757
- }
758
- export function MapTreeModule$$$mkFromEnumerator($comparer$$14$$97, $acc$$10$$98, $e$$99) {
759
- MapTreeModule$$$mkFromEnumerator: while (true) {
760
- const comparer$$14 = $comparer$$14$$97,
761
- acc$$10 = $acc$$10$$98,
762
- e = $e$$99;
763
-
764
- if (e.MoveNext()) {
765
- const patternInput$$2 = e.Current;
766
- $comparer$$14$$97 = comparer$$14;
767
- $acc$$10$$98 = MapTreeModule$$$add(comparer$$14, patternInput$$2[0], patternInput$$2[1], acc$$10);
768
- $e$$99 = e;
769
- continue MapTreeModule$$$mkFromEnumerator;
770
- } else {
771
- return acc$$10;
772
- }
773
-
774
- break;
775
- }
776
- }
777
- export function MapTreeModule$$$ofArray(comparer$$15, arr) {
778
- let res$$2 = MapTreeModule$$$empty();
779
-
780
- for (let i = 0; i <= arr.length - 1; i++) {
781
- const patternInput$$3 = arr[i];
782
- res$$2 = MapTreeModule$$$add(comparer$$15, patternInput$$3[0], patternInput$$3[1], res$$2);
783
- }
784
-
785
- return res$$2;
786
- }
787
- export function MapTreeModule$$$ofSeq(comparer$$16, c$$9) {
788
- const ie = getEnumerator(c$$9);
789
-
790
- try {
791
- return MapTreeModule$$$mkFromEnumerator(comparer$$16, MapTreeModule$$$empty(), ie);
792
- } finally {
793
- if (isDisposable(ie)) {
794
- ie.Dispose();
795
- } else {
796
- void null;
797
- }
798
- }
799
- }
800
- export function MapTreeModule$$$copyToArray(s$$4, arr$$1, i$$1) {
801
- let j = i$$1 | 0;
802
- MapTreeModule$$$iter(function f$$16(x$$15, y$$2) {
803
- arr$$1[j] = [x$$15, y$$2];
804
- j = j + 1;
805
- }, s$$4);
806
- }
807
- export const MapTreeModule$002EMapIterator$00602 = declare(function Map_MapTreeModule_MapIterator(stack, started) {
808
- this.stack = stack;
809
- this.started = started;
810
- }, Record);
811
- export function MapTreeModule$002EMapIterator$00602$reflection($gen$$109, $gen$$110) {
812
- return record_type("Map.MapTreeModule.MapIterator`2", [$gen$$109, $gen$$110], MapTreeModule$002EMapIterator$00602, () => [["stack", list_type(MapTree$00602$reflection($gen$$109, $gen$$110))], ["started", bool_type]]);
813
- }
814
- export function MapTreeModule$$$collapseLHS($stack$$111) {
815
- MapTreeModule$$$collapseLHS: while (true) {
816
- const stack = $stack$$111;
817
-
818
- if (stack.tail != null) {
819
- if (stack.head.tag === 1) {
820
- return stack;
821
- } else if (stack.head.tag === 2) {
822
- $stack$$111 = new List(stack.head.fields[2], new List(new MapTree$00602(1, "MapOne", stack.head.fields[0], stack.head.fields[1]), new List(stack.head.fields[3], stack.tail)));
823
- continue MapTreeModule$$$collapseLHS;
824
- } else {
825
- $stack$$111 = stack.tail;
826
- continue MapTreeModule$$$collapseLHS;
827
- }
828
- } else {
829
- return new List();
830
- }
831
-
832
- break;
833
- }
834
- }
835
- export function MapTreeModule$$$mkIterator(s$$5) {
836
- return new MapTreeModule$002EMapIterator$00602(MapTreeModule$$$collapseLHS(new List(s$$5, new List())), false);
837
- }
838
- export function MapTreeModule$$$notStarted() {
839
- throw new Error("enumeration not started");
840
- }
841
- export function MapTreeModule$$$alreadyFinished() {
842
- throw new Error("enumeration already finished");
843
- }
844
- export function MapTreeModule$$$current(i$$2) {
845
- if (i$$2.started) {
846
- const matchValue$$4 = i$$2.stack;
847
-
848
- if (matchValue$$4.tail == null) {
849
- return MapTreeModule$$$alreadyFinished();
850
- } else if (matchValue$$4.head.tag === 1) {
851
- return [matchValue$$4.head.fields[0], matchValue$$4.head.fields[1]];
852
- } else {
853
- throw new Error("Please report error: Map iterator, unexpected stack for current");
854
- }
855
- } else {
856
- return MapTreeModule$$$notStarted();
857
- }
858
- }
859
- export function MapTreeModule$$$moveNext(i$$3) {
860
- if (i$$3.started) {
861
- const matchValue$$5 = i$$3.stack;
862
-
863
- if (matchValue$$5.tail == null) {
864
- return false;
865
- } else if (matchValue$$5.head.tag === 1) {
866
- i$$3.stack = MapTreeModule$$$collapseLHS(matchValue$$5.tail);
867
- return !(i$$3.stack.tail == null);
868
- } else {
869
- throw new Error("Please report error: Map iterator, unexpected stack for moveNext");
870
- }
871
- } else {
872
- i$$3.started = true;
873
- return !(i$$3.stack.tail == null);
874
- }
875
- }
876
- export const MapTreeModule$002EmkIEnumerator$0027$00602 = declare(function Map_MapTreeModule_mkIEnumerator_(s$$6) {
877
- const $this$$1 = this;
878
- $this$$1.s = s$$6;
879
- $this$$1.i = MapTreeModule$$$mkIterator($this$$1.s);
880
- void null;
881
- });
882
- export function MapTreeModule$002EmkIEnumerator$0027$00602$reflection($gen$$115, $gen$$116) {
883
- return class_type("Map.MapTreeModule.mkIEnumerator'`2", [$gen$$115, $gen$$116], MapTreeModule$002EmkIEnumerator$0027$00602);
884
- }
885
- export function MapTreeModule$002EmkIEnumerator$0027$00602$$$$002Ector$$Z26BC498C(s$$6) {
886
- return this instanceof MapTreeModule$002EmkIEnumerator$0027$00602 ? MapTreeModule$002EmkIEnumerator$0027$00602.call(this, s$$6) : new MapTreeModule$002EmkIEnumerator$0027$00602(s$$6);
887
- }
888
- Object.defineProperty(MapTreeModule$002EmkIEnumerator$0027$00602.prototype, "Current", {
889
- "get": function () {
890
- const __ = this;
891
-
892
- return MapTreeModule$$$current(__.i);
893
- }
894
- });
895
-
896
- MapTreeModule$002EmkIEnumerator$0027$00602.prototype.MoveNext = function () {
897
- const __$$1 = this;
898
-
899
- return MapTreeModule$$$moveNext(__$$1.i);
900
- };
901
-
902
- MapTreeModule$002EmkIEnumerator$0027$00602.prototype.Reset = function () {
903
- const __$$2 = this;
904
-
905
- __$$2.i = MapTreeModule$$$mkIterator(__$$2.s);
906
- };
907
-
908
- MapTreeModule$002EmkIEnumerator$0027$00602.prototype.Dispose = function () {
909
- void null;
910
- };
911
-
912
- export function MapTreeModule$$$mkIEnumerator(s$$7) {
913
- return MapTreeModule$002EmkIEnumerator$0027$00602$$$$002Ector$$Z26BC498C(s$$7);
914
- }
915
- export function MapTreeModule$$$toSeq(s$$8) {
916
- const en = MapTreeModule$$$mkIEnumerator(s$$8);
917
- return unfold(function generator(en$$1) {
918
- if (en$$1.MoveNext()) {
919
- return [en$$1.Current, en$$1];
920
- } else {
921
- return undefined;
922
- }
923
- }, en);
924
- }
925
- export const FSharpMap = declare(function Map_Map(comparer$$17, tree) {
926
- const $this$$2 = this;
927
- $this$$2.comparer = comparer$$17;
928
- $this$$2.tree = tree;
929
- void null;
930
- });
931
- export function FSharpMap$reflection($gen$$120, $gen$$121) {
932
- return class_type("Map.FSharpMap", [$gen$$120, $gen$$121], FSharpMap);
933
- }
934
- export function FSharpMap$$$$002Ector$$58ADD115(comparer$$17, tree) {
935
- return this instanceof FSharpMap ? FSharpMap.call(this, comparer$$17, tree) : new FSharpMap(comparer$$17, tree);
936
- }
937
- export function FSharpMap$$get_Comparer(__$$4) {
938
- return __$$4.comparer;
939
- }
940
- export function FSharpMap$$get_Tree(__$$5) {
941
- return __$$5.tree;
942
- }
943
- export function FSharpMap$$Add$$5BDDA1(__$$6, k$$28, v$$24) {
944
- return FSharpMap$$$$002Ector$$58ADD115(__$$6.comparer, MapTreeModule$$$add(__$$6.comparer, k$$28, v$$24, __$$6.tree));
945
- }
946
- export function FSharpMap$$get_IsEmpty(__$$7) {
947
- return MapTreeModule$$$isEmpty(__$$7.tree);
948
- }
949
- export function FSharpMap$$get_Item$$2B595(__$$8, k$$29) {
950
- return MapTreeModule$$$find(__$$8.comparer, k$$29, __$$8.tree);
951
- }
952
- export function FSharpMap$$TryGetValue$$5BDDA1(__$$9, k$$30, defValue) {
953
- const matchValue$$6 = MapTreeModule$$$tryFind(__$$9.comparer, k$$30, __$$9.tree);
954
-
955
- if (matchValue$$6 == null) {
956
- return [false, defValue];
957
- } else {
958
- const v$$25 = value$$3(matchValue$$6);
959
- return [true, v$$25];
960
- }
961
- }
962
- export function FSharpMap$$TryPick$$72321DD7(__$$10, f$$17) {
963
- return MapTreeModule$$$tryPick(f$$17, __$$10.tree);
964
- }
965
- export function FSharpMap$$Exists$$Z395DDC35(__$$11, f$$18) {
966
- return MapTreeModule$$$exists(f$$18, __$$11.tree);
967
- }
968
- export function FSharpMap$$Filter$$Z395DDC35(__$$12, f$$19) {
969
- return FSharpMap$$$$002Ector$$58ADD115(__$$12.comparer, MapTreeModule$$$filter(__$$12.comparer, f$$19, __$$12.tree));
970
- }
971
- export function FSharpMap$$ForAll$$Z395DDC35(__$$13, f$$20) {
972
- return MapTreeModule$$$forall(f$$20, __$$13.tree);
973
- }
974
- export function FSharpMap$$Fold(__$$14, f$$21, acc$$11) {
975
- return MapTreeModule$$$foldBack(f$$21, __$$14.tree, acc$$11);
976
- }
977
- export function FSharpMap$$FoldSection(__$$15, lo$$2, hi$$2, f$$22, acc$$12) {
978
- return MapTreeModule$$$foldSection(__$$15.comparer, lo$$2, hi$$2, f$$22, __$$15.tree, acc$$12);
979
- }
980
- export function FSharpMap$$Iterate$$1DCFB91D(__$$16, f$$23) {
981
- MapTreeModule$$$iter(f$$23, __$$16.tree);
982
- }
983
- export function FSharpMap$$MapRange$$6DC7247(__$$17, f$$24) {
984
- return FSharpMap$$$$002Ector$$58ADD115(__$$17.comparer, MapTreeModule$$$map(f$$24, __$$17.tree));
985
- }
986
- export function FSharpMap$$Map$$Z6F6B671C(__$$18, f$$25) {
987
- return FSharpMap$$$$002Ector$$58ADD115(__$$18.comparer, MapTreeModule$$$mapi(f$$25, __$$18.tree));
988
- }
989
- export function FSharpMap$$Partition$$Z395DDC35(__$$19, f$$26) {
990
- const patternInput$$4 = MapTreeModule$$$partition(__$$19.comparer, f$$26, __$$19.tree);
991
- return [FSharpMap$$$$002Ector$$58ADD115(__$$19.comparer, patternInput$$4[0]), FSharpMap$$$$002Ector$$58ADD115(__$$19.comparer, patternInput$$4[1])];
992
- }
993
- export function FSharpMap$$get_Count(__$$20) {
994
- return MapTreeModule$$$size(__$$20.tree);
995
- }
996
- export function FSharpMap$$ContainsKey$$2B595(__$$21, k$$31) {
997
- return MapTreeModule$$$mem(__$$21.comparer, k$$31, __$$21.tree);
998
- }
999
- export function FSharpMap$$Remove$$2B595(__$$22, k$$32) {
1000
- return FSharpMap$$$$002Ector$$58ADD115(__$$22.comparer, MapTreeModule$$$remove(__$$22.comparer, k$$32, __$$22.tree));
1001
- }
1002
- export function FSharpMap$$TryFind$$2B595(__$$23, k$$33) {
1003
- return MapTreeModule$$$tryFind(__$$23.comparer, k$$33, __$$23.tree);
1004
- }
1005
- export function FSharpMap$$ToList(__$$24) {
1006
- return MapTreeModule$$$toList(__$$24.tree);
1007
- }
1008
-
1009
- FSharpMap.prototype.toString = function () {
1010
- const this$ = this;
1011
- let str;
1012
- let strings;
1013
- strings = map$$2(function toStr(kv) {
1014
- return format("({0}, {1})", kv[0], kv[1]);
1015
- }, this$);
1016
- str = join("; ", strings);
1017
- return "map [" + str + "]";
1018
- };
1019
-
1020
- FSharpMap.prototype.GetHashCode = function () {
1021
- const this$$$1 = this;
1022
-
1023
- const combineHash = function combineHash(x$$16, y$$3) {
1024
- return (x$$16 << 1) + y$$3 + 631;
1025
- };
1026
-
1027
- let res$$3 = 0;
1028
- const e$$1 = MapTreeModule$$$mkIEnumerator(FSharpMap$$get_Tree(this$$$1));
1029
-
1030
- while (e$$1.MoveNext()) {
1031
- const patternInput$$5 = e$$1.Current;
1032
- const activePatternResult3678 = patternInput$$5;
1033
- res$$3 = combineHash(res$$3, structuralHash(activePatternResult3678[0]));
1034
- res$$3 = combineHash(res$$3, structuralHash(activePatternResult3678[1]));
1035
- }
1036
-
1037
- return Math.abs(res$$3) | 0;
1038
- };
1039
-
1040
- FSharpMap.prototype.Equals = function (that) {
1041
- const this$$$2 = this;
1042
- return this$$$2.CompareTo(that) === 0;
1043
- };
1044
-
1045
- FSharpMap.prototype[Symbol.iterator] = function () {
1046
- const __$$25 = this;
1047
-
1048
- return toIterator(MapTreeModule$$$mkIEnumerator(__$$25.tree));
1049
- };
1050
-
1051
- FSharpMap.prototype.CompareTo = function (obj) {
1052
- const m$$22 = this;
1053
- let res$$4 = 0;
1054
- let finished = false;
1055
- const e1 = MapTreeModule$$$mkIEnumerator(FSharpMap$$get_Tree(m$$22));
1056
-
1057
- try {
1058
- const e2 = MapTreeModule$$$mkIEnumerator(FSharpMap$$get_Tree(obj));
1059
-
1060
- try {
1061
- while (!finished ? res$$4 === 0 : false) {
1062
- const matchValue$$7 = [e1.MoveNext(), e2.MoveNext()];
1063
-
1064
- if (matchValue$$7[0]) {
1065
- if (matchValue$$7[1]) {
1066
- const kvp1 = e1.Current;
1067
- const kvp2 = e2.Current;
1068
- const c$$10 = m$$22.comparer.Compare(kvp1[0], kvp2[0]) | 0;
1069
- res$$4 = c$$10 !== 0 ? c$$10 : compare(kvp1[1], kvp2[1]);
1070
- } else {
1071
- res$$4 = 1;
1072
- }
1073
- } else if (matchValue$$7[1]) {
1074
- res$$4 = -1;
1075
- } else {
1076
- finished = true;
1077
- }
1078
- }
1079
-
1080
- return res$$4 | 0;
1081
- } finally {
1082
- if (isDisposable(e2)) {
1083
- e2.Dispose();
1084
- } else {
1085
- void null;
1086
- }
1087
- }
1088
- } finally {
1089
- if (isDisposable(e1)) {
1090
- e1.Dispose();
1091
- } else {
1092
- void null;
1093
- }
1094
- }
1095
- };
1096
-
1097
- Object.defineProperty(FSharpMap.prototype, "size", {
1098
- "get": function () {
1099
- const this$$$3 = this;
1100
- return FSharpMap$$get_Count(this$$$3) | 0;
1101
- }
1102
- });
1103
-
1104
- FSharpMap.prototype.clear = function () {
1105
- throw new Error("Map cannot be mutated");
1106
- };
1107
-
1108
- FSharpMap.prototype.delete = function (_arg1$$1) {
1109
- throw new Error("Map cannot be mutated");
1110
- };
1111
-
1112
- FSharpMap.prototype.entries = function () {
1113
- const this$$$4 = this;
1114
- return MapTreeModule$$$toSeq(FSharpMap$$get_Tree(this$$$4));
1115
- };
1116
-
1117
- FSharpMap.prototype.get = function (k$$34) {
1118
- const this$$$5 = this;
1119
- return FSharpMap$$get_Item$$2B595(this$$$5, k$$34);
1120
- };
1121
-
1122
- FSharpMap.prototype.has = function (k$$35) {
1123
- const this$$$6 = this;
1124
- return FSharpMap$$ContainsKey$$2B595(this$$$6, k$$35);
1125
- };
1126
-
1127
- FSharpMap.prototype.keys = function () {
1128
- const this$$$7 = this;
1129
- const source$$1 = MapTreeModule$$$toSeq(FSharpMap$$get_Tree(this$$$7));
1130
- return map$$2(function mapping(kv$$1) {
1131
- return kv$$1[0];
1132
- }, source$$1);
1133
- };
1134
-
1135
- FSharpMap.prototype.set = function (k$$36, v$$26) {
1136
- throw new Error("Map cannot be mutated");
1137
- };
1138
-
1139
- FSharpMap.prototype.values = function () {
1140
- const this$$$8 = this;
1141
- const source$$2 = MapTreeModule$$$toSeq(FSharpMap$$get_Tree(this$$$8));
1142
- return map$$2(function mapping$$1(kv$$2) {
1143
- return kv$$2[1];
1144
- }, source$$2);
1145
- };
1146
-
1147
- export function isEmpty(m$$23) {
1148
- return FSharpMap$$get_IsEmpty(m$$23);
1149
- }
1150
- export function add(k$$37, v$$27, m$$24) {
1151
- return FSharpMap$$Add$$5BDDA1(m$$24, k$$37, v$$27);
1152
- }
1153
- export function find(k$$38, m$$25) {
1154
- return FSharpMap$$get_Item$$2B595(m$$25, k$$38);
1155
- }
1156
- export function tryFind(k$$39, m$$26) {
1157
- return FSharpMap$$TryFind$$2B595(m$$26, k$$39);
1158
- }
1159
- export function remove(k$$40, m$$27) {
1160
- return FSharpMap$$Remove$$2B595(m$$27, k$$40);
1161
- }
1162
- export function containsKey(k$$41, m$$28) {
1163
- return FSharpMap$$ContainsKey$$2B595(m$$28, k$$41);
1164
- }
1165
- export function iterate(f$$27, m$$29) {
1166
- FSharpMap$$Iterate$$1DCFB91D(m$$29, f$$27);
1167
- }
1168
- export function tryPick(f$$28, m$$30) {
1169
- return FSharpMap$$TryPick$$72321DD7(m$$30, f$$28);
1170
- }
1171
- export function pick(f$$29, m$$31) {
1172
- const matchValue$$8 = tryPick(f$$29, m$$31);
1173
-
1174
- if (matchValue$$8 != null) {
1175
- const res$$5 = value$$3(matchValue$$8);
1176
- return res$$5;
1177
- } else {
1178
- throw new Error("key not found");
1179
- }
1180
- }
1181
- export function exists(f$$30, m$$32) {
1182
- return FSharpMap$$Exists$$Z395DDC35(m$$32, f$$30);
1183
- }
1184
- export function filter(f$$31, m$$33) {
1185
- return FSharpMap$$Filter$$Z395DDC35(m$$33, f$$31);
1186
- }
1187
- export function partition(f$$32, m$$34) {
1188
- return FSharpMap$$Partition$$Z395DDC35(m$$34, f$$32);
1189
- }
1190
- export function forAll(f$$33, m$$35) {
1191
- return FSharpMap$$ForAll$$Z395DDC35(m$$35, f$$33);
1192
- }
1193
- export function mapRange(f$$34, m$$36) {
1194
- return FSharpMap$$MapRange$$6DC7247(m$$36, f$$34);
1195
- }
1196
- export function map(f$$35, m$$37) {
1197
- return FSharpMap$$Map$$Z6F6B671C(m$$37, f$$35);
1198
- }
1199
- export function fold(f$$36, z, m$$38) {
1200
- return MapTreeModule$$$fold(f$$36, z, FSharpMap$$get_Tree(m$$38));
1201
- }
1202
- export function foldBack(f$$37, m$$39, z$$1) {
1203
- return MapTreeModule$$$foldBack(f$$37, FSharpMap$$get_Tree(m$$39), z$$1);
1204
- }
1205
- export function toSeq(m$$40) {
1206
- return MapTreeModule$$$toSeq(FSharpMap$$get_Tree(m$$40));
1207
- }
1208
- export function findKey(f$$38, m$$41) {
1209
- let _arg1$$2;
1210
-
1211
- const m$$42 = FSharpMap$$get_Tree(m$$41);
1212
- _arg1$$2 = MapTreeModule$$$tryPick(function f$$39(k$$42, v$$28) {
1213
- if (f$$38(k$$42, v$$28)) {
1214
- return some(k$$42);
1215
- } else {
1216
- return undefined;
1217
- }
1218
- }, m$$42);
1219
-
1220
- if (_arg1$$2 == null) {
1221
- throw new Error("Key not found");
1222
- } else {
1223
- const k$$43 = value$$3(_arg1$$2);
1224
- return k$$43;
1225
- }
1226
- }
1227
- export function tryFindKey(f$$40, m$$43) {
1228
- const m$$44 = FSharpMap$$get_Tree(m$$43);
1229
- return MapTreeModule$$$tryPick(function f$$41(k$$44, v$$29) {
1230
- if (f$$40(k$$44, v$$29)) {
1231
- return some(k$$44);
1232
- } else {
1233
- return undefined;
1234
- }
1235
- }, m$$44);
1236
- }
1237
- export function ofList(l$$22, comparer$$18) {
1238
- return FSharpMap$$$$002Ector$$58ADD115(comparer$$18, MapTreeModule$$$ofList(comparer$$18, l$$22));
1239
- }
1240
- export function ofSeq(l$$23, comparer$$19) {
1241
- return FSharpMap$$$$002Ector$$58ADD115(comparer$$19, MapTreeModule$$$ofSeq(comparer$$19, l$$23));
1242
- }
1243
- export function ofArray(array, comparer$$20) {
1244
- return FSharpMap$$$$002Ector$$58ADD115(comparer$$20, MapTreeModule$$$ofArray(comparer$$20, array));
1245
- }
1246
- export function toList(m$$45) {
1247
- return FSharpMap$$ToList(m$$45);
1248
- }
1249
- export function toArray(m$$46) {
1250
- let res$$6;
1251
- const len = FSharpMap$$get_Count(m$$46) | 0;
1252
- res$$6 = new Array(len);
1253
- MapTreeModule$$$copyToArray(FSharpMap$$get_Tree(m$$46), res$$6, 0);
1254
- return res$$6;
1255
- }
1256
- export function empty(comparer$$21) {
1257
- return FSharpMap$$$$002Ector$$58ADD115(comparer$$21, new MapTree$00602(0, "MapEmpty"));
1258
- }
1259
- export function createMutable(source$$3, comparer$$22) {
1260
- const map$$1 = MutableMap$002400602$0024$0024$0024$0024002Ector$0024$00246623D9B3(source$$3, comparer$$22);
1261
- return map$$1;
1262
- }
1263
- export function groupBy(projection, xs, comparer$$23) {
1264
- const dict = createMutable(empty$$1(), comparer$$23);
1265
- iterate$$1(function (v$$30) {
1266
- const key = projection(v$$30);
1267
-
1268
- if (dict.has(key)) {
1269
- void dict.get(key).push(v$$30);
1270
- } else {
1271
- const value = dict.set(key, [v$$30]);
1272
- void value;
1273
- }
1274
- }, xs);
1275
- return map$$2(function mapping$$2(kv$$3) {
1276
- return [kv$$3[0], kv$$3[1]];
1277
- }, dict);
1278
- }
1279
- export function countBy(projection$$1, xs$$1, comparer$$24) {
1280
- const dict$$1 = createMutable(empty$$1(), comparer$$24);
1281
- iterate$$1(function (value$$1) {
1282
- const key$$1 = projection$$1(value$$1);
1283
- const value$$2 = dict$$1.has(key$$1) ? dict$$1.set(key$$1, dict$$1.get(key$$1) + 1) : dict$$1.set(key$$1, 1);
1284
- void value$$2;
1285
- }, xs$$1);
1286
- return map$$2(function mapping$$3(kv$$4) {
1287
- return [kv$$4[0], kv$$4[1]];
1288
- }, dict$$1);
1289
- }
1290
- export function count(m$$47) {
1291
- return FSharpMap$$get_Count(m$$47);
1292
- }