@shd101wyy/yo 0.0.13 → 0.0.14

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 (222) hide show
  1. package/README.md +4 -1
  2. package/out/cjs/index.cjs +5598 -45
  3. package/out/cjs/yo-cli.cjs +755 -764
  4. package/out/esm/index.mjs +5595 -42
  5. package/out/types/src/codegen/async/state-code-gen.d.ts +3 -3
  6. package/out/types/src/codegen/async/state-machine.d.ts +4 -4
  7. package/out/types/src/codegen/c/collection.d.ts +1 -1
  8. package/out/types/src/codegen/codegen-c.d.ts +1 -1
  9. package/out/types/src/codegen/constants.d.ts +1 -1
  10. package/out/types/src/codegen/exprs/{and_or.d.ts → and-or.d.ts} +2 -2
  11. package/out/types/src/codegen/exprs/{array_fns.d.ts → array-fns.d.ts} +2 -2
  12. package/out/types/src/codegen/exprs/assignment.d.ts +2 -2
  13. package/out/types/src/codegen/exprs/async.d.ts +2 -2
  14. package/out/types/src/codegen/exprs/atom.d.ts +2 -2
  15. package/out/types/src/codegen/exprs/await.d.ts +2 -2
  16. package/out/types/src/codegen/exprs/begin.d.ts +2 -2
  17. package/out/types/src/codegen/exprs/binding.d.ts +2 -2
  18. package/out/types/src/codegen/exprs/closures.d.ts +3 -3
  19. package/out/types/src/codegen/exprs/comptime-value.d.ts +4 -0
  20. package/out/types/src/codegen/exprs/cond.d.ts +2 -2
  21. package/out/types/src/codegen/exprs/consume.d.ts +2 -2
  22. package/out/types/src/codegen/exprs/{drop_dup.d.ts → drop-dup.d.ts} +4 -4
  23. package/out/types/src/codegen/exprs/dyn.d.ts +2 -2
  24. package/out/types/src/codegen/exprs/expr.d.ts +2 -2
  25. package/out/types/src/codegen/exprs/gc.d.ts +2 -2
  26. package/out/types/src/codegen/exprs/generation.d.ts +2 -2
  27. package/out/types/src/codegen/exprs/{initialization_assignment.d.ts → initialization-assignment.d.ts} +2 -2
  28. package/out/types/src/codegen/exprs/{inline_fns.d.ts → inline-fns.d.ts} +2 -2
  29. package/out/types/src/codegen/exprs/iso.d.ts +2 -2
  30. package/out/types/src/codegen/exprs/match.d.ts +2 -2
  31. package/out/types/src/codegen/exprs/open.d.ts +2 -2
  32. package/out/types/src/codegen/exprs/{other_fn_call.d.ts → other-fn-call.d.ts} +2 -2
  33. package/out/types/src/codegen/exprs/panic.d.ts +2 -2
  34. package/out/types/src/codegen/exprs/parallelism.d.ts +2 -2
  35. package/out/types/src/codegen/exprs/{property_access.d.ts → property-access.d.ts} +2 -2
  36. package/out/types/src/codegen/exprs/{ptr_fns.d.ts → ptr-fns.d.ts} +2 -2
  37. package/out/types/src/codegen/exprs/{rc_fns.d.ts → rc-fns.d.ts} +2 -2
  38. package/out/types/src/codegen/exprs/recur.d.ts +2 -2
  39. package/out/types/src/codegen/exprs/return.d.ts +2 -2
  40. package/out/types/src/codegen/exprs/sizeof.d.ts +2 -2
  41. package/out/types/src/codegen/exprs/{tuple_fn.d.ts → tuple-fn.d.ts} +2 -2
  42. package/out/types/src/codegen/exprs/while.d.ts +2 -2
  43. package/out/types/src/codegen/functions/collection.d.ts +4 -3
  44. package/out/types/src/codegen/functions/context.d.ts +6 -6
  45. package/out/types/src/codegen/functions/declarations.d.ts +4 -4
  46. package/out/types/src/codegen/functions/dyn.d.ts +1 -1
  47. package/out/types/src/codegen/functions/generation.d.ts +5 -5
  48. package/out/types/src/codegen/types/collection.d.ts +4 -4
  49. package/out/types/src/codegen/types/dyn.d.ts +2 -2
  50. package/out/types/src/codegen/types/generation.d.ts +2 -2
  51. package/out/types/src/codegen/utils/fixup.d.ts +1 -1
  52. package/out/types/src/codegen/utils/index.d.ts +6 -6
  53. package/out/types/src/env.d.ts +34 -5
  54. package/out/types/src/error.d.ts +1 -1
  55. package/out/types/src/evaluator/async/await-analysis-types.d.ts +1 -1
  56. package/out/types/src/evaluator/async/await-analysis.d.ts +1 -1
  57. package/out/types/src/evaluator/builtins/alignof.d.ts +3 -3
  58. package/out/types/src/evaluator/builtins/{and_or.d.ts → and-or.d.ts} +3 -3
  59. package/out/types/src/evaluator/builtins/{array_fns.d.ts → array-fns.d.ts} +3 -3
  60. package/out/types/src/evaluator/builtins/as.d.ts +3 -3
  61. package/out/types/src/evaluator/builtins/{async_fns.d.ts → async-fns.d.ts} +3 -3
  62. package/out/types/src/evaluator/builtins/comptime-assert.d.ts +8 -0
  63. package/out/types/src/evaluator/builtins/comptime-bool-fns.d.ts +8 -0
  64. package/out/types/src/evaluator/builtins/comptime-expect-error.d.ts +8 -0
  65. package/out/types/src/evaluator/builtins/comptime-fn.d.ts +8 -0
  66. package/out/types/src/evaluator/builtins/comptime-list-fns.d.ts +33 -0
  67. package/out/types/src/evaluator/builtins/comptime-numeric-fns.d.ts +8 -0
  68. package/out/types/src/evaluator/builtins/comptime-print.d.ts +8 -0
  69. package/out/types/src/evaluator/builtins/comptime-string-fns.d.ts +8 -0
  70. package/out/types/src/evaluator/builtins/consume.d.ts +3 -3
  71. package/out/types/src/evaluator/builtins/drop.d.ts +3 -3
  72. package/out/types/src/evaluator/builtins/dup.d.ts +3 -3
  73. package/out/types/src/evaluator/builtins/{expr_fns.d.ts → expr-fns.d.ts} +3 -3
  74. package/out/types/src/evaluator/builtins/{future_fns.d.ts → future-fns.d.ts} +3 -3
  75. package/out/types/src/evaluator/builtins/gc.d.ts +3 -3
  76. package/out/types/src/evaluator/builtins/gensym.d.ts +3 -3
  77. package/out/types/src/evaluator/builtins/{impl_constraint.d.ts → impl-constraint.d.ts} +3 -3
  78. package/out/types/src/evaluator/builtins/{macro_expand.d.ts → macro-expand.d.ts} +3 -3
  79. package/out/types/src/evaluator/builtins/panic.d.ts +3 -3
  80. package/out/types/src/evaluator/builtins/process.d.ts +3 -3
  81. package/out/types/src/evaluator/builtins/{ptr_fns.d.ts → ptr-fns.d.ts} +3 -3
  82. package/out/types/src/evaluator/builtins/quote.d.ts +3 -3
  83. package/out/types/src/evaluator/builtins/{rc_fns.d.ts → rc-fns.d.ts} +3 -3
  84. package/out/types/src/evaluator/builtins/rc.d.ts +3 -3
  85. package/out/types/src/evaluator/builtins/sizeof.d.ts +3 -3
  86. package/out/types/src/evaluator/builtins/the.d.ts +3 -3
  87. package/out/types/src/evaluator/builtins/{type_fns.d.ts → type-fns.d.ts} +3 -3
  88. package/out/types/src/evaluator/builtins/{va_start.d.ts → va-start.d.ts} +3 -3
  89. package/out/types/src/evaluator/builtins/{var_fns.d.ts → var-fns.d.ts} +3 -3
  90. package/out/types/src/evaluator/calls/{array_type.d.ts → array-type.d.ts} +4 -4
  91. package/out/types/src/evaluator/calls/array.d.ts +5 -5
  92. package/out/types/src/evaluator/calls/{closure_type.d.ts → closure-type.d.ts} +4 -4
  93. package/out/types/src/evaluator/calls/comptime-fn.d.ts +19 -0
  94. package/out/types/src/evaluator/calls/comptime-list-type.d.ts +11 -0
  95. package/out/types/src/evaluator/calls/{function_type.d.ts → function-type.d.ts} +5 -5
  96. package/out/types/src/evaluator/calls/function.d.ts +6 -6
  97. package/out/types/src/evaluator/calls/helper.d.ts +6 -6
  98. package/out/types/src/evaluator/calls/iso.d.ts +4 -4
  99. package/out/types/src/evaluator/calls/{module_type.d.ts → module-type.d.ts} +4 -4
  100. package/out/types/src/evaluator/calls/{numeric_type.d.ts → numeric-type.d.ts} +4 -4
  101. package/out/types/src/evaluator/calls/{pointer_type.d.ts → pointer-type.d.ts} +4 -4
  102. package/out/types/src/evaluator/calls/pointer.d.ts +3 -3
  103. package/out/types/src/evaluator/calls/{trait_type.d.ts → trait-type.d.ts} +4 -4
  104. package/out/types/src/evaluator/calls/type.d.ts +4 -4
  105. package/out/types/src/evaluator/context.d.ts +6 -6
  106. package/out/types/src/evaluator/ctfe/ctfe-analysis.d.ts +5 -5
  107. package/out/types/src/evaluator/exprs/_expr.d.ts +3 -3
  108. package/out/types/src/evaluator/exprs/assignment.d.ts +3 -3
  109. package/out/types/src/evaluator/exprs/begin.d.ts +3 -3
  110. package/out/types/src/evaluator/exprs/binding.d.ts +3 -3
  111. package/out/types/src/evaluator/exprs/{c_include.d.ts → c-include.d.ts} +3 -3
  112. package/out/types/src/evaluator/exprs/cond.d.ts +3 -3
  113. package/out/types/src/evaluator/exprs/{destructuring_assignment.d.ts → destructuring-assignment.d.ts} +5 -5
  114. package/out/types/src/evaluator/exprs/expr.d.ts +3 -3
  115. package/out/types/src/evaluator/exprs/extern.d.ts +3 -3
  116. package/out/types/src/evaluator/exprs/{identifer_and_operator.d.ts → identifer-and-operator.d.ts} +3 -3
  117. package/out/types/src/evaluator/exprs/import.d.ts +3 -3
  118. package/out/types/src/evaluator/exprs/{initialization_assignment.d.ts → initialization-assignment.d.ts} +3 -3
  119. package/out/types/src/evaluator/exprs/match.d.ts +3 -3
  120. package/out/types/src/evaluator/exprs/open.d.ts +3 -3
  121. package/out/types/src/evaluator/exprs/{property_access.d.ts → property-access.d.ts} +3 -3
  122. package/out/types/src/evaluator/exprs/recur.d.ts +3 -3
  123. package/out/types/src/evaluator/exprs/runtime.d.ts +3 -3
  124. package/out/types/src/evaluator/exprs/subtype-of.d.ts +8 -0
  125. package/out/types/src/evaluator/exprs/test.d.ts +3 -3
  126. package/out/types/src/evaluator/exprs/typeof.d.ts +3 -3
  127. package/out/types/src/evaluator/exprs/while.d.ts +3 -3
  128. package/out/types/src/evaluator/index.d.ts +4 -4
  129. package/out/types/src/evaluator/trait-checking.d.ts +31 -0
  130. package/out/types/src/evaluator/types/array.d.ts +3 -3
  131. package/out/types/src/evaluator/types/closure.d.ts +3 -3
  132. package/out/types/src/evaluator/types/comptime-list.d.ts +8 -0
  133. package/out/types/src/evaluator/types/{concrete_trait.d.ts → concrete-trait.d.ts} +3 -3
  134. package/out/types/src/evaluator/types/dyn.d.ts +3 -3
  135. package/out/types/src/evaluator/types/enum.d.ts +3 -3
  136. package/out/types/src/evaluator/types/{expr_synthesizer.d.ts → expr-synthesizer.d.ts} +4 -4
  137. package/out/types/src/evaluator/types/field.d.ts +4 -4
  138. package/out/types/src/evaluator/types/{fn_trait.d.ts → fn-trait.d.ts} +3 -3
  139. package/out/types/src/evaluator/types/function.d.ts +16 -10
  140. package/out/types/src/evaluator/types/{future_trait.d.ts → future-trait.d.ts} +3 -3
  141. package/out/types/src/evaluator/types/module.d.ts +4 -4
  142. package/out/types/src/evaluator/types/newtype.d.ts +3 -3
  143. package/out/types/src/evaluator/types/object.d.ts +3 -3
  144. package/out/types/src/evaluator/types/slice.d.ts +3 -3
  145. package/out/types/src/evaluator/types/struct.d.ts +3 -3
  146. package/out/types/src/evaluator/types/synthesizer.d.ts +2 -2
  147. package/out/types/src/evaluator/types/trait.d.ts +4 -4
  148. package/out/types/src/evaluator/types/tuple.d.ts +4 -4
  149. package/out/types/src/evaluator/types/union.d.ts +3 -3
  150. package/out/types/src/evaluator/types/utils.d.ts +84 -5
  151. package/out/types/src/evaluator/types/validation.d.ts +2 -2
  152. package/out/types/src/evaluator/utils/closure.d.ts +7 -7
  153. package/out/types/src/evaluator/utils.d.ts +2 -2
  154. package/out/types/src/evaluator/values/{anonymous_function.d.ts → anonymous-function.d.ts} +3 -3
  155. package/out/types/src/evaluator/values/{anonymous_module.d.ts → anonymous-module.d.ts} +5 -5
  156. package/out/types/src/evaluator/values/{anonymous_struct.d.ts → anonymous-struct.d.ts} +3 -3
  157. package/out/types/src/evaluator/values/array.d.ts +3 -3
  158. package/out/types/src/evaluator/values/boolean.d.ts +2 -2
  159. package/out/types/src/evaluator/values/char.d.ts +2 -2
  160. package/out/types/src/evaluator/values/{clone_value.d.ts → clone-value.d.ts} +1 -1
  161. package/out/types/src/evaluator/values/comptime-list.d.ts +8 -0
  162. package/out/types/src/evaluator/values/dyn.d.ts +3 -3
  163. package/out/types/src/evaluator/values/float.d.ts +3 -3
  164. package/out/types/src/evaluator/values/impl.d.ts +5 -5
  165. package/out/types/src/evaluator/values/integer.d.ts +3 -3
  166. package/out/types/src/evaluator/values/string.d.ts +2 -2
  167. package/out/types/src/evaluator/values/tuple.d.ts +5 -5
  168. package/out/types/src/expr.d.ts +283 -283
  169. package/out/types/src/function-value.d.ts +6 -6
  170. package/out/types/src/index.d.ts +3 -0
  171. package/out/types/src/lexer.d.ts +1 -1
  172. package/out/types/src/module-manager.d.ts +1 -1
  173. package/out/types/src/parser.d.ts +2 -2
  174. package/out/types/src/test-runner.d.ts +1 -1
  175. package/out/types/src/type-value.d.ts +1 -1
  176. package/out/types/src/types/compatibility.d.ts +2 -2
  177. package/out/types/src/types/creators.d.ts +29 -16
  178. package/out/types/src/types/definitions.d.ts +29 -26
  179. package/out/types/src/types/env-lookup.d.ts +4 -0
  180. package/out/types/src/types/guards.d.ts +6 -6
  181. package/out/types/src/types/hierarchy.d.ts +2 -2
  182. package/out/types/src/types/tags.d.ts +4 -4
  183. package/out/types/src/types/utils.d.ts +13 -38
  184. package/out/types/src/unit-value.d.ts +1 -1
  185. package/out/types/src/value-tag.d.ts +4 -4
  186. package/out/types/src/value.d.ts +32 -26
  187. package/out/types/tsconfig.tsbuildinfo +1 -1
  188. package/package.json +3 -1
  189. package/std/allocator.yo +5 -5
  190. package/std/collections/array_list.yo +394 -390
  191. package/std/collections/hash_map.yo +411 -406
  192. package/std/collections/hash_set.yo +646 -642
  193. package/std/collections/linked_list.yo +347 -341
  194. package/std/io.yo +55 -53
  195. package/std/path.yo +17 -16
  196. package/std/prelude.yo +1587 -1455
  197. package/std/string/rune.yo +25 -24
  198. package/std/string/string.yo +46 -43
  199. package/std/sync.yo +50 -30
  200. package/std/thread.yo +6 -5
  201. package/std/time.yo +1 -1
  202. package/out/types/src/codegen/exprs/compt_value.d.ts +0 -4
  203. package/out/types/src/codegen/types/index.d.ts +0 -3
  204. package/out/types/src/codegen/values/index.d.ts +0 -1
  205. package/out/types/src/evaluator/builtins/compt_assert.d.ts +0 -8
  206. package/out/types/src/evaluator/builtins/compt_boolean_fns.d.ts +0 -8
  207. package/out/types/src/evaluator/builtins/compt_expect_error.d.ts +0 -8
  208. package/out/types/src/evaluator/builtins/compt_fn.d.ts +0 -8
  209. package/out/types/src/evaluator/builtins/compt_list_fns.d.ts +0 -33
  210. package/out/types/src/evaluator/builtins/compt_numeric_fns.d.ts +0 -8
  211. package/out/types/src/evaluator/builtins/compt_print.d.ts +0 -8
  212. package/out/types/src/evaluator/builtins/compt_string_fns.d.ts +0 -8
  213. package/out/types/src/evaluator/calls/compt_function.d.ts +0 -19
  214. package/out/types/src/evaluator/calls/compt_list_type.d.ts +0 -11
  215. package/out/types/src/evaluator/exprs/subtype_of.d.ts +0 -21
  216. package/out/types/src/evaluator/types/compt_list.d.ts +0 -8
  217. package/out/types/src/evaluator/values/anonymous_trait.d.ts +0 -17
  218. package/out/types/src/evaluator/values/compt_list.d.ts +0 -8
  219. package/out/types/src/types/constants.d.ts +0 -5
  220. package/out/types/src/types/index.d.ts +0 -8
  221. package/std/allocators/c_allocator.yo +0 -118
  222. package/std/index.yo +0 -12
@@ -54,7 +54,7 @@ MAX_LOAD_FACTOR_DENOMINATOR :: usize(8);
54
54
  /**
55
55
  * Bucket - Internal structure to store key-value pairs
56
56
  */
57
- Bucket :: (fn(compt(K): Type, compt(V): Type) -> compt(Type))
57
+ Bucket :: (fn(comptime(K): Type, comptime(V): Type) -> comptime(Type))
58
58
  struct(
59
59
  key : K,
60
60
  value : V
@@ -85,442 +85,447 @@ h1_hash :: (fn(hash: u64, capacity: usize) -> usize)
85
85
  * - size: Current number of occupied buckets
86
86
  */
87
87
  HashMap :: (fn(
88
- compt(K): Type,
89
- compt(V): Type,
88
+ comptime(K): Type,
89
+ comptime(V): Type,
90
90
  where(K <: (Eq(K), Hash))
91
- ) -> compt(Type))
91
+ ) -> comptime(Type))
92
92
  object(
93
93
  ctrl : ?*(u8),
94
94
  data : ?*(Bucket(K, V)),
95
95
  capacity : usize,
96
- size : usize,
96
+ size : usize
97
+ )
98
+ ;
97
99
 
98
- /**
99
- * Allocate memory for HashMap with given capacity
100
- * Initializes all control bytes to EMPTY
101
- */
102
- _alloc_with_capacity :: (fn(capacity: usize) -> Result(Self, HashMapError))(
103
- {
104
- bucket_size :: sizeof(Bucket(K, V));
105
- ctrl_size := capacity;
106
- data_size := (capacity * bucket_size);
107
-
108
- ctrl_result := malloc(ctrl_size);
109
- match(ctrl_result,
110
- .None => .Err(.AllocError(error: .OutOfMemory)),
111
- .Some(ctrl_void_ptr) => {
112
- ctrl_ptr := *(u8)(ctrl_void_ptr);
113
-
114
- data_result := malloc(data_size);
115
- match(data_result,
116
- .None => {
117
- free(.Some(*(void)(ctrl_ptr)));
118
- .Err(.AllocError(error: .OutOfMemory))
119
- },
120
- .Some(data_void_ptr) => {
121
- data_ptr := *(Bucket(K, V))(data_void_ptr);
122
-
123
- i := usize(0);
124
- while(i < capacity, i = (i + usize(1)), {
125
- (ctrl_ptr &+ i).* = CTRL_EMPTY;
126
- });
127
-
128
- .Ok(Self(
129
- ctrl: .Some(ctrl_ptr),
130
- data: .Some(data_ptr),
131
- capacity: capacity,
132
- size: usize(0)
133
- ))
134
- }
135
- )
136
- }
137
- )
138
- }
139
- ),
100
+ impl(forall(K : Type, V : Type), where(K <: (Eq(K), Hash)), HashMap(K, V),
101
+ /**
102
+ * Allocate memory for HashMap with given capacity
103
+ * Initializes all control bytes to EMPTY
104
+ */
105
+ _alloc_with_capacity : (fn(capacity: usize) -> Result(Self, HashMapError))(
106
+ {
107
+ bucket_size :: sizeof(Bucket(K, V));
108
+ ctrl_size := capacity;
109
+ data_size := (capacity * bucket_size);
110
+
111
+ ctrl_result := malloc(ctrl_size);
112
+ match(ctrl_result,
113
+ .None => .Err(.AllocError(error: .OutOfMemory)),
114
+ .Some(ctrl_void_ptr) => {
115
+ ctrl_ptr := *(u8)(ctrl_void_ptr);
116
+
117
+ data_result := malloc(data_size);
118
+ match(data_result,
119
+ .None => {
120
+ free(.Some(*(void)(ctrl_ptr)));
121
+ .Err(.AllocError(error: .OutOfMemory))
122
+ },
123
+ .Some(data_void_ptr) => {
124
+ data_ptr := *(Bucket(K, V))(data_void_ptr);
125
+
126
+ i := usize(0);
127
+ while(i < capacity, i = (i + usize(1)), {
128
+ (ctrl_ptr &+ i).* = CTRL_EMPTY;
129
+ });
130
+
131
+ .Ok(Self(
132
+ ctrl: .Some(ctrl_ptr),
133
+ data: .Some(data_ptr),
134
+ capacity: capacity,
135
+ size: usize(0)
136
+ ))
137
+ }
138
+ )
139
+ }
140
+ )
141
+ }
142
+ ),
140
143
 
141
- /**
142
- * Create a new empty HashMap with default capacity
143
- */
144
- new :: (fn() -> Self)({
145
- result := Self._alloc_with_capacity(DEFAULT_CAPACITY);
144
+ /**
145
+ * Create a new empty HashMap with default capacity
146
+ */
147
+ new : (fn() -> Self)({
148
+ result := Self._alloc_with_capacity(DEFAULT_CAPACITY);
149
+ match(result,
150
+ .Ok(map) => map,
151
+ .Err(_) => panic("Failed to allocate HashMap")
152
+ )
153
+ }),
154
+
155
+ /**
156
+ * Create a HashMap with a specific initial capacity
157
+ * Capacity will be rounded up to next power of 2
158
+ */
159
+ with_capacity : (fn(requested_capacity: usize) -> Self)(
160
+ {
161
+ capacity := cond(
162
+ (requested_capacity < DEFAULT_CAPACITY) => DEFAULT_CAPACITY,
163
+ true => {
164
+ c := requested_capacity;
165
+ c = (c - usize(1));
166
+ c = (c | (c >> usize(1)));
167
+ c = (c | (c >> usize(2)));
168
+ c = (c | (c >> usize(4)));
169
+ c = (c | (c >> usize(8)));
170
+ c = (c | (c >> usize(16)));
171
+ (c + usize(1))
172
+ }
173
+ );
174
+
175
+ result := Self._alloc_with_capacity(capacity);
146
176
  match(result,
147
177
  .Ok(map) => map,
148
178
  .Err(_) => panic("Failed to allocate HashMap")
149
179
  )
150
- }),
180
+ }
181
+ ),
151
182
 
152
- /**
153
- * Create a HashMap with a specific initial capacity
154
- * Capacity will be rounded up to next power of 2
155
- */
156
- with_capacity :: (fn(requested_capacity: usize) -> Self)(
157
- {
158
- capacity := cond(
159
- (requested_capacity < DEFAULT_CAPACITY) => DEFAULT_CAPACITY,
160
- true => {
161
- c := requested_capacity;
162
- c = (c - usize(1));
163
- c = (c | (c >> usize(1)));
164
- c = (c | (c >> usize(2)));
165
- c = (c | (c >> usize(4)));
166
- c = (c | (c >> usize(8)));
167
- c = (c | (c >> usize(16)));
168
- (c + usize(1))
169
- }
170
- );
171
-
172
- result := Self._alloc_with_capacity(capacity);
173
- match(result,
174
- .Ok(map) => map,
175
- .Err(_) => panic("Failed to allocate HashMap")
176
- )
177
- }
178
- ),
183
+ /**
184
+ * Get ctrl pointer (unwrapped for internal use)
185
+ */
186
+ _ctrl_ptr : (fn(self: Self) -> *(u8))(
187
+ match(self.ctrl,
188
+ .Some(ptr) => ptr,
189
+ .None => panic("HashMap ctrl pointer is null")
190
+ )
191
+ ),
179
192
 
180
- /**
181
- * Get ctrl pointer (unwrapped for internal use)
182
- */
183
- _ctrl_ptr :: (fn(self: Self) -> *(u8))(
184
- match(self.ctrl,
185
- .Some(ptr) => ptr,
186
- .None => panic("HashMap ctrl pointer is null")
187
- )
188
- ),
189
-
190
- /**
191
- * Get data pointer (unwrapped for internal use)
192
- */
193
- _data_ptr :: (fn(self: Self) -> *(Bucket(K, V)))(
194
- match(self.data,
195
- .Some(ptr) => ptr,
196
- .None => panic("HashMap data pointer is null")
197
- )
198
- ),
199
-
200
- /**
201
- * Find bucket index for a given key using quadratic probing
202
- * Returns Some(index) if key is found, None otherwise
203
- */
204
- _find_bucket :: (fn(self: Self, key: K, hash: u64) -> Option(usize))(
205
- {
206
- h2 := h2_hash(hash);
207
- index := h1_hash(hash, self.capacity);
208
- probe := usize(0);
209
- ctrl_ptr := self._ctrl_ptr();
210
- data_ptr := self._data_ptr();
211
-
212
- while(probe < self.capacity, probe = (probe + usize(1)), {
213
- probe_index := ((index + probe) % self.capacity);
214
- ctrl_byte := (ctrl_ptr &+ probe_index).*;
215
-
216
- cond(
217
- (ctrl_byte == CTRL_EMPTY) => {
218
- return .None;
219
- },
220
- (ctrl_byte == h2) => {
221
- bucket := (data_ptr &+ probe_index).*;
222
- cond(
223
- (bucket.key == key) => {
224
- return .Some(probe_index);
225
- },
226
- true => ()
227
- );
228
- },
229
- true => ()
230
- );
231
- });
232
-
233
- .None
234
- }
235
- ),
193
+ /**
194
+ * Get data pointer (unwrapped for internal use)
195
+ */
196
+ _data_ptr : (fn(self: Self) -> *(Bucket(K, V)))(
197
+ match(self.data,
198
+ .Some(ptr) => ptr,
199
+ .None => panic("HashMap data pointer is null")
200
+ )
201
+ ),
236
202
 
237
- /**
238
- * Find first available bucket (EMPTY or DELETED) for insertion
239
- * Returns bucket index using quadratic probing
240
- */
241
- _find_insert_bucket :: (fn(self: Self, hash: u64) -> usize)(
242
- {
243
- index := h1_hash(hash, self.capacity);
244
- probe := usize(0);
245
- ctrl_ptr := self._ctrl_ptr();
246
-
247
- while(probe < self.capacity, probe = (probe + usize(1)), {
248
- probe_index := ((index + probe) % self.capacity);
249
- ctrl_byte := (ctrl_ptr &+ probe_index).*;
250
-
251
- cond(
252
- ((ctrl_byte == CTRL_EMPTY) || (ctrl_byte == CTRL_DELETED)) => {
253
- return probe_index;
254
- },
255
- true => ()
256
- );
257
- });
203
+ /**
204
+ * Find bucket index for a given key using quadratic probing
205
+ * Returns Some(index) if key is found, None otherwise
206
+ */
207
+ _find_bucket : (fn(self: Self, key: K, hash: u64) -> Option(usize))(
208
+ {
209
+ h2 := h2_hash(hash);
210
+ index := h1_hash(hash, self.capacity);
211
+ probe := usize(0);
212
+ ctrl_ptr := Self._ctrl_ptr(self);
213
+ data_ptr := Self._data_ptr(self);
214
+
215
+ while(probe < self.capacity, probe = (probe + usize(1)), {
216
+ probe_index := ((index + probe) % self.capacity);
217
+ ctrl_byte := (ctrl_ptr &+ probe_index).*;
258
218
 
259
- panic("HashMap is full - should have resized")
260
- }
261
- ),
262
-
263
- /**
264
- * Check if HashMap needs resizing based on load factor
265
- */
266
- _needs_resize :: ((fn(self: Self) -> bool)
267
- {
268
- threshold := ((self.capacity * MAX_LOAD_FACTOR_NUMERATOR) / MAX_LOAD_FACTOR_DENOMINATOR);
269
- (self.size >= threshold)
270
- }
271
- ),
272
-
273
- /**
274
- * Resize and rehash the HashMap to a new capacity
275
- */
276
- _resize :: (fn(self: Self, new_capacity: usize) -> Result(unit, HashMapError))(
277
- {
278
- result := Self._alloc_with_capacity(new_capacity);
279
- match(result,
280
- .Err(err) => .Err(err),
281
- .Ok(new_map) => {
282
- i := usize(0);
283
- ctrl_ptr := self._ctrl_ptr();
284
- data_ptr := self._data_ptr();
285
- while(i < self.capacity, i = (i + usize(1)), {
286
- ctrl_byte := (ctrl_ptr &+ i).*;
287
- cond(
288
- ((ctrl_byte != CTRL_EMPTY) && (ctrl_byte != CTRL_DELETED)) => {
289
- bucket := (data_ptr &+ i).*;
290
- hash := (bucket.key).hash();
291
- h2 := h2_hash(hash);
292
- new_index := new_map._find_insert_bucket(hash);
293
-
294
- new_ctrl_ptr := new_map._ctrl_ptr();
295
- new_data_ptr := new_map._data_ptr();
296
- (new_ctrl_ptr &+ new_index).* = h2;
297
- consume((new_data_ptr &+ new_index).* = bucket);
298
- new_map.size = (new_map.size + usize(1));
299
- },
300
- true => ()
301
- );
302
- });
303
-
304
- // Drop old buckets before freeing old data array
305
- // (bucket := ... above duped them, so we need to drop the old refs)
219
+ cond(
220
+ (ctrl_byte == CTRL_EMPTY) => {
221
+ return .None;
222
+ },
223
+ (ctrl_byte == h2) => {
224
+ bucket := (data_ptr &+ probe_index).*;
306
225
  cond(
307
- (Type.contains_rc_type(K) || Type.contains_rc_type(V)) => {
308
- j := usize(0);
309
- while(j < self.capacity, j = (j + usize(1)), {
310
- ctrl_byte := (ctrl_ptr &+ j).*;
311
- cond(
312
- ((ctrl_byte != CTRL_EMPTY) && (ctrl_byte != CTRL_DELETED)) => {
313
- bucket_ptr := (data_ptr &+ j);
314
- cond(
315
- Type.contains_rc_type(K) => unsafe.drop((bucket_ptr.*).key),
316
- true => ()
317
- );
318
- cond(
319
- Type.contains_rc_type(V) => unsafe.drop((bucket_ptr.*).value),
320
- true => ()
321
- );
322
- },
323
- true => ()
324
- );
325
- });
226
+ (bucket.key == key) => {
227
+ return .Some(probe_index);
326
228
  },
327
229
  true => ()
328
230
  );
329
-
330
- match(self.ctrl,
331
- .Some(ptr) => free(.Some(*(void)(ptr))),
332
- .None => ()
333
- );
334
- match(self.data,
335
- .Some(ptr) => free(.Some(*(void)(ptr))),
336
- .None => ()
337
- );
338
-
339
- self.ctrl = new_map.ctrl;
340
- self.data = new_map.data;
341
- self.capacity = new_map.capacity;
342
-
343
- new_map.ctrl = .None;
344
- new_map.data = .None;
345
-
346
- .Ok(())
347
- }
348
- )
349
- }
350
- ),
231
+ },
232
+ true => ()
233
+ );
234
+ });
235
+
236
+ .None
237
+ }
238
+ ),
351
239
 
352
- /**
353
- * Insert or update a key-value pair
354
- * Returns Ok(Some(old_value)) if key existed, Ok(None) if new key
355
- */
356
- set :: ((fn(self: Self, key: K, value: V) -> Result(Option(V), HashMapError))
357
- {
358
- hash := key.hash();
359
- bucket_opt := self._find_bucket(key, hash);
240
+ /**
241
+ * Find first available bucket (EMPTY or DELETED) for insertion
242
+ * Returns bucket index using quadratic probing
243
+ */
244
+ _find_insert_bucket : (fn(self: Self, hash: u64) -> usize)(
245
+ {
246
+ index := h1_hash(hash, self.capacity);
247
+ probe := usize(0);
248
+ ctrl_ptr := Self._ctrl_ptr(self);
249
+
250
+ while(probe < self.capacity, probe = (probe + usize(1)), {
251
+ probe_index := ((index + probe) % self.capacity);
252
+ ctrl_byte := (ctrl_ptr &+ probe_index).*;
360
253
 
361
- match(bucket_opt,
362
- .Some(index) => {
363
- data_ptr := self._data_ptr();
364
- old_bucket := (data_ptr &+ index).*;
365
- old_value := old_bucket.value;
366
- new_bucket := Bucket(K, V)(key: key, value: value);
367
- // Don't use consume here - we want to drop the old bucket at memory
368
- // Note: old_bucket already duped it, so dropping here decrements to RC=1
369
- // Then old_bucket goes out of scope and drops again to RC=0
370
- // But wait - we return old_value which was duped from old_bucket...
371
- // Actually the Bucket struct contains RC types, so assignment drops old + dups new
372
- (data_ptr &+ index).* = new_bucket;
373
- .Ok(.Some(old_value))
254
+ cond(
255
+ ((ctrl_byte == CTRL_EMPTY) || (ctrl_byte == CTRL_DELETED)) => {
256
+ return probe_index;
374
257
  },
375
- .None => {
376
- resize_check := cond(
377
- (self._needs_resize()) => {
378
- new_capacity := (self.capacity * usize(2));
379
- self._resize(new_capacity)
380
- },
381
- true => (Result(unit, HashMapError).Ok(()))
382
- );
383
-
384
- match(resize_check,
385
- .Err(err) => .Err(err),
386
- .Ok(_) => {
258
+ true => ()
259
+ );
260
+ });
261
+
262
+ panic("HashMap is full - should have resized")
263
+ }
264
+ ),
265
+
266
+ /**
267
+ * Check if HashMap needs resizing based on load factor
268
+ */
269
+ _needs_resize : ((fn(self: Self) -> bool)
270
+ {
271
+ threshold := ((self.capacity * MAX_LOAD_FACTOR_NUMERATOR) / MAX_LOAD_FACTOR_DENOMINATOR);
272
+ (self.size >= threshold)
273
+ }
274
+ ),
275
+
276
+ /**
277
+ * Resize and rehash the HashMap to a new capacity
278
+ */
279
+ _resize : (fn(self: Self, new_capacity: usize) -> Result(unit, HashMapError))(
280
+ {
281
+ result := Self._alloc_with_capacity(new_capacity);
282
+ match(result,
283
+ .Err(err) => .Err(err),
284
+ .Ok(new_map) => {
285
+ i := usize(0);
286
+ ctrl_ptr := Self._ctrl_ptr(self);
287
+ data_ptr := Self._data_ptr(self);
288
+ while(i < self.capacity, i = (i + usize(1)), {
289
+ ctrl_byte := (ctrl_ptr &+ i).*;
290
+ cond(
291
+ ((ctrl_byte != CTRL_EMPTY) && (ctrl_byte != CTRL_DELETED)) => {
292
+ bucket := (data_ptr &+ i).*;
293
+ hash := (bucket.key).hash();
387
294
  h2 := h2_hash(hash);
388
- index := self._find_insert_bucket(hash);
389
-
390
- ctrl_ptr := self._ctrl_ptr();
391
- data_ptr := self._data_ptr();
392
- (ctrl_ptr &+ index).* = h2;
393
- new_bucket := Bucket(K, V)(key: key, value: value);
394
- consume((data_ptr &+ index).* = new_bucket);
395
- self.size = (self.size + usize(1));
295
+ new_index := Self._find_insert_bucket(new_map, hash);
396
296
 
397
- .Ok(.None)
398
- }
399
- )
400
- }
401
- )
402
- }
403
- ),
297
+ new_ctrl_ptr := Self._ctrl_ptr(new_map);
298
+ new_data_ptr := Self._data_ptr(new_map);
299
+ (new_ctrl_ptr &+ new_index).* = h2;
300
+ consume((new_data_ptr &+ new_index).* = bucket);
301
+ new_map.size = (new_map.size + usize(1));
302
+ },
303
+ true => ()
304
+ );
305
+ });
404
306
 
405
- /**
406
- * Get a value by key
407
- * Returns Some(value) if found, None otherwise
408
- */
409
- get :: ((fn(self: Self, key: K) -> Option(V))
410
- {
411
- hash := key.hash();
412
- bucket_opt := self._find_bucket(key, hash);
413
- match(bucket_opt,
414
- .Some(index) => {
415
- data_ptr := self._data_ptr();
416
- bucket := (data_ptr &+ index).*;
417
- .Some(bucket.value)
418
- },
419
- .None => .None
420
- )
421
- }
422
- ),
307
+ // Drop old buckets before freeing old data array
308
+ // (bucket := ... above duped them, so we need to drop the old refs)
309
+ cond(
310
+ (Type.contains_rc_type(K) || Type.contains_rc_type(V)) => {
311
+ j := usize(0);
312
+ while(j < self.capacity, j = (j + usize(1)), {
313
+ ctrl_byte := (ctrl_ptr &+ j).*;
314
+ cond(
315
+ ((ctrl_byte != CTRL_EMPTY) && (ctrl_byte != CTRL_DELETED)) => {
316
+ bucket_ptr := (data_ptr &+ j);
317
+ cond(
318
+ Type.contains_rc_type(K) => unsafe.drop((bucket_ptr.*).key),
319
+ true => ()
320
+ );
321
+ cond(
322
+ Type.contains_rc_type(V) => unsafe.drop((bucket_ptr.*).value),
323
+ true => ()
324
+ );
325
+ },
326
+ true => ()
327
+ );
328
+ });
329
+ },
330
+ true => ()
331
+ );
332
+
333
+ match(self.ctrl,
334
+ .Some(ptr) => free(.Some(*(void)(ptr))),
335
+ .None => ()
336
+ );
337
+ match(self.data,
338
+ .Some(ptr) => free(.Some(*(void)(ptr))),
339
+ .None => ()
340
+ );
341
+
342
+ self.ctrl = new_map.ctrl;
343
+ self.data = new_map.data;
344
+ self.capacity = new_map.capacity;
345
+
346
+ new_map.ctrl = .None;
347
+ new_map.data = .None;
348
+
349
+ .Ok(())
350
+ }
351
+ )
352
+ }
353
+ ),
423
354
 
424
- /**
425
- * Check if a key exists in the map
426
- */
427
- has :: ((fn(self: Self, key: K) -> bool)
428
- {
429
- hash := key.hash();
430
- bucket_opt := self._find_bucket(key, hash);
431
- match(bucket_opt,
432
- .Some(_) => true,
433
- .None => false
434
- )
435
- }
436
- ),
355
+ /**
356
+ * Insert or update a key-value pair
357
+ * Returns Ok(Some(old_value)) if key existed, Ok(None) if new key
358
+ */
359
+ set : ((fn(self: Self, key: K, value: V) -> Result(Option(V), HashMapError))
360
+ {
361
+ hash := key.hash();
362
+ bucket_opt := Self._find_bucket(self, key, hash);
363
+
364
+ match(bucket_opt,
365
+ .Some(index) => {
366
+ data_ptr := Self._data_ptr(self);
367
+ old_bucket := (data_ptr &+ index).*;
368
+ old_value := old_bucket.value;
369
+ new_bucket := Bucket(K, V)(key: key, value: value);
370
+ // Don't use consume here - we want to drop the old bucket at memory
371
+ // Note: old_bucket already duped it, so dropping here decrements to RC=1
372
+ // Then old_bucket goes out of scope and drops again to RC=0
373
+ // But wait - we return old_value which was duped from old_bucket...
374
+ // Actually the Bucket struct contains RC types, so assignment drops old + dups new
375
+ (data_ptr &+ index).* = new_bucket;
376
+ .Ok(.Some(old_value))
377
+ },
378
+ .None => {
379
+ resize_check := cond(
380
+ (Self._needs_resize(self)) => {
381
+ new_capacity := (self.capacity * usize(2));
382
+ Self._resize(self, new_capacity)
383
+ },
384
+ true => (Result(unit, HashMapError).Ok(()))
385
+ );
386
+
387
+ match(resize_check,
388
+ .Err(err) => .Err(err),
389
+ .Ok(_) => {
390
+ h2 := h2_hash(hash);
391
+ index := Self._find_insert_bucket(self, hash);
392
+
393
+ ctrl_ptr := Self._ctrl_ptr(self);
394
+ data_ptr := Self._data_ptr(self);
395
+ (ctrl_ptr &+ index).* = h2;
396
+ new_bucket := Bucket(K, V)(key: key, value: value);
397
+ consume((data_ptr &+ index).* = new_bucket);
398
+ self.size = (self.size + usize(1));
399
+
400
+ .Ok(.None)
401
+ }
402
+ )
403
+ }
404
+ )
405
+ }
406
+ ),
437
407
 
438
- /**
439
- * Remove a key-value pair by key
440
- * Returns Some(value) if the key was found and removed, None otherwise
441
- */
442
- remove :: ((fn(self: Self, key: K) -> Option(V))
443
- {
444
- hash := key.hash();
445
- bucket_opt := self._find_bucket(key, hash);
446
- match(bucket_opt,
447
- .Some(index) => {
448
- data_ptr := self._data_ptr();
449
- ctrl_ptr := self._ctrl_ptr();
450
- bucket_ptr := (data_ptr &+ index);
451
-
452
- // Read and dup value for return
453
- value := bucket_ptr.*.value;
454
-
455
- // Drop the bucket's key (we're removing it)
456
- unsafe.drop(bucket_ptr.*.key);
457
-
458
- // Drop the bucket's value extra ref (we duped it above)
459
- unsafe.drop(bucket_ptr.*.value);
460
-
461
- (ctrl_ptr &+ index).* = CTRL_DELETED;
462
- self.size = (self.size - usize(1));
463
-
464
- .Some(value)
465
- },
466
- .None => .None
467
- )
468
- }
469
- ),
408
+ /**
409
+ * Get a value by key
410
+ * Returns Some(value) if found, None otherwise
411
+ */
412
+ get : ((fn(self: Self, key: K) -> Option(V))
413
+ {
414
+ hash := key.hash();
415
+ bucket_opt := Self._find_bucket(self, key, hash);
416
+ match(bucket_opt,
417
+ .Some(index) => {
418
+ data_ptr := Self._data_ptr(self);
419
+ bucket := (data_ptr &+ index).*;
420
+ .Some(bucket.value)
421
+ },
422
+ .None => .None
423
+ )
424
+ }
425
+ ),
470
426
 
471
- /**
472
- * Get the number of key-value pairs in the map
473
- */
474
- len :: ((fn(self: Self) -> usize)
475
- self.size
476
- ),
427
+ /**
428
+ * Check if a key exists in the map
429
+ */
430
+ has : ((fn(self: Self, key: K) -> bool)
431
+ {
432
+ hash := key.hash();
433
+ bucket_opt := Self._find_bucket(self, key, hash);
434
+ match(bucket_opt,
435
+ .Some(_) => true,
436
+ .None => false
437
+ )
438
+ }
439
+ ),
477
440
 
478
- /**
479
- * Check if the map is empty
480
- */
481
- is_empty :: ((fn(self: Self) -> bool)
482
- (self.size == usize(0))
483
- ),
441
+ /**
442
+ * Remove a key-value pair by key
443
+ * Returns Some(value) if the key was found and removed, None otherwise
444
+ */
445
+ remove : ((fn(self: Self, key: K) -> Option(V))
446
+ {
447
+ hash := key.hash();
448
+ bucket_opt := Self._find_bucket(self, key, hash);
449
+ match(bucket_opt,
450
+ .Some(index) => {
451
+ data_ptr := Self._data_ptr(self);
452
+ ctrl_ptr := Self._ctrl_ptr(self);
453
+ bucket_ptr := (data_ptr &+ index);
454
+
455
+ // Read and dup value for return
456
+ value := bucket_ptr.*.value;
457
+
458
+ // Drop the bucket's key (we're removing it)
459
+ unsafe.drop(bucket_ptr.*.key);
460
+
461
+ // Drop the bucket's value extra ref (we duped it above)
462
+ unsafe.drop(bucket_ptr.*.value);
463
+
464
+ (ctrl_ptr &+ index).* = CTRL_DELETED;
465
+ self.size = (self.size - usize(1));
466
+
467
+ .Some(value)
468
+ },
469
+ .None => .None
470
+ )
471
+ }
472
+ ),
484
473
 
485
- /**
486
- * Clear all key-value pairs
487
- * Resets all control bytes to EMPTY
488
- */
489
- clear :: ((fn(self: Self) -> unit)
490
- {
491
- // Drop all occupied buckets before clearing
492
- cond(
493
- (Type.contains_rc_type(K) || Type.contains_rc_type(V)) => {
494
- ctrl_ptr := self._ctrl_ptr();
495
- data_ptr := self._data_ptr();
496
- i := usize(0);
497
- while(i < self.capacity, i = (i + usize(1)), {
498
- ctrl_byte := (ctrl_ptr &+ i).*;
499
- cond(
500
- ((ctrl_byte != CTRL_EMPTY) && (ctrl_byte != CTRL_DELETED)) => {
501
- bucket_ptr := (data_ptr &+ i);
502
- unsafe.drop(bucket_ptr.*);
503
- },
504
- true => ()
505
- );
506
- });
507
- },
508
- true => ()
509
- );
510
-
511
- ctrl_ptr := self._ctrl_ptr();
512
- i := usize(0);
513
- while(i < self.capacity, i = (i + usize(1)), {
514
- (ctrl_ptr &+ i).* = CTRL_EMPTY;
515
- });
516
- self.size = usize(0);
517
- }
518
- ),
474
+ /**
475
+ * Get the number of key-value pairs in the map
476
+ */
477
+ len : ((fn(self: Self) -> usize)
478
+ self.size
479
+ ),
480
+
481
+ /**
482
+ * Check if the map is empty
483
+ */
484
+ is_empty : ((fn(self: Self) -> bool)
485
+ (self.size == usize(0))
486
+ ),
519
487
 
488
+ /**
489
+ * Clear all key-value pairs
490
+ * Resets all control bytes to EMPTY
491
+ */
492
+ clear : ((fn(self: Self) -> unit)
493
+ {
494
+ // Drop all occupied buckets before clearing
495
+ cond(
496
+ (Type.contains_rc_type(K) || Type.contains_rc_type(V)) => {
497
+ ctrl_ptr := Self._ctrl_ptr(self);
498
+ data_ptr := Self._data_ptr(self);
499
+ i := usize(0);
500
+ while(i < self.capacity, i = (i + usize(1)), {
501
+ ctrl_byte := (ctrl_ptr &+ i).*;
502
+ cond(
503
+ ((ctrl_byte != CTRL_EMPTY) && (ctrl_byte != CTRL_DELETED)) => {
504
+ bucket_ptr := (data_ptr &+ i);
505
+ unsafe.drop(bucket_ptr.*);
506
+ },
507
+ true => ()
508
+ );
509
+ });
510
+ },
511
+ true => ()
512
+ );
513
+
514
+ ctrl_ptr := Self._ctrl_ptr(self);
515
+ i := usize(0);
516
+ while(i < self.capacity, i = (i + usize(1)), {
517
+ (ctrl_ptr &+ i).* = CTRL_EMPTY;
518
+ });
519
+ self.size = usize(0);
520
+ }
521
+ )
522
+ );
523
+ impl(forall(K : Type, V : Type), where(K <: (Eq(K), Hash)), HashMap(K, V),
524
+ Dispose(
520
525
  /**
521
- * RAII destructor - automatically called when HashMap goes out of scope
522
- */
523
- dispose :: (fn(self: Self) -> unit)({
526
+ * RAII destructor - automatically called when HashMap goes out of scope
527
+ */
528
+ dispose : (fn(self: Self) -> unit)({
524
529
  // Drop all occupied buckets before freeing memory
525
530
  cond(
526
531
  (Type.contains_rc_type(K) || Type.contains_rc_type(V)) => {
@@ -558,7 +563,7 @@ HashMap :: (fn(
558
563
  .None => ()
559
564
  );
560
565
  })
561
- );
566
+ ));
562
567
 
563
568
  export
564
569
  HashMap,