@shd101wyy/yo 0.0.2

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 (339) hide show
  1. package/LICENSE.md +17 -0
  2. package/README.md +80 -0
  3. package/out/cjs/index.cjs +51 -0
  4. package/out/cjs/yo-cli.cjs +2158 -0
  5. package/out/esm/index.mjs +51 -0
  6. package/out/types/src/codegen/async/runtime.d.ts +2 -0
  7. package/out/types/src/codegen/async/state-code-gen.d.ts +10 -0
  8. package/out/types/src/codegen/async/state-machine.d.ts +13 -0
  9. package/out/types/src/codegen/c/collection.d.ts +3 -0
  10. package/out/types/src/codegen/codegen-c.d.ts +12 -0
  11. package/out/types/src/codegen/constants.d.ts +3 -0
  12. package/out/types/src/codegen/expressions/array.d.ts +4 -0
  13. package/out/types/src/codegen/expressions/generation.d.ts +11 -0
  14. package/out/types/src/codegen/expressions/index.d.ts +2 -0
  15. package/out/types/src/codegen/functions/collection.d.ts +5 -0
  16. package/out/types/src/codegen/functions/context.d.ts +57 -0
  17. package/out/types/src/codegen/functions/generation.d.ts +25 -0
  18. package/out/types/src/codegen/functions/index.d.ts +2 -0
  19. package/out/types/src/codegen/index.d.ts +20 -0
  20. package/out/types/src/codegen/parallelism/runtime.d.ts +2 -0
  21. package/out/types/src/codegen/types/collection.d.ts +8 -0
  22. package/out/types/src/codegen/types/generation.d.ts +13 -0
  23. package/out/types/src/codegen/types/index.d.ts +2 -0
  24. package/out/types/src/codegen/utils/fixup.d.ts +2 -0
  25. package/out/types/src/codegen/utils/index.d.ts +77 -0
  26. package/out/types/src/codegen/values/index.d.ts +1 -0
  27. package/out/types/src/emitter.d.ts +11 -0
  28. package/out/types/src/env.d.ts +85 -0
  29. package/out/types/src/error.d.ts +45 -0
  30. package/out/types/src/evaluator/async/await-analysis-types.d.ts +23 -0
  31. package/out/types/src/evaluator/async/await-analysis.d.ts +5 -0
  32. package/out/types/src/evaluator/builtins/alignof.d.ts +8 -0
  33. package/out/types/src/evaluator/builtins/and_or.d.ts +8 -0
  34. package/out/types/src/evaluator/builtins/arc_fns.d.ts +58 -0
  35. package/out/types/src/evaluator/builtins/array_fns.d.ts +0 -0
  36. package/out/types/src/evaluator/builtins/as.d.ts +8 -0
  37. package/out/types/src/evaluator/builtins/async_fns.d.ts +8 -0
  38. package/out/types/src/evaluator/builtins/compt_assert.d.ts +8 -0
  39. package/out/types/src/evaluator/builtins/compt_boolean_fns.d.ts +8 -0
  40. package/out/types/src/evaluator/builtins/compt_expect_error.d.ts +8 -0
  41. package/out/types/src/evaluator/builtins/compt_list_fns.d.ts +33 -0
  42. package/out/types/src/evaluator/builtins/compt_print.d.ts +8 -0
  43. package/out/types/src/evaluator/builtins/compt_string_fns.d.ts +8 -0
  44. package/out/types/src/evaluator/builtins/consume.d.ts +8 -0
  45. package/out/types/src/evaluator/builtins/drop.d.ts +8 -0
  46. package/out/types/src/evaluator/builtins/dup.d.ts +8 -0
  47. package/out/types/src/evaluator/builtins/expr_fns.d.ts +33 -0
  48. package/out/types/src/evaluator/builtins/future_fns.d.ts +8 -0
  49. package/out/types/src/evaluator/builtins/gc.d.ts +8 -0
  50. package/out/types/src/evaluator/builtins/gensym.d.ts +8 -0
  51. package/out/types/src/evaluator/builtins/impl_constraint.d.ts +8 -0
  52. package/out/types/src/evaluator/builtins/macro_expand.d.ts +8 -0
  53. package/out/types/src/evaluator/builtins/numeric_fns.d.ts +8 -0
  54. package/out/types/src/evaluator/builtins/panic.d.ts +8 -0
  55. package/out/types/src/evaluator/builtins/ptr_fns.d.ts +8 -0
  56. package/out/types/src/evaluator/builtins/quote.d.ts +13 -0
  57. package/out/types/src/evaluator/builtins/rc.d.ts +8 -0
  58. package/out/types/src/evaluator/builtins/sizeof.d.ts +8 -0
  59. package/out/types/src/evaluator/builtins/the.d.ts +8 -0
  60. package/out/types/src/evaluator/builtins/type_fns.d.ts +28 -0
  61. package/out/types/src/evaluator/builtins/va_start.d.ts +8 -0
  62. package/out/types/src/evaluator/builtins/var_fns.d.ts +18 -0
  63. package/out/types/src/evaluator/calls/array.d.ts +13 -0
  64. package/out/types/src/evaluator/calls/array_type.d.ts +11 -0
  65. package/out/types/src/evaluator/calls/closure_type.d.ts +11 -0
  66. package/out/types/src/evaluator/calls/compt_function.d.ts +19 -0
  67. package/out/types/src/evaluator/calls/compt_list_type.d.ts +11 -0
  68. package/out/types/src/evaluator/calls/function.d.ts +16 -0
  69. package/out/types/src/evaluator/calls/function_type.d.ts +15 -0
  70. package/out/types/src/evaluator/calls/helper.d.ts +42 -0
  71. package/out/types/src/evaluator/calls/iso.d.ts +15 -0
  72. package/out/types/src/evaluator/calls/module_type.d.ts +11 -0
  73. package/out/types/src/evaluator/calls/numeric_type.d.ts +15 -0
  74. package/out/types/src/evaluator/calls/pointer.d.ts +8 -0
  75. package/out/types/src/evaluator/calls/pointer_type.d.ts +14 -0
  76. package/out/types/src/evaluator/calls/type.d.ts +12 -0
  77. package/out/types/src/evaluator/context.d.ts +169 -0
  78. package/out/types/src/evaluator/exprs/_expr.d.ts +8 -0
  79. package/out/types/src/evaluator/exprs/assignment.d.ts +9 -0
  80. package/out/types/src/evaluator/exprs/begin.d.ts +10 -0
  81. package/out/types/src/evaluator/exprs/binding.d.ts +12 -0
  82. package/out/types/src/evaluator/exprs/c_include.d.ts +8 -0
  83. package/out/types/src/evaluator/exprs/cond.d.ts +8 -0
  84. package/out/types/src/evaluator/exprs/destructuring_assignment.d.ts +33 -0
  85. package/out/types/src/evaluator/exprs/exists.d.ts +0 -0
  86. package/out/types/src/evaluator/exprs/expr.d.ts +9 -0
  87. package/out/types/src/evaluator/exprs/extern.d.ts +8 -0
  88. package/out/types/src/evaluator/exprs/identifer_and_operator.d.ts +9 -0
  89. package/out/types/src/evaluator/exprs/import.d.ts +9 -0
  90. package/out/types/src/evaluator/exprs/initialization_assignment.d.ts +8 -0
  91. package/out/types/src/evaluator/exprs/match.d.ts +8 -0
  92. package/out/types/src/evaluator/exprs/open.d.ts +8 -0
  93. package/out/types/src/evaluator/exprs/property_access.d.ts +8 -0
  94. package/out/types/src/evaluator/exprs/recur.d.ts +8 -0
  95. package/out/types/src/evaluator/exprs/subtype_of.d.ts +21 -0
  96. package/out/types/src/evaluator/exprs/test.d.ts +8 -0
  97. package/out/types/src/evaluator/exprs/typeof.d.ts +8 -0
  98. package/out/types/src/evaluator/exprs/while.d.ts +8 -0
  99. package/out/types/src/evaluator/index.d.ts +26 -0
  100. package/out/types/src/evaluator/types/array.d.ts +8 -0
  101. package/out/types/src/evaluator/types/closure.d.ts +8 -0
  102. package/out/types/src/evaluator/types/compt_list.d.ts +8 -0
  103. package/out/types/src/evaluator/types/concrete_module.d.ts +8 -0
  104. package/out/types/src/evaluator/types/dyn.d.ts +8 -0
  105. package/out/types/src/evaluator/types/enum.d.ts +8 -0
  106. package/out/types/src/evaluator/types/expr_synthesizer.d.ts +14 -0
  107. package/out/types/src/evaluator/types/field.d.ts +14 -0
  108. package/out/types/src/evaluator/types/fn_module.d.ts +8 -0
  109. package/out/types/src/evaluator/types/function.d.ts +58 -0
  110. package/out/types/src/evaluator/types/future_module.d.ts +8 -0
  111. package/out/types/src/evaluator/types/module.d.ts +19 -0
  112. package/out/types/src/evaluator/types/newtype.d.ts +8 -0
  113. package/out/types/src/evaluator/types/object.d.ts +8 -0
  114. package/out/types/src/evaluator/types/proofs.d.ts +0 -0
  115. package/out/types/src/evaluator/types/slice.d.ts +8 -0
  116. package/out/types/src/evaluator/types/struct.d.ts +8 -0
  117. package/out/types/src/evaluator/types/synthesizer.d.ts +16 -0
  118. package/out/types/src/evaluator/types/tuple.d.ts +18 -0
  119. package/out/types/src/evaluator/types/union.d.ts +8 -0
  120. package/out/types/src/evaluator/types/utils.d.ts +71 -0
  121. package/out/types/src/evaluator/types/validation.d.ts +3 -0
  122. package/out/types/src/evaluator/utils/array-utils.d.ts +15 -0
  123. package/out/types/src/evaluator/utils/closure.d.ts +35 -0
  124. package/out/types/src/evaluator/utils.d.ts +4 -0
  125. package/out/types/src/evaluator/values/anonymous_function.d.ts +8 -0
  126. package/out/types/src/evaluator/values/anonymous_module.d.ts +17 -0
  127. package/out/types/src/evaluator/values/anonymous_struct.d.ts +8 -0
  128. package/out/types/src/evaluator/values/array.d.ts +8 -0
  129. package/out/types/src/evaluator/values/boolean.d.ts +3 -0
  130. package/out/types/src/evaluator/values/char.d.ts +3 -0
  131. package/out/types/src/evaluator/values/compt_list.d.ts +8 -0
  132. package/out/types/src/evaluator/values/dyn.d.ts +8 -0
  133. package/out/types/src/evaluator/values/float.d.ts +4 -0
  134. package/out/types/src/evaluator/values/integer.d.ts +4 -0
  135. package/out/types/src/evaluator/values/module.d.ts +58 -0
  136. package/out/types/src/evaluator/values/string.d.ts +3 -0
  137. package/out/types/src/evaluator/values/tuple.d.ts +32 -0
  138. package/out/types/src/expr.d.ts +456 -0
  139. package/out/types/src/function-value.d.ts +42 -0
  140. package/out/types/src/index.d.ts +4 -0
  141. package/out/types/src/lexer.d.ts +2 -0
  142. package/out/types/src/logger.d.ts +1 -0
  143. package/out/types/src/module-manager.d.ts +30 -0
  144. package/out/types/src/naming-checker.d.ts +4 -0
  145. package/out/types/src/parser.d.ts +33 -0
  146. package/out/types/src/test-runner.d.ts +30 -0
  147. package/out/types/src/tests/codegen.test.d.ts +1 -0
  148. package/out/types/src/tests/fixme.test.d.ts +1 -0
  149. package/out/types/src/tests/module-manager.test.d.ts +1 -0
  150. package/out/types/src/tests/parser.test.d.ts +1 -0
  151. package/out/types/src/tests/sample.test.d.ts +0 -0
  152. package/out/types/src/tests/std.test.d.ts +1 -0
  153. package/out/types/src/token.d.ts +40 -0
  154. package/out/types/src/type-value.d.ts +7 -0
  155. package/out/types/src/types/compatibility.d.ts +16 -0
  156. package/out/types/src/types/creators.d.ts +73 -0
  157. package/out/types/src/types/definitions.d.ts +218 -0
  158. package/out/types/src/types/guards.d.ts +70 -0
  159. package/out/types/src/types/hierarchy.d.ts +4 -0
  160. package/out/types/src/types/index.d.ts +7 -0
  161. package/out/types/src/types/module_field.d.ts +2 -0
  162. package/out/types/src/types/tags.d.ts +45 -0
  163. package/out/types/src/types/utils.d.ts +50 -0
  164. package/out/types/src/unit-value.d.ts +7 -0
  165. package/out/types/src/utils.d.ts +6 -0
  166. package/out/types/src/value-tag.d.ts +29 -0
  167. package/out/types/src/value.d.ts +110 -0
  168. package/out/types/src/yo-cli.d.ts +1 -0
  169. package/out/types/tsconfig.tsbuildinfo +1 -0
  170. package/package.json +57 -0
  171. package/scripts/check-liburing.js +76 -0
  172. package/std/alg/hash.yo +50 -0
  173. package/std/allocator.yo +113 -0
  174. package/std/allocators/c_allocator.yo +118 -0
  175. package/std/async.yo +13 -0
  176. package/std/collections/array_list.yo +415 -0
  177. package/std/collections/hash_map.yo +482 -0
  178. package/std/collections/hash_set.yo +706 -0
  179. package/std/collections/index.yo +11 -0
  180. package/std/collections/linked_list.yo +439 -0
  181. package/std/error.yo +0 -0
  182. package/std/gc.yo +10 -0
  183. package/std/index.yo +12 -0
  184. package/std/io/file.yo +191 -0
  185. package/std/io/index.yo +5 -0
  186. package/std/libc/assert.yo +39 -0
  187. package/std/libc/ctype.yo +57 -0
  188. package/std/libc/errno.yo +182 -0
  189. package/std/libc/float.yo +87 -0
  190. package/std/libc/index.yo +29 -0
  191. package/std/libc/limits.yo +65 -0
  192. package/std/libc/math.yo +679 -0
  193. package/std/libc/signal.yo +101 -0
  194. package/std/libc/stdatomic.yo +213 -0
  195. package/std/libc/stdint.yo +214 -0
  196. package/std/libc/stdio.yo +225 -0
  197. package/std/libc/stdlib.yo +204 -0
  198. package/std/libc/string.yo +151 -0
  199. package/std/libc/time.yo +92 -0
  200. package/std/libc/unistd.yo +130 -0
  201. package/std/monad.yo +152 -0
  202. package/std/prelude.yo +3094 -0
  203. package/std/string/index.yo +8 -0
  204. package/std/string/rune.yo +82 -0
  205. package/std/string/string.yo +288 -0
  206. package/std/sync.yo +95 -0
  207. package/std/thread.yo +36 -0
  208. package/std/time.yo +13 -0
  209. package/std/worker.yo +36 -0
  210. package/vendor/mimalloc/.gitattributes +12 -0
  211. package/vendor/mimalloc/CMakeLists.txt +763 -0
  212. package/vendor/mimalloc/LICENSE +21 -0
  213. package/vendor/mimalloc/SECURITY.md +41 -0
  214. package/vendor/mimalloc/azure-pipelines.yml +251 -0
  215. package/vendor/mimalloc/bin/mimalloc-redirect-arm64.dll +0 -0
  216. package/vendor/mimalloc/bin/mimalloc-redirect-arm64.lib +0 -0
  217. package/vendor/mimalloc/bin/mimalloc-redirect-arm64ec.dll +0 -0
  218. package/vendor/mimalloc/bin/mimalloc-redirect-arm64ec.lib +0 -0
  219. package/vendor/mimalloc/bin/mimalloc-redirect.dll +0 -0
  220. package/vendor/mimalloc/bin/mimalloc-redirect.lib +0 -0
  221. package/vendor/mimalloc/bin/mimalloc-redirect32.dll +0 -0
  222. package/vendor/mimalloc/bin/mimalloc-redirect32.lib +0 -0
  223. package/vendor/mimalloc/bin/minject-arm64.exe +0 -0
  224. package/vendor/mimalloc/bin/minject.exe +0 -0
  225. package/vendor/mimalloc/bin/minject32.exe +0 -0
  226. package/vendor/mimalloc/bin/readme.md +118 -0
  227. package/vendor/mimalloc/cmake/JoinPaths.cmake +23 -0
  228. package/vendor/mimalloc/cmake/mimalloc-config-version.cmake +19 -0
  229. package/vendor/mimalloc/cmake/mimalloc-config.cmake +14 -0
  230. package/vendor/mimalloc/contrib/docker/alpine/Dockerfile +23 -0
  231. package/vendor/mimalloc/contrib/docker/alpine-arm32v7/Dockerfile +28 -0
  232. package/vendor/mimalloc/contrib/docker/alpine-x86/Dockerfile +28 -0
  233. package/vendor/mimalloc/contrib/docker/manylinux-x64/Dockerfile +23 -0
  234. package/vendor/mimalloc/contrib/docker/readme.md +10 -0
  235. package/vendor/mimalloc/contrib/vcpkg/portfile.cmake +64 -0
  236. package/vendor/mimalloc/contrib/vcpkg/readme.md +40 -0
  237. package/vendor/mimalloc/contrib/vcpkg/usage +20 -0
  238. package/vendor/mimalloc/contrib/vcpkg/vcpkg-cmake-wrapper.cmake +20 -0
  239. package/vendor/mimalloc/contrib/vcpkg/vcpkg.json +48 -0
  240. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-a.svg +887 -0
  241. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-b.svg +1185 -0
  242. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-rss-a.svg +757 -0
  243. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-rss-b.svg +1028 -0
  244. package/vendor/mimalloc/doc/bench-2020/bench-r5a-1.svg +769 -0
  245. package/vendor/mimalloc/doc/bench-2020/bench-r5a-12xlarge-2020-01-16-a.svg +868 -0
  246. package/vendor/mimalloc/doc/bench-2020/bench-r5a-12xlarge-2020-01-16-b.svg +1157 -0
  247. package/vendor/mimalloc/doc/bench-2020/bench-r5a-2.svg +983 -0
  248. package/vendor/mimalloc/doc/bench-2020/bench-r5a-rss-1.svg +683 -0
  249. package/vendor/mimalloc/doc/bench-2020/bench-r5a-rss-2.svg +854 -0
  250. package/vendor/mimalloc/doc/bench-2020/bench-spec-rss.svg +713 -0
  251. package/vendor/mimalloc/doc/bench-2020/bench-spec.svg +713 -0
  252. package/vendor/mimalloc/doc/bench-2020/bench-z4-1.svg +890 -0
  253. package/vendor/mimalloc/doc/bench-2020/bench-z4-2.svg +1146 -0
  254. package/vendor/mimalloc/doc/bench-2020/bench-z4-rss-1.svg +796 -0
  255. package/vendor/mimalloc/doc/bench-2020/bench-z4-rss-2.svg +974 -0
  256. package/vendor/mimalloc/doc/bench-2021/bench-amd5950x-2021-01-30-a.svg +952 -0
  257. package/vendor/mimalloc/doc/bench-2021/bench-amd5950x-2021-01-30-b.svg +1255 -0
  258. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-a.svg +955 -0
  259. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-b.svg +1269 -0
  260. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-rss-a.svg +836 -0
  261. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-rss-b.svg +1131 -0
  262. package/vendor/mimalloc/doc/bench-2021/bench-macmini-2021-01-30.svg +766 -0
  263. package/vendor/mimalloc/doc/doxyfile +2895 -0
  264. package/vendor/mimalloc/doc/ds-logo.jpg +0 -0
  265. package/vendor/mimalloc/doc/ds-logo.png +0 -0
  266. package/vendor/mimalloc/doc/mimalloc-doc.h +1452 -0
  267. package/vendor/mimalloc/doc/mimalloc-doxygen.css +60 -0
  268. package/vendor/mimalloc/doc/mimalloc-logo-100.png +0 -0
  269. package/vendor/mimalloc/doc/mimalloc-logo.png +0 -0
  270. package/vendor/mimalloc/doc/mimalloc-logo.svg +161 -0
  271. package/vendor/mimalloc/doc/spades-logo.png +0 -0
  272. package/vendor/mimalloc/doc/unreal-logo.svg +43 -0
  273. package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj +500 -0
  274. package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj.filters +108 -0
  275. package/vendor/mimalloc/ide/vs2022/mimalloc-override-dll.vcxproj +508 -0
  276. package/vendor/mimalloc/ide/vs2022/mimalloc-override-dll.vcxproj.filters +111 -0
  277. package/vendor/mimalloc/ide/vs2022/mimalloc-override-test-dep.vcxproj +355 -0
  278. package/vendor/mimalloc/ide/vs2022/mimalloc-override-test.vcxproj +360 -0
  279. package/vendor/mimalloc/ide/vs2022/mimalloc-test-api.vcxproj +295 -0
  280. package/vendor/mimalloc/ide/vs2022/mimalloc-test-stress.vcxproj +292 -0
  281. package/vendor/mimalloc/ide/vs2022/mimalloc-test.vcxproj +289 -0
  282. package/vendor/mimalloc/ide/vs2022/mimalloc.sln +151 -0
  283. package/vendor/mimalloc/include/mimalloc/atomic.h +557 -0
  284. package/vendor/mimalloc/include/mimalloc/internal.h +1153 -0
  285. package/vendor/mimalloc/include/mimalloc/prim.h +421 -0
  286. package/vendor/mimalloc/include/mimalloc/track.h +145 -0
  287. package/vendor/mimalloc/include/mimalloc/types.h +685 -0
  288. package/vendor/mimalloc/include/mimalloc-new-delete.h +66 -0
  289. package/vendor/mimalloc/include/mimalloc-override.h +68 -0
  290. package/vendor/mimalloc/include/mimalloc-stats.h +103 -0
  291. package/vendor/mimalloc/include/mimalloc.h +612 -0
  292. package/vendor/mimalloc/mimalloc.pc.in +11 -0
  293. package/vendor/mimalloc/readme.md +946 -0
  294. package/vendor/mimalloc/src/alloc-aligned.c +360 -0
  295. package/vendor/mimalloc/src/alloc-override.c +316 -0
  296. package/vendor/mimalloc/src/alloc-posix.c +185 -0
  297. package/vendor/mimalloc/src/alloc.c +692 -0
  298. package/vendor/mimalloc/src/arena-abandon.c +346 -0
  299. package/vendor/mimalloc/src/arena.c +1043 -0
  300. package/vendor/mimalloc/src/bitmap.c +441 -0
  301. package/vendor/mimalloc/src/bitmap.h +119 -0
  302. package/vendor/mimalloc/src/free.c +572 -0
  303. package/vendor/mimalloc/src/heap.c +733 -0
  304. package/vendor/mimalloc/src/init.c +714 -0
  305. package/vendor/mimalloc/src/libc.c +334 -0
  306. package/vendor/mimalloc/src/options.c +663 -0
  307. package/vendor/mimalloc/src/os.c +770 -0
  308. package/vendor/mimalloc/src/page-queue.c +390 -0
  309. package/vendor/mimalloc/src/page.c +1049 -0
  310. package/vendor/mimalloc/src/prim/emscripten/prim.c +249 -0
  311. package/vendor/mimalloc/src/prim/osx/alloc-override-zone.c +461 -0
  312. package/vendor/mimalloc/src/prim/osx/prim.c +9 -0
  313. package/vendor/mimalloc/src/prim/prim.c +76 -0
  314. package/vendor/mimalloc/src/prim/readme.md +9 -0
  315. package/vendor/mimalloc/src/prim/unix/prim.c +934 -0
  316. package/vendor/mimalloc/src/prim/wasi/prim.c +284 -0
  317. package/vendor/mimalloc/src/prim/windows/etw-mimalloc.wprp +61 -0
  318. package/vendor/mimalloc/src/prim/windows/etw.h +905 -0
  319. package/vendor/mimalloc/src/prim/windows/etw.man +0 -0
  320. package/vendor/mimalloc/src/prim/windows/prim.c +878 -0
  321. package/vendor/mimalloc/src/prim/windows/readme.md +17 -0
  322. package/vendor/mimalloc/src/random.c +258 -0
  323. package/vendor/mimalloc/src/segment-map.c +142 -0
  324. package/vendor/mimalloc/src/segment.c +1702 -0
  325. package/vendor/mimalloc/src/static.c +41 -0
  326. package/vendor/mimalloc/src/stats.c +635 -0
  327. package/vendor/mimalloc/test/CMakeLists.txt +56 -0
  328. package/vendor/mimalloc/test/main-override-dep.cpp +51 -0
  329. package/vendor/mimalloc/test/main-override-dep.h +11 -0
  330. package/vendor/mimalloc/test/main-override-static.c +539 -0
  331. package/vendor/mimalloc/test/main-override.c +36 -0
  332. package/vendor/mimalloc/test/main-override.cpp +497 -0
  333. package/vendor/mimalloc/test/main.c +46 -0
  334. package/vendor/mimalloc/test/readme.md +16 -0
  335. package/vendor/mimalloc/test/test-api-fill.c +343 -0
  336. package/vendor/mimalloc/test/test-api.c +466 -0
  337. package/vendor/mimalloc/test/test-stress.c +428 -0
  338. package/vendor/mimalloc/test/test-wrong.c +92 -0
  339. package/vendor/mimalloc/test/testhelper.h +49 -0
package/std/prelude.yo ADDED
@@ -0,0 +1,3094 @@
1
+ // Prelude Module
2
+ // - Calling "import" is prohibited in this prelude module.
3
+
4
+ // === Builtin Yo functions ===
5
+ extern "Yo",
6
+ // compt_codegen_inline: (fn(compt(C): compt_string)-> compt(unit)),
7
+ // compt_noop: (()-> compt(unit)),
8
+ __yo_return_self : (fn(forall(T: Type), self: T) -> T),
9
+ __yo_noop: (fn(forall(T : Type))-> T),
10
+ __yo_as: (fn(forall(_Self: Type), self: _Self, compt(Target): Type) -> Target),
11
+
12
+ // Arithmetic Operators
13
+ /// +
14
+ __yo_op_add : (fn(forall(T : Type), x : T, y : T) -> T),
15
+ /// -
16
+ __yo_op_sub : (fn(forall(T : Type), x : T, y : T) -> T),
17
+ /// *
18
+ __yo_op_mul : (fn(forall(T : Type), x : T, y : T) -> T),
19
+ /// /
20
+ __yo_op_div : (fn(forall(T : Type), x : T, y : T) -> T),
21
+ /// %
22
+ __yo_op_mod : (fn(forall(T : Type), x : T, y : T) -> T),
23
+ /// -
24
+ __yo_op_neg : (fn(forall(T : Type), x : T) -> T),
25
+
26
+ // Relational Operators
27
+ /// ==
28
+ __yo_op_eq : (fn(forall(T : Type), x : T, y : T) -> bool),
29
+ /// !=
30
+ __yo_op_neq : (fn(forall(T : Type), x : T, y: T) -> bool),
31
+ /// <
32
+ __yo_op_lt : (fn(forall(T : Type), x : T, y : T) -> bool),
33
+ /// <=
34
+ __yo_op_lte : (fn(forall(T : Type), x : T, y : T) -> bool),
35
+ /// >
36
+ __yo_op_gt : (fn(forall(T : Type), x : T, y : T) -> bool),
37
+ /// >=
38
+ __yo_op_gte : (fn(forall(T : Type), x : T, y : T) -> bool),
39
+
40
+ // Logical Operators
41
+ /// !
42
+ __yo_op_not : (fn(forall(T : Type), x : T) -> bool),
43
+
44
+ // Bitwise Operators
45
+ /// &
46
+ __yo_op_bit_and : (fn(forall(T : Type), x : T, y : T) -> T),
47
+ /// |
48
+ __yo_op_bit_or : (fn(forall(T : Type), x : T, y : T) -> T),
49
+ /// ^
50
+ __yo_op_bit_xor : (fn(forall(T : Type), x : T, y : T) -> T),
51
+ /// ~
52
+ __yo_op_bit_complement: (fn(forall(T : Type), x : T) -> T),
53
+ /// <<
54
+ __yo_op_bit_left_shift : (fn(forall(T : Type), x : T, y : T) -> T),
55
+ /// >>
56
+ __yo_op_bit_right_shift : (fn(forall(T : Type), x : T, y : T) -> T),
57
+
58
+ // Ptr related functions
59
+ __yo_ptr_add :
60
+ fn(forall(T: Type), ptr : T, offset : usize) -> T,
61
+ __yo_ptr_sub :
62
+ fn(forall(T: Type), ptr : T, offset : usize) -> T,
63
+ __yo_ptr_diff :
64
+ fn(forall(T: Type), ptr1 : T, ptr2 : T) -> isize,
65
+ __yo_ptr_eq :
66
+ fn(forall(T: Type), ptr1 : T, ptr2 : T) -> bool,
67
+ __yo_ptr_neq :
68
+ fn(forall(T: Type), ptr1 : T, ptr2 : T) -> bool,
69
+ __yo_ptr_lt :
70
+ fn(forall(T: Type), ptr1 : T, ptr2 : T) -> bool,
71
+ __yo_ptr_lte :
72
+ fn(forall(T: Type), ptr1 : T, ptr2 : T) -> bool,
73
+ __yo_ptr_gt :
74
+ fn(forall(T: Type), ptr1 : T, ptr2 : T) -> bool,
75
+ __yo_ptr_gte :
76
+ fn(forall(T: Type), ptr1 : T, ptr2 : T) -> bool,
77
+
78
+ // slice related
79
+ __yo_slice_len :
80
+ fn(forall(T: Type), slice: Slice(T)) -> usize
81
+ ;
82
+ export __yo_as;
83
+
84
+ assert :: (fn(flag : bool, (compt(msg) : compt_string) ?= "Assertion failed.") -> unit)
85
+ cond(
86
+ flag => (),
87
+ true => panic(msg)
88
+ )
89
+ ;
90
+ export assert;
91
+
92
+
93
+ /// === Modules ===
94
+ Send :: module(
95
+ id := "Send"
96
+ );
97
+ export Send;
98
+
99
+ /// === Arithmetic ===
100
+ Add :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
101
+ module
102
+ Output := Output,
103
+ (+) : (fn(lhs: Self, rhs: Rhs)-> Output)
104
+ ;
105
+ export Add;
106
+
107
+ ComptAdd :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
108
+ module
109
+ Output := Output,
110
+ (+) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
111
+ ;
112
+ export ComptAdd;
113
+
114
+ Sub :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
115
+ module
116
+ Output := Output,
117
+ (-) : (fn(lhs: Self, rhs: Rhs)-> Output)
118
+ ;
119
+ export Sub;
120
+
121
+ ComptSub :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
122
+ module
123
+ Output := Output,
124
+ (-) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
125
+ ;
126
+ export ComptSub;
127
+
128
+ Mul :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
129
+ module
130
+ Output := Output,
131
+ (*) : (fn(lhs: Self, rhs: Rhs)-> Output)
132
+ ;
133
+ export Mul;
134
+
135
+ ComptMul :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
136
+ module
137
+ Output := Output,
138
+ (*) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
139
+ ;
140
+ export ComptMul;
141
+
142
+ Div :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
143
+ module
144
+ Output := Output,
145
+ (/) : (fn(lhs: Self, rhs: Rhs)-> Output)
146
+ ;
147
+ export Div;
148
+
149
+ ComptDiv :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
150
+ module
151
+ Output := Output,
152
+ (/) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
153
+ ;
154
+ export ComptDiv;
155
+
156
+ Mod :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
157
+ module
158
+ Output := Output,
159
+ (%) : (fn(lhs: Self, rhs: Rhs)-> Output)
160
+ ;
161
+ export Mod;
162
+
163
+ ComptMod :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
164
+ module
165
+ Output := Output,
166
+ (%) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
167
+ ;
168
+ export ComptMod;
169
+
170
+ BitLeftShift :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
171
+ module
172
+ Output := Output,
173
+ (<<) : (fn(lhs: Self, rhs: Rhs)-> Output)
174
+ ;
175
+ export BitLeftShift;
176
+
177
+ ComptBitLeftShift :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
178
+ module
179
+ Output := Output,
180
+ (<<) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
181
+ ;
182
+ export ComptBitLeftShift;
183
+
184
+ BitRightShift :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
185
+ module
186
+ Output := Output,
187
+ (>>) : (fn(lhs: Self, rhs: Rhs)-> Output)
188
+ ;
189
+ export BitRightShift;
190
+
191
+ ComptBitRightShift :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
192
+ module
193
+ Output := Output,
194
+ (>>) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
195
+ ;
196
+ export ComptBitRightShift;
197
+
198
+ Exponentiation :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
199
+ module
200
+ Output := Output,
201
+ (**) : (fn(lhs: Self, rhs: Rhs)-> Output)
202
+ ;
203
+ export Exponentiation;
204
+
205
+ ComptExponentiation :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs)-> compt(Module))
206
+ module
207
+ Output := Output,
208
+ (**) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
209
+ ;
210
+ export ComptExponentiation;
211
+
212
+ Negate :: (fn(compt(Output) : Type)-> compt(Module))
213
+ module
214
+ Output := Output,
215
+ (neg): (fn(self: Self)-> Output)
216
+ ;
217
+ export Negate;
218
+
219
+ ComptNegate :: (fn(compt(Output) : Type)-> compt(Module))
220
+ module
221
+ Output := Output,
222
+ (neg) : (fn(compt(self): Self)-> compt(Output))
223
+ ;
224
+ export ComptNegate;
225
+
226
+ /// === Logic ===
227
+ LogicalNot :: module
228
+ (!) : (fn(self: Self)-> bool)
229
+ ;
230
+ export LogicalNot;
231
+
232
+ ComptLogicalNot :: module
233
+ (!) : (fn(compt(self): Self) -> compt(bool))
234
+ ;
235
+ export ComptLogicalNot;
236
+
237
+ BitNot :: (fn(compt(Output) : Type) -> compt(Module))
238
+ module
239
+ Output := Output,
240
+ (~) : (fn(self: Self)-> Output)
241
+ ;
242
+ export BitNot;
243
+
244
+ ComptBitNot :: (fn(compt(Output) : Type) -> compt(Module))
245
+ module
246
+ Output := Output,
247
+ (~) : (fn(compt(self): Self)-> compt(Output))
248
+ ;
249
+ export ComptBitNot;
250
+
251
+ BitAnd :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs) -> compt(Module))
252
+ module
253
+ Output := Output,
254
+ (&) : (fn(lhs: Self, rhs: Rhs)-> Output)
255
+ ;
256
+ export BitAnd;
257
+
258
+ ComptBitAnd :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs) -> compt(Module))
259
+ module
260
+ Output := Output,
261
+ (&) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
262
+ ;
263
+ export ComptBitAnd;
264
+
265
+ BitOr :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs) -> compt(Module))
266
+ module
267
+ Output := Output,
268
+ (|) : (fn(lhs: Self, rhs: Rhs)-> Output)
269
+ ;
270
+ export BitOr;
271
+
272
+ ComptBitOr :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs) -> compt(Module))
273
+ module
274
+ Output := Output,
275
+ (|) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
276
+ ;
277
+ export ComptBitOr;
278
+
279
+ BitXor :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs) -> compt(Module))
280
+ module
281
+ Output := Output,
282
+ (^) : (fn(lhs: Self, rhs: Rhs)-> Output)
283
+ ;
284
+ export BitXor;
285
+
286
+ ComptBitXor :: (fn(compt(Rhs) : Type, compt(Output) ?= Rhs) -> compt(Module))
287
+ module
288
+ Output := Output,
289
+ (^) : (fn(compt(lhs): Self, compt(rhs): Rhs)-> compt(Output))
290
+ ;
291
+ export ComptBitXor;
292
+
293
+ (!) :: impl {
294
+ (not) :: (fn(forall(_Self : Type),
295
+ self : _Self,
296
+ where(_Self <: LogicalNot)
297
+ ) -> bool)
298
+ self.(!)()
299
+ ;
300
+
301
+ (compt_not) :: (fn(forall(_Self : Type),
302
+ compt(self) : _Self,
303
+ where(_Self <: ComptLogicalNot)
304
+ ) -> compt(bool))
305
+ self.(!)()
306
+ ;
307
+
308
+ Call :: (not, compt_not);
309
+
310
+ export
311
+ Call,
312
+ not,
313
+ compt_not
314
+ ;
315
+ };
316
+ (not) :: (!);
317
+ export not, (!);
318
+
319
+ (-) :: impl {
320
+ (neg) :: (fn(forall(_Self : Type),
321
+ self : _Self,
322
+ where(_Self <: Negate(_Self))
323
+ ) -> _Self) {
324
+ return self.neg();
325
+ };
326
+
327
+ (compt_neg) :: (fn(forall(_Self : Type),
328
+ compt(self) : _Self,
329
+ where(_Self <: ComptNegate(_Self))
330
+ ) -> compt(_Self)) {
331
+ return self.neg();
332
+ };
333
+
334
+ Call :: (neg, compt_neg);
335
+
336
+ export
337
+ Call,
338
+ neg,
339
+ compt_neg
340
+ ;
341
+ };
342
+ export (-);
343
+
344
+ /**
345
+ * logic for bool
346
+ * No need to export them. For internal use only
347
+ */
348
+ impl(bool, LogicalNot(
349
+ (!): ((a) ->
350
+ __yo_op_not(a)
351
+ )
352
+ ));
353
+ impl(bool, ComptLogicalNot(
354
+ (!) : (fn(compt(self): bool) -> compt(bool))(
355
+ __yo_compt_boolean_not(self)
356
+ )
357
+ ));
358
+
359
+ /// === Eq ===
360
+ Eq ::
361
+ (fn(compt(Rhs) : Type) -> compt(Module))
362
+ module(
363
+ (==) : (fn(lhs: Self, rhs: Rhs) -> bool),
364
+
365
+ ((!=) : (fn(lhs: Self, rhs: Rhs) -> bool)) ?=
366
+ ((lhs, rhs) ->
367
+ not(Self.(==)(lhs, rhs))
368
+ )
369
+ );
370
+ export Eq;
371
+
372
+ ComptEq ::
373
+ (fn(compt(Rhs) : Type) -> compt(Module))
374
+ module(
375
+ (==) : (fn(compt(lhs): Self, compt(rhs): Rhs) -> compt(bool)),
376
+
377
+ ((!=) : (fn(compt(lhs): Self, compt(rhs): Rhs) -> compt(bool))) ?=
378
+ ((lhs, rhs) ->
379
+ not(Self.(==)(lhs, rhs))
380
+ )
381
+ )
382
+ ;
383
+ export ComptEq;
384
+
385
+ /// === Ord ===
386
+ Ordering :: enum
387
+ Less,
388
+ Equal,
389
+ Greater
390
+ ;
391
+ export Ordering;
392
+
393
+ Ord :: (
394
+ fn(
395
+ compt(Rhs) : Type
396
+ ) -> compt(Module))
397
+ module(
398
+ where(Self <: Eq(Rhs)),
399
+
400
+ (<) :
401
+ fn(lhs: Self, rhs: Rhs) -> bool,
402
+ (<=) :
403
+ fn(lhs: Self, rhs: Rhs) -> bool,
404
+ (>) :
405
+ fn(lhs: Self, rhs: Rhs) -> bool,
406
+ (>=) :
407
+ fn(lhs: Self, rhs: Rhs) -> bool
408
+ )
409
+ ;
410
+ export Ord;
411
+
412
+ ComptOrd :: (
413
+ fn(
414
+ compt(Rhs) : Type
415
+ ) -> compt(Module))
416
+ module(
417
+ where(Self <: ComptEq(Rhs)),
418
+
419
+ (<) :
420
+ fn(compt(lhs): Self, compt(rhs): Rhs) -> compt(bool),
421
+ (<=) :
422
+ fn(compt(lhs): Self, compt(rhs): Rhs) -> compt(bool),
423
+ (>) :
424
+ fn(compt(lhs): Self, compt(rhs): Rhs) -> compt(bool),
425
+ (>=) :
426
+ fn(compt(lhs): Self, compt(rhs): Rhs) -> compt(bool)
427
+ )
428
+ ;
429
+
430
+ /**
431
+ * Hash trait - Similar to Rust's std::hash::Hash
432
+ *
433
+ * This trait defines the ability to hash a value into a u64.
434
+ * Types that implement Hash can be used as keys in HashMap and HashSet.
435
+ *
436
+ * The hash function should satisfy:
437
+ * 1. Deterministic: The same value always produces the same hash
438
+ * 2. Consistent with Eq: If a == b, then hash(a) == hash(b)
439
+ *
440
+ * Note: Unlike Rust which uses a Hasher trait for incremental hashing,
441
+ * we use a simpler approach where each type directly produces a u64 hash.
442
+ */
443
+ Hash :: module(
444
+ /**
445
+ * Compute the hash of a value
446
+ * Returns a u64 hash value
447
+ */
448
+ (hash): (fn(value: Self) -> u64)
449
+ );
450
+ export
451
+ Hash
452
+ ;
453
+
454
+ // === Clone ===
455
+ Clone :: (fn(compt(Output) : Type) -> compt(Module))
456
+ module(
457
+ clone :
458
+ fn(self: Self) -> Output
459
+ )
460
+ ;
461
+
462
+ // === Isolation ===
463
+ Isolation :: module(
464
+ can_isolate : (fn(self : Self) -> bool)
465
+ );
466
+ export Isolation;
467
+
468
+ // === Builtin types ===
469
+ /// bool
470
+ impl(bool, Send());
471
+ impl(bool, Eq(bool)(
472
+ (==): ((a, b) ->
473
+ __yo_op_eq(a, b)
474
+ )
475
+ ));
476
+ impl(bool, Clone(bool)(
477
+ clone: ((self) ->
478
+ __yo_return_self(self)
479
+ )
480
+ ));
481
+ impl(bool, Hash(
482
+ (hash): ((value) ->
483
+ cond(
484
+ value => u64(1),
485
+ true => u64(0)
486
+ )
487
+ )
488
+ ));
489
+ impl(bool, ComptEq(bool)(
490
+ (==) : (fn(compt(lhs): bool, compt(rhs): bool) -> compt(bool))(
491
+ __yo_compt_boolean_eq(lhs, rhs)
492
+ )
493
+ ));
494
+ impl(bool, {
495
+ (to_string) :: (fn(compt(self): bool) -> compt(compt_string))
496
+ __yo_compt_boolean_to_string(self)
497
+ ;
498
+ export to_string;
499
+ });
500
+ _boolean :: bool;
501
+ export bool : _boolean;
502
+
503
+ /// i8
504
+ impl(i8, Send());
505
+ impl(i8, Add(i8)(
506
+ (+): ((a, b) -> __yo_op_add(a, b))
507
+ ));
508
+ impl(i8, Sub(i8)(
509
+ (-): ((a, b) -> __yo_op_sub(a, b))
510
+ ));
511
+ impl(i8, Mul(i8)(
512
+ (*): ((a, b) -> __yo_op_mul(a, b))
513
+ ));
514
+ impl(i8, Div(i8)(
515
+ (/): ((a, b) -> __yo_op_div(a, b))
516
+ ));
517
+ impl(i8, Mod(i8)(
518
+ (%): ((a, b) -> __yo_op_mod(a, b))
519
+ ));
520
+ impl(i8, Negate(i8)(
521
+ (neg): ((a) -> __yo_op_neg(a))
522
+ ));
523
+ impl(i8, BitLeftShift(i8)(
524
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
525
+ ));
526
+ impl(i8, BitRightShift(i8)(
527
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
528
+ ));
529
+ impl(i8, LogicalNot(
530
+ (!): ((a) -> __yo_op_not(a))
531
+ ));
532
+ impl(i8, BitNot(i8)(
533
+ (~): ((a) -> __yo_op_bit_complement(a))
534
+ ));
535
+ impl(i8, BitAnd(i8)(
536
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
537
+ ));
538
+ impl(i8, BitOr(i8)(
539
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
540
+ ));
541
+ impl(i8, BitXor(i8)(
542
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
543
+ ));
544
+ impl(i8, Eq(i8)(
545
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
546
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
547
+ ));
548
+ impl(i8, Ord(i8)(
549
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
550
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
551
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
552
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
553
+ ));
554
+ impl(i8, Hash(
555
+ (hash): ((value) -> u64(value))
556
+ ));
557
+ impl(i8, Clone(i8)(
558
+ clone: ((self) -> __yo_return_self(self))
559
+ ));
560
+ impl(i8, ComptAdd(i8)(
561
+ (+) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(i8))(
562
+ __yo_i8_add(lhs, rhs)
563
+ )
564
+ ));
565
+ impl(i8, ComptSub(i8)(
566
+ (-) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(i8))(
567
+ __yo_i8_sub(lhs, rhs)
568
+ )
569
+ ));
570
+ impl(i8, ComptMul(i8)(
571
+ (*) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(i8))(
572
+ __yo_i8_mul(lhs, rhs)
573
+ )
574
+ ));
575
+ impl(i8, ComptDiv(i8)(
576
+ (/) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(i8))(
577
+ __yo_i8_div(lhs, rhs)
578
+ )
579
+ ));
580
+ impl(i8, ComptMod(i8)(
581
+ (%) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(i8))(
582
+ __yo_i8_mod(lhs, rhs)
583
+ )
584
+ ));
585
+ impl(i8, ComptNegate(i8)(
586
+ (neg) : (fn(compt(self): i8) -> compt(i8))(
587
+ __yo_i8_neg(self)
588
+ )
589
+ ));
590
+ impl(i8, ComptEq(i8)(
591
+ (==) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(bool))(
592
+ __yo_i8_eq(lhs, rhs)
593
+ ),
594
+ (!=) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(bool))(
595
+ __yo_i8_neq(lhs, rhs)
596
+ )
597
+ ));
598
+ impl(i8, ComptOrd(i8)(
599
+ (<) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(bool))(
600
+ __yo_i8_lt(lhs, rhs)
601
+ ),
602
+ (<=) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(bool))(
603
+ __yo_i8_lte(lhs, rhs)
604
+ ),
605
+ (>) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(bool))(
606
+ __yo_i8_gt(lhs, rhs)
607
+ ),
608
+ (>=) : (fn(compt(lhs): i8, compt(rhs): i8) -> compt(bool))(
609
+ __yo_i8_gte(lhs, rhs)
610
+ )
611
+ ));
612
+ impl(i8, {
613
+ (to_string) :: (fn(compt(self): i8) -> compt(compt_string))
614
+ __yo_i8_to_string(self)
615
+ ;
616
+ export to_string;
617
+ });
618
+ _i8 :: i8;
619
+ export i8 : _i8;
620
+
621
+ /// i16
622
+ impl(i16, Send());
623
+ impl(i16, Add(i16)(
624
+ (+): ((a, b) -> __yo_op_add(a, b))
625
+ ));
626
+ impl(i16, Sub(i16)(
627
+ (-): ((a, b) -> __yo_op_sub(a, b))
628
+ ));
629
+ impl(i16, Mul(i16)(
630
+ (*): ((a, b) -> __yo_op_mul(a, b))
631
+ ));
632
+ impl(i16, Div(i16)(
633
+ (/): ((a, b) -> __yo_op_div(a, b))
634
+ ));
635
+ impl(i16, Mod(i16)(
636
+ (%): ((a, b) -> __yo_op_mod(a, b))
637
+ ));
638
+ impl(i16, Negate(i16)(
639
+ (neg): ((a) -> __yo_op_neg(a))
640
+ ));
641
+ impl(i16, BitLeftShift(i16)(
642
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
643
+ ));
644
+ impl(i16, BitRightShift(i16)(
645
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
646
+ ));
647
+ impl(i16, LogicalNot(
648
+ (!): ((a) -> __yo_op_not(a))
649
+ ));
650
+ impl(i16, BitNot(i16)(
651
+ (~): ((a) -> __yo_op_bit_complement(a))
652
+ ));
653
+ impl(i16, BitAnd(i16)(
654
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
655
+ ));
656
+ impl(i16, BitOr(i16)(
657
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
658
+ ));
659
+ impl(i16, BitXor(i16)(
660
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
661
+ ));
662
+ impl(i16, Eq(i16)(
663
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
664
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
665
+ ));
666
+ impl(i16, Ord(i16)(
667
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
668
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
669
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
670
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
671
+ ));
672
+ impl(i16, Hash(
673
+ (hash): ((value) -> u64(value))
674
+ ));
675
+ impl(i16, Clone(i16)(
676
+ clone: ((self) -> __yo_return_self(self))
677
+ ));
678
+ impl(i16, ComptAdd(i16)(
679
+ (+) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(i16))(
680
+ __yo_i16_add(lhs, rhs)
681
+ )
682
+ ));
683
+ impl(i16, ComptSub(i16)(
684
+ (-) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(i16))(
685
+ __yo_i16_sub(lhs, rhs)
686
+ )
687
+ ));
688
+ impl(i16, ComptMul(i16)(
689
+ (*) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(i16))(
690
+ __yo_i16_mul(lhs, rhs)
691
+ )
692
+ ));
693
+ impl(i16, ComptDiv(i16)(
694
+ (/) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(i16))(
695
+ __yo_i16_div(lhs, rhs)
696
+ )
697
+ ));
698
+ impl(i16, ComptMod(i16)(
699
+ (%) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(i16))(
700
+ __yo_i16_mod(lhs, rhs)
701
+ )
702
+ ));
703
+ impl(i16, ComptNegate(i16)(
704
+ (neg) : (fn(compt(self): i16) -> compt(i16))(
705
+ __yo_i16_neg(self)
706
+ )
707
+ ));
708
+ impl(i16, ComptEq(i16)(
709
+ (==) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(bool))(
710
+ __yo_i16_eq(lhs, rhs)
711
+ ),
712
+ (!=) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(bool))(
713
+ __yo_i16_neq(lhs, rhs)
714
+ )
715
+ ));
716
+ impl(i16, ComptOrd(i16)(
717
+ (<) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(bool))(
718
+ __yo_i16_lt(lhs, rhs)
719
+ ),
720
+ (<=) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(bool))(
721
+ __yo_i16_lte(lhs, rhs)
722
+ ),
723
+ (>) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(bool))(
724
+ __yo_i16_gt(lhs, rhs)
725
+ ),
726
+ (>=) : (fn(compt(lhs): i16, compt(rhs): i16) -> compt(bool))(
727
+ __yo_i16_gte(lhs, rhs)
728
+ )
729
+ ));
730
+ impl(i16, {
731
+ (to_string) :: (fn(compt(self): i16) -> compt(compt_string))
732
+ __yo_i16_to_string(self)
733
+ ;
734
+ export to_string;
735
+ });
736
+ _i16 :: i16;
737
+ export i16 : _i16;
738
+
739
+ /// i32
740
+ impl(i32, Send());
741
+ impl(i32, Add(i32)(
742
+ (+): ((a, b) -> __yo_op_add(a, b))
743
+ ));
744
+ impl(i32, Sub(i32)(
745
+ (-): ((a, b) -> __yo_op_sub(a, b))
746
+ ));
747
+ impl(i32, Mul(i32)(
748
+ (*): ((a, b) -> __yo_op_mul(a, b))
749
+ ));
750
+ impl(i32, Div(i32)(
751
+ (/): ((a, b) -> __yo_op_div(a, b))
752
+ ));
753
+ impl(i32, Mod(i32)(
754
+ (%): ((a, b) -> __yo_op_mod(a, b))
755
+ ));
756
+ impl(i32, Negate(i32)(
757
+ (neg): ((a) -> __yo_op_neg(a))
758
+ ));
759
+ impl(i32, BitLeftShift(i32)(
760
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
761
+ ));
762
+ impl(i32, BitRightShift(i32)(
763
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
764
+ ));
765
+ impl(i32, LogicalNot(
766
+ (!): ((a) -> __yo_op_not(a))
767
+ ));
768
+ impl(i32, BitNot(i32)(
769
+ (~): ((a) -> __yo_op_bit_complement(a))
770
+ ));
771
+ impl(i32, BitAnd(i32)(
772
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
773
+ ));
774
+ impl(i32, BitOr(i32)(
775
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
776
+ ));
777
+ impl(i32, BitXor(i32)(
778
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
779
+ ));
780
+ impl(i32, Eq(i32)(
781
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
782
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
783
+ ));
784
+ impl(i32, Ord(i32)(
785
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
786
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
787
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
788
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
789
+ ));
790
+ impl(i32, Hash(
791
+ (hash): ((value) -> {
792
+ u32_value := u32(value);
793
+ u64(u32_value)
794
+ })
795
+ ));
796
+ impl(i32, Clone(i32)(
797
+ clone: ((self) ->
798
+ __yo_return_self(self)
799
+ )
800
+ ));
801
+ impl(i32, ComptAdd(i32)(
802
+ (+) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(i32))(
803
+ __yo_i32_add(lhs, rhs)
804
+ )
805
+ ));
806
+ impl(i32, ComptSub(i32)(
807
+ (-) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(i32))(
808
+ __yo_i32_sub(lhs, rhs)
809
+ )
810
+ ));
811
+ impl(i32, ComptMul(i32)(
812
+ (*) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(i32))(
813
+ __yo_i32_mul(lhs, rhs)
814
+ )
815
+ ));
816
+ impl(i32, ComptDiv(i32)(
817
+ (/) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(i32))(
818
+ __yo_i32_div(lhs, rhs)
819
+ )
820
+ ));
821
+ impl(i32, ComptMod(i32)(
822
+ (%) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(i32))(
823
+ __yo_i32_mod(lhs, rhs)
824
+ )
825
+ ));
826
+ impl(i32, ComptNegate(i32)(
827
+ (neg) : (fn(compt(self): i32) -> compt(i32))(
828
+ __yo_i32_neg(self)
829
+ )
830
+ ));
831
+ impl(i32, ComptEq(i32)(
832
+ (==) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(bool))(
833
+ __yo_i32_eq(lhs, rhs)
834
+ ),
835
+ (!=) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(bool))(
836
+ __yo_i32_neq(lhs, rhs)
837
+ )
838
+ ));
839
+ impl(i32, ComptOrd(i32)(
840
+ (<) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(bool))(
841
+ __yo_i32_lt(lhs, rhs)
842
+ ),
843
+ (<=) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(bool))(
844
+ __yo_i32_lte(lhs, rhs)
845
+ ),
846
+ (>) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(bool))(
847
+ __yo_i32_gt(lhs, rhs)
848
+ ),
849
+ (>=) : (fn(compt(lhs): i32, compt(rhs): i32) -> compt(bool))(
850
+ __yo_i32_gte(lhs, rhs)
851
+ )
852
+ ));
853
+ impl(i32, {
854
+ (to_string) :: (fn(compt(self): i32) -> compt(compt_string))
855
+ __yo_i32_to_string(self)
856
+ ;
857
+ export to_string;
858
+ });
859
+ _i32 :: i32;
860
+ export i32 : _i32;
861
+
862
+ /// i64
863
+ impl(i64, Send());
864
+ impl(i64, Add(i64)(
865
+ (+): ((a, b) -> __yo_op_add(a, b))
866
+ ));
867
+ impl(i64, Sub(i64)(
868
+ (-): ((a, b) -> __yo_op_sub(a, b))
869
+ ));
870
+ impl(i64, Mul(i64)(
871
+ (*): ((a, b) -> __yo_op_mul(a, b))
872
+ ));
873
+ impl(i64, Div(i64)(
874
+ (/): ((a, b) -> __yo_op_div(a, b))
875
+ ));
876
+ impl(i64, Mod(i64)(
877
+ (%): ((a, b) -> __yo_op_mod(a, b))
878
+ ));
879
+ impl(i64, Negate(i64)(
880
+ (neg): ((a) -> __yo_op_neg(a))
881
+ ));
882
+ impl(i64, BitLeftShift(i64)(
883
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
884
+ ));
885
+ impl(i64, BitRightShift(i64)(
886
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
887
+ ));
888
+ impl(i64, LogicalNot(
889
+ (!): ((a) -> __yo_op_not(a))
890
+ ));
891
+ impl(i64, BitNot(i64)(
892
+ (~): ((a) -> __yo_op_bit_complement(a))
893
+ ));
894
+ impl(i64, BitAnd(i64)(
895
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
896
+ ));
897
+ impl(i64, BitOr(i64)(
898
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
899
+ ));
900
+ impl(i64, BitXor(i64)(
901
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
902
+ ));
903
+ impl(i64, Eq(i64)(
904
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
905
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
906
+ ));
907
+ impl(i64, Ord(i64)(
908
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
909
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
910
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
911
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
912
+ ));
913
+ impl(i64, Hash(
914
+ (hash): ((value) -> u64(value))
915
+ ));
916
+ impl(i64, Clone(i64)(
917
+ clone: ((self) -> __yo_return_self(self))
918
+ ));
919
+ impl(i64, ComptAdd(i64)(
920
+ (+) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(i64))(
921
+ __yo_i64_add(lhs, rhs)
922
+ )
923
+ ));
924
+ impl(i64, ComptSub(i64)(
925
+ (-) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(i64))(
926
+ __yo_i64_sub(lhs, rhs)
927
+ )
928
+ ));
929
+ impl(i64, ComptMul(i64)(
930
+ (*) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(i64))(
931
+ __yo_i64_mul(lhs, rhs)
932
+ )
933
+ ));
934
+ impl(i64, ComptDiv(i64)(
935
+ (/) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(i64))(
936
+ __yo_i64_div(lhs, rhs)
937
+ )
938
+ ));
939
+ impl(i64, ComptMod(i64)(
940
+ (%) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(i64))(
941
+ __yo_i64_mod(lhs, rhs)
942
+ )
943
+ ));
944
+ impl(i64, ComptNegate(i64)(
945
+ (neg) : (fn(compt(self): i64) -> compt(i64))(
946
+ __yo_i64_neg(self)
947
+ )
948
+ ));
949
+ impl(i64, ComptEq(i64)(
950
+ (==) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(bool))(
951
+ __yo_i64_eq(lhs, rhs)
952
+ ),
953
+ (!=) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(bool))(
954
+ __yo_i64_neq(lhs, rhs)
955
+ )
956
+ ));
957
+ impl(i64, ComptOrd(i64)(
958
+ (<) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(bool))(
959
+ __yo_i64_lt(lhs, rhs)
960
+ ),
961
+ (<=) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(bool))(
962
+ __yo_i64_lte(lhs, rhs)
963
+ ),
964
+ (>) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(bool))(
965
+ __yo_i64_gt(lhs, rhs)
966
+ ),
967
+ (>=) : (fn(compt(lhs): i64, compt(rhs): i64) -> compt(bool))(
968
+ __yo_i64_gte(lhs, rhs)
969
+ )
970
+ ));
971
+ impl(i64, {
972
+ (to_string) :: (fn(compt(self): i64) -> compt(compt_string))
973
+ __yo_i64_to_string(self)
974
+ ;
975
+ export to_string;
976
+ });
977
+ _i64 :: i64;
978
+ export i64 : _i64;
979
+
980
+ /// u8
981
+ impl(u8, Send());
982
+ impl(u8, Add(u8)(
983
+ (+): ((a, b) -> __yo_op_add(a, b))
984
+ ));
985
+ impl(u8, Sub(u8)(
986
+ (-): ((a, b) -> __yo_op_sub(a, b))
987
+ ));
988
+ impl(u8, Mul(u8)(
989
+ (*): ((a, b) -> __yo_op_mul(a, b))
990
+ ));
991
+ impl(u8, Div(u8)(
992
+ (/): ((a, b) -> __yo_op_div(a, b))
993
+ ));
994
+ impl(u8, Mod(u8)(
995
+ (%): ((a, b) -> __yo_op_mod(a, b))
996
+ ));
997
+ impl(u8, Negate(u8)(
998
+ (neg): ((a) -> __yo_op_neg(a))
999
+ ));
1000
+ impl(u8, BitLeftShift(u8)(
1001
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
1002
+ ));
1003
+ impl(u8, BitRightShift(u8)(
1004
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
1005
+ ));
1006
+ impl(u8, LogicalNot(
1007
+ (!): ((a) -> __yo_op_not(a))
1008
+ ));
1009
+ impl(u8, BitNot(u8)(
1010
+ (~): ((a) -> __yo_op_bit_complement(a))
1011
+ ));
1012
+ impl(u8, BitAnd(u8)(
1013
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1014
+ ));
1015
+ impl(u8, BitOr(u8)(
1016
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1017
+ ));
1018
+ impl(u8, BitXor(u8)(
1019
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1020
+ ));
1021
+ impl(u8, Eq(u8)(
1022
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1023
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1024
+ ));
1025
+ impl(u8, Ord(u8)(
1026
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1027
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1028
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1029
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1030
+ ));
1031
+ impl(u8, Hash(
1032
+ (hash): ((value) -> u64(value))
1033
+ ));
1034
+ impl(u8, Clone(u8)(
1035
+ clone: ((self) -> __yo_return_self(self))
1036
+ ));
1037
+ impl(u8, ComptAdd(u8)(
1038
+ (+) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(u8))(
1039
+ __yo_u8_add(lhs, rhs)
1040
+ )
1041
+ ));
1042
+ impl(u8, ComptSub(u8)(
1043
+ (-) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(u8))(
1044
+ __yo_u8_sub(lhs, rhs)
1045
+ )
1046
+ ));
1047
+ impl(u8, ComptMul(u8)(
1048
+ (*) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(u8))(
1049
+ __yo_u8_mul(lhs, rhs)
1050
+ )
1051
+ ));
1052
+ impl(u8, ComptDiv(u8)(
1053
+ (/) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(u8))(
1054
+ __yo_u8_div(lhs, rhs)
1055
+ )
1056
+ ));
1057
+ impl(u8, ComptMod(u8)(
1058
+ (%) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(u8))(
1059
+ __yo_u8_mod(lhs, rhs)
1060
+ )
1061
+ ));
1062
+ impl(u8, ComptEq(u8)(
1063
+ (==) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(bool))(
1064
+ __yo_u8_eq(lhs, rhs)
1065
+ ),
1066
+ (!=) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(bool))(
1067
+ __yo_u8_neq(lhs, rhs)
1068
+ )
1069
+ ));
1070
+ impl(u8, ComptOrd(u8)(
1071
+ (<) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(bool))(
1072
+ __yo_u8_lt(lhs, rhs)
1073
+ ),
1074
+ (<=) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(bool))(
1075
+ __yo_u8_lte(lhs, rhs)
1076
+ ),
1077
+ (>) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(bool))(
1078
+ __yo_u8_gt(lhs, rhs)
1079
+ ),
1080
+ (>=) : (fn(compt(lhs): u8, compt(rhs): u8) -> compt(bool))(
1081
+ __yo_u8_gte(lhs, rhs)
1082
+ )
1083
+ ));
1084
+ impl(u8, {
1085
+ (to_string) :: (fn(compt(self): u8) -> compt(compt_string))
1086
+ __yo_u8_to_string(self)
1087
+ ;
1088
+ export to_string;
1089
+ });
1090
+ _u8 :: u8;
1091
+ export u8 : _u8;
1092
+
1093
+ /// u16
1094
+ impl(u16, Send());
1095
+ impl(u16, Add(u16)(
1096
+ (+): ((a, b) -> __yo_op_add(a, b))
1097
+ ));
1098
+ impl(u16, Sub(u16)(
1099
+ (-): ((a, b) -> __yo_op_sub(a, b))
1100
+ ));
1101
+ impl(u16, Mul(u16)(
1102
+ (*): ((a, b) -> __yo_op_mul(a, b))
1103
+ ));
1104
+ impl(u16, Div(u16)(
1105
+ (/): ((a, b) -> __yo_op_div(a, b))
1106
+ ));
1107
+ impl(u16, Mod(u16)(
1108
+ (%): ((a, b) -> __yo_op_mod(a, b))
1109
+ ));
1110
+ impl(u16, Negate(u16)(
1111
+ (neg): ((a) -> __yo_op_neg(a))
1112
+ ));
1113
+ impl(u16, BitLeftShift(u16)(
1114
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
1115
+ ));
1116
+ impl(u16, BitRightShift(u16)(
1117
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
1118
+ ));
1119
+ impl(u16, LogicalNot(
1120
+ (!): ((a) -> __yo_op_not(a))
1121
+ ));
1122
+ impl(u16, BitNot(u16)(
1123
+ (~): ((a) -> __yo_op_bit_complement(a))
1124
+ ));
1125
+ impl(u16, BitAnd(u16)(
1126
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1127
+ ));
1128
+ impl(u16, BitOr(u16)(
1129
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1130
+ ));
1131
+ impl(u16, BitXor(u16)(
1132
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1133
+ ));
1134
+ impl(u16, Eq(u16)(
1135
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1136
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1137
+ ));
1138
+ impl(u16, Ord(u16)(
1139
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1140
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1141
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1142
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1143
+ ));
1144
+ impl(u16, Hash(
1145
+ (hash): ((value) -> u64(value))
1146
+ ));
1147
+ impl(u16, Clone(u16)(
1148
+ clone: ((self) -> __yo_return_self(self))
1149
+ ));
1150
+ impl(u16, ComptAdd(u16)(
1151
+ (+) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(u16))(
1152
+ __yo_u16_add(lhs, rhs)
1153
+ )
1154
+ ));
1155
+ impl(u16, ComptSub(u16)(
1156
+ (-) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(u16))(
1157
+ __yo_u16_sub(lhs, rhs)
1158
+ )
1159
+ ));
1160
+ impl(u16, ComptMul(u16)(
1161
+ (*) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(u16))(
1162
+ __yo_u16_mul(lhs, rhs)
1163
+ )
1164
+ ));
1165
+ impl(u16, ComptDiv(u16)(
1166
+ (/) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(u16))(
1167
+ __yo_u16_div(lhs, rhs)
1168
+ )
1169
+ ));
1170
+ impl(u16, ComptMod(u16)(
1171
+ (%) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(u16))(
1172
+ __yo_u16_mod(lhs, rhs)
1173
+ )
1174
+ ));
1175
+ impl(u16, ComptEq(u16)(
1176
+ (==) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(bool))(
1177
+ __yo_u16_eq(lhs, rhs)
1178
+ ),
1179
+ (!=) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(bool))(
1180
+ __yo_u16_neq(lhs, rhs)
1181
+ )
1182
+ ));
1183
+ impl(u16, ComptOrd(u16)(
1184
+ (<) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(bool))(
1185
+ __yo_u16_lt(lhs, rhs)
1186
+ ),
1187
+ (<=) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(bool))(
1188
+ __yo_u16_lte(lhs, rhs)
1189
+ ),
1190
+ (>) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(bool))(
1191
+ __yo_u16_gt(lhs, rhs)
1192
+ ),
1193
+ (>=) : (fn(compt(lhs): u16, compt(rhs): u16) -> compt(bool))(
1194
+ __yo_u16_gte(lhs, rhs)
1195
+ )
1196
+ ));
1197
+ impl(u16, {
1198
+ (to_string) :: (fn(compt(self): u16) -> compt(compt_string))
1199
+ __yo_u16_to_string(self)
1200
+ ;
1201
+ export to_string;
1202
+ });
1203
+ _u16 :: u16;
1204
+ export u16 : _u16;
1205
+
1206
+ /// u32
1207
+ impl(u32, Send());
1208
+ impl(u32, Add(u32)(
1209
+ (+): ((a, b) -> __yo_op_add(a, b))
1210
+ ));
1211
+ impl(u32, Sub(u32)(
1212
+ (-): ((a, b) -> __yo_op_sub(a, b))
1213
+ ));
1214
+ impl(u32, Mul(u32)(
1215
+ (*): ((a, b) -> __yo_op_mul(a, b))
1216
+ ));
1217
+ impl(u32, Div(u32)(
1218
+ (/): ((a, b) -> __yo_op_div(a, b))
1219
+ ));
1220
+ impl(u32, Mod(u32)(
1221
+ (%): ((a, b) -> __yo_op_mod(a, b))
1222
+ ));
1223
+ impl(u32, Negate(u32)(
1224
+ (neg): ((a) -> __yo_op_neg(a))
1225
+ ));
1226
+ impl(u32, BitLeftShift(u32)(
1227
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
1228
+ ));
1229
+ impl(u32, BitRightShift(u32)(
1230
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
1231
+ ));
1232
+ impl(u32, LogicalNot(
1233
+ (!): ((a) -> __yo_op_not(a))
1234
+ ));
1235
+ impl(u32, BitNot(u32)(
1236
+ (~): ((a) -> __yo_op_bit_complement(a))
1237
+ ));
1238
+ impl(u32, BitAnd(u32)(
1239
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1240
+ ));
1241
+ impl(u32, BitOr(u32)(
1242
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1243
+ ));
1244
+ impl(u32, BitXor(u32)(
1245
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1246
+ ));
1247
+ impl(u32, Eq(u32)(
1248
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1249
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1250
+ ));
1251
+ impl(u32, Ord(u32)(
1252
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1253
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1254
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1255
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1256
+ ));
1257
+ impl(u32, Hash(
1258
+ (hash): ((value) -> u64(value))
1259
+ ));
1260
+ impl(u32, Clone(u32)(
1261
+ clone: ((self) -> __yo_return_self(self))
1262
+ ));
1263
+ impl(u32, ComptAdd(u32)(
1264
+ (+) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(u32))(
1265
+ __yo_u32_add(lhs, rhs)
1266
+ )
1267
+ ));
1268
+ impl(u32, ComptSub(u32)(
1269
+ (-) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(u32))(
1270
+ __yo_u32_sub(lhs, rhs)
1271
+ )
1272
+ ));
1273
+ impl(u32, ComptMul(u32)(
1274
+ (*) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(u32))(
1275
+ __yo_u32_mul(lhs, rhs)
1276
+ )
1277
+ ));
1278
+ impl(u32, ComptDiv(u32)(
1279
+ (/) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(u32))(
1280
+ __yo_u32_div(lhs, rhs)
1281
+ )
1282
+ ));
1283
+ impl(u32, ComptMod(u32)(
1284
+ (%) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(u32))(
1285
+ __yo_u32_mod(lhs, rhs)
1286
+ )
1287
+ ));
1288
+ impl(u32, ComptEq(u32)(
1289
+ (==) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(bool))(
1290
+ __yo_u32_eq(lhs, rhs)
1291
+ ),
1292
+ (!=) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(bool))(
1293
+ __yo_u32_neq(lhs, rhs)
1294
+ )
1295
+ ));
1296
+ impl(u32, ComptOrd(u32)(
1297
+ (<) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(bool))(
1298
+ __yo_u32_lt(lhs, rhs)
1299
+ ),
1300
+ (<=) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(bool))(
1301
+ __yo_u32_lte(lhs, rhs)
1302
+ ),
1303
+ (>) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(bool))(
1304
+ __yo_u32_gt(lhs, rhs)
1305
+ ),
1306
+ (>=) : (fn(compt(lhs): u32, compt(rhs): u32) -> compt(bool))(
1307
+ __yo_u32_gte(lhs, rhs)
1308
+ )
1309
+ ));
1310
+ impl(u32, {
1311
+ (to_string) :: (fn(compt(self): u32) -> compt(compt_string))
1312
+ __yo_u32_to_string(self)
1313
+ ;
1314
+ export to_string;
1315
+ });
1316
+ _u32 :: u32;
1317
+ export u32 : _u32;
1318
+
1319
+ /// u64
1320
+ impl(u64, Send());
1321
+ impl(u64, Add(u64)(
1322
+ (+): ((a, b) -> __yo_op_add(a, b))
1323
+ ));
1324
+ impl(u64, Sub(u64)(
1325
+ (-): ((a, b) -> __yo_op_sub(a, b))
1326
+ ));
1327
+ impl(u64, Mul(u64)(
1328
+ (*): ((a, b) -> __yo_op_mul(a, b))
1329
+ ));
1330
+ impl(u64, Div(u64)(
1331
+ (/): ((a, b) -> __yo_op_div(a, b))
1332
+ ));
1333
+ impl(u64, Mod(u64)(
1334
+ (%): ((a, b) -> __yo_op_mod(a, b))
1335
+ ));
1336
+ impl(u64, Negate(u64)(
1337
+ (neg): ((a) -> __yo_op_neg(a))
1338
+ ));
1339
+ impl(u64, BitLeftShift(u64)(
1340
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
1341
+ ));
1342
+ impl(u64, BitRightShift(u64)(
1343
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
1344
+ ));
1345
+ impl(u64, LogicalNot(
1346
+ (!): ((a) -> __yo_op_not(a))
1347
+ ));
1348
+ impl(u64, BitNot(u64)(
1349
+ (~): ((a) -> __yo_op_bit_complement(a))
1350
+ ));
1351
+ impl(u64, BitAnd(u64)(
1352
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1353
+ ));
1354
+ impl(u64, BitOr(u64)(
1355
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1356
+ ));
1357
+ impl(u64, BitXor(u64)(
1358
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1359
+ ));
1360
+ impl(u64, Eq(u64)(
1361
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1362
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1363
+ ));
1364
+ impl(u64, Ord(u64)(
1365
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1366
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1367
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1368
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1369
+ ));
1370
+ impl(u64, Hash(
1371
+ (hash): ((value) -> value)
1372
+ ));
1373
+ impl(u64, Clone(u64)(
1374
+ clone: ((self) -> __yo_return_self(self))
1375
+ ));
1376
+ impl(u64, ComptAdd(u64)(
1377
+ (+) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(u64))(
1378
+ __yo_u64_add(lhs, rhs)
1379
+ )
1380
+ ));
1381
+ impl(u64, ComptSub(u64)(
1382
+ (-) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(u64))(
1383
+ __yo_u64_sub(lhs, rhs)
1384
+ )
1385
+ ));
1386
+ impl(u64, ComptMul(u64)(
1387
+ (*) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(u64))(
1388
+ __yo_u64_mul(lhs, rhs)
1389
+ )
1390
+ ));
1391
+ impl(u64, ComptDiv(u64)(
1392
+ (/) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(u64))(
1393
+ __yo_u64_div(lhs, rhs)
1394
+ )
1395
+ ));
1396
+ impl(u64, ComptMod(u64)(
1397
+ (%) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(u64))(
1398
+ __yo_u64_mod(lhs, rhs)
1399
+ )
1400
+ ));
1401
+ impl(u64, ComptEq(u64)(
1402
+ (==) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(bool))(
1403
+ __yo_u64_eq(lhs, rhs)
1404
+ ),
1405
+ (!=) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(bool))(
1406
+ __yo_u64_neq(lhs, rhs)
1407
+ )
1408
+ ));
1409
+ impl(u64, ComptOrd(u64)(
1410
+ (<) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(bool))(
1411
+ __yo_u64_lt(lhs, rhs)
1412
+ ),
1413
+ (<=) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(bool))(
1414
+ __yo_u64_lte(lhs, rhs)
1415
+ ),
1416
+ (>) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(bool))(
1417
+ __yo_u64_gt(lhs, rhs)
1418
+ ),
1419
+ (>=) : (fn(compt(lhs): u64, compt(rhs): u64) -> compt(bool))(
1420
+ __yo_u64_gte(lhs, rhs)
1421
+ )
1422
+ ));
1423
+ impl(u64, {
1424
+ (to_string) :: (fn(compt(self): u64) -> compt(compt_string))
1425
+ __yo_u64_to_string(self)
1426
+ ;
1427
+ export to_string;
1428
+ });
1429
+ _u64 :: u64;
1430
+ export u64 : _u64;
1431
+
1432
+ /// f32
1433
+ impl(f32, Send());
1434
+ impl(f32, Add(f32)(
1435
+ (+): ((a, b) -> __yo_op_add(a, b))
1436
+ ));
1437
+ impl(f32, Sub(f32)(
1438
+ (-): ((a, b) -> __yo_op_sub(a, b))
1439
+ ));
1440
+ impl(f32, Mul(f32)(
1441
+ (*): ((a, b) -> __yo_op_mul(a, b))
1442
+ ));
1443
+ impl(f32, Div(f32)(
1444
+ (/): ((a, b) -> __yo_op_div(a, b))
1445
+ ));
1446
+ impl(f32, Mod(f32)(
1447
+ (%): ((a, b) -> __yo_op_mod(a, b))
1448
+ ));
1449
+ impl(f32, Negate(f32)(
1450
+ (neg): ((a) -> __yo_op_neg(a))
1451
+ ));
1452
+ impl(f32, LogicalNot(
1453
+ (!): ((a) -> __yo_op_not(a))
1454
+ ));
1455
+ impl(f32, BitNot(f32)(
1456
+ (~): ((a) -> __yo_op_bit_complement(a))
1457
+ ));
1458
+ impl(f32, BitAnd(f32)(
1459
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1460
+ ));
1461
+ impl(f32, BitOr(f32)(
1462
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1463
+ ));
1464
+ impl(f32, BitXor(f32)(
1465
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1466
+ ));
1467
+ impl(f32, Eq(f32)(
1468
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1469
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1470
+ ));
1471
+ impl(f32, Ord(f32)(
1472
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1473
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1474
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1475
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1476
+ ));
1477
+ impl(f32, Hash(
1478
+ (hash): ((value) -> u64(i32(value)))
1479
+ ));
1480
+ impl(f32, Clone(f32)(
1481
+ clone: ((self) -> __yo_return_self(self))
1482
+ ));
1483
+ impl(f32, ComptAdd(f32)(
1484
+ (+) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(f32))(
1485
+ __yo_f32_add(lhs, rhs)
1486
+ )
1487
+ ));
1488
+ impl(f32, ComptSub(f32)(
1489
+ (-) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(f32))(
1490
+ __yo_f32_sub(lhs, rhs)
1491
+ )
1492
+ ));
1493
+ impl(f32, ComptMul(f32)(
1494
+ (*) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(f32))(
1495
+ __yo_f32_mul(lhs, rhs)
1496
+ )
1497
+ ));
1498
+ impl(f32, ComptDiv(f32)(
1499
+ (/) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(f32))(
1500
+ __yo_f32_div(lhs, rhs)
1501
+ )
1502
+ ));
1503
+ impl(f32, ComptNegate(f32)(
1504
+ (neg) : (fn(compt(self): f32) -> compt(f32))(
1505
+ __yo_f32_neg(self)
1506
+ )
1507
+ ));
1508
+ impl(f32, ComptEq(f32)(
1509
+ (==) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(bool))(
1510
+ __yo_f32_eq(lhs, rhs)
1511
+ ),
1512
+ (!=) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(bool))(
1513
+ __yo_f32_neq(lhs, rhs)
1514
+ )
1515
+ ));
1516
+ impl(f32, ComptOrd(f32)(
1517
+ (<) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(bool))(
1518
+ __yo_f32_lt(lhs, rhs)
1519
+ ),
1520
+ (<=) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(bool))(
1521
+ __yo_f32_lte(lhs, rhs)
1522
+ ),
1523
+ (>) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(bool))(
1524
+ __yo_f32_gt(lhs, rhs)
1525
+ ),
1526
+ (>=) : (fn(compt(lhs): f32, compt(rhs): f32) -> compt(bool))(
1527
+ __yo_f32_gte(lhs, rhs)
1528
+ )
1529
+ ));
1530
+ impl(f32, {
1531
+ (to_string) :: (fn(compt(self): f32) -> compt(compt_string))
1532
+ __yo_f32_to_string(self)
1533
+ ;
1534
+ export to_string;
1535
+ });
1536
+ _f32 :: f32;
1537
+ export f32 : _f32;
1538
+
1539
+ /// f64
1540
+ impl(f64, Send());
1541
+ impl(f64, Add(f64)(
1542
+ (+): ((a, b) -> __yo_op_add(a, b))
1543
+ ));
1544
+ impl(f64, Sub(f64)(
1545
+ (-): ((a, b) -> __yo_op_sub(a, b))
1546
+ ));
1547
+ impl(f64, Mul(f64)(
1548
+ (*): ((a, b) -> __yo_op_mul(a, b))
1549
+ ));
1550
+ impl(f64, Div(f64)(
1551
+ (/): ((a, b) -> __yo_op_div(a, b))
1552
+ ));
1553
+ impl(f64, Mod(f64)(
1554
+ (%): ((a, b) -> __yo_op_mod(a, b))
1555
+ ));
1556
+ impl(f64, Negate(f64)(
1557
+ (neg): ((a) -> __yo_op_neg(a))
1558
+ ));
1559
+ impl(f64, LogicalNot(
1560
+ (!): ((a) -> __yo_op_not(a))
1561
+ ));
1562
+ impl(f64, BitNot(f64)(
1563
+ (~): ((a) -> __yo_op_bit_complement(a))
1564
+ ));
1565
+ impl(f64, BitAnd(f64)(
1566
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1567
+ ));
1568
+ impl(f64, BitOr(f64)(
1569
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1570
+ ));
1571
+ impl(f64, BitXor(f64)(
1572
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1573
+ ));
1574
+ impl(f64, Eq(f64)(
1575
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1576
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1577
+ ));
1578
+ impl(f64, Ord(f64)(
1579
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1580
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1581
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1582
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1583
+ ));
1584
+ impl(f64, Hash(
1585
+ (hash): ((value) -> u64(i64(value)))
1586
+ ));
1587
+ impl(f64, Clone(f64)(
1588
+ clone: ((self) -> __yo_return_self(self))
1589
+ ));
1590
+ impl(f64, ComptAdd(f64)(
1591
+ (+) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(f64))(
1592
+ __yo_f64_add(lhs, rhs)
1593
+ )
1594
+ ));
1595
+ impl(f64, ComptSub(f64)(
1596
+ (-) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(f64))(
1597
+ __yo_f64_sub(lhs, rhs)
1598
+ )
1599
+ ));
1600
+ impl(f64, ComptMul(f64)(
1601
+ (*) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(f64))(
1602
+ __yo_f64_mul(lhs, rhs)
1603
+ )
1604
+ ));
1605
+ impl(f64, ComptDiv(f64)(
1606
+ (/) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(f64))(
1607
+ __yo_f64_div(lhs, rhs)
1608
+ )
1609
+ ));
1610
+ impl(f64, ComptNegate(f64)(
1611
+ (neg) : (fn(compt(self): f64) -> compt(f64))(
1612
+ __yo_f64_neg(self)
1613
+ )
1614
+ ));
1615
+ impl(f64, ComptEq(f64)(
1616
+ (==) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(bool))(
1617
+ __yo_f64_eq(lhs, rhs)
1618
+ ),
1619
+ (!=) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(bool))(
1620
+ __yo_f64_neq(lhs, rhs)
1621
+ )
1622
+ ));
1623
+ impl(f64, ComptOrd(f64)(
1624
+ (<) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(bool))(
1625
+ __yo_f64_lt(lhs, rhs)
1626
+ ),
1627
+ (<=) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(bool))(
1628
+ __yo_f64_lte(lhs, rhs)
1629
+ ),
1630
+ (>) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(bool))(
1631
+ __yo_f64_gt(lhs, rhs)
1632
+ ),
1633
+ (>=) : (fn(compt(lhs): f64, compt(rhs): f64) -> compt(bool))(
1634
+ __yo_f64_gte(lhs, rhs)
1635
+ )
1636
+ ));
1637
+ impl(f64, {
1638
+ (to_string) :: (fn(compt(self): f64) -> compt(compt_string))
1639
+ __yo_f64_to_string(self)
1640
+ ;
1641
+ export to_string;
1642
+ });
1643
+ _f64 :: f64;
1644
+ export f64 : _f64;
1645
+
1646
+ /// isize
1647
+ impl(isize, Send());
1648
+ impl(isize, Add(isize)(
1649
+ (+): ((a, b) -> __yo_op_add(a, b))
1650
+ ));
1651
+ impl(isize, Sub(isize)(
1652
+ (-): ((a, b) -> __yo_op_sub(a, b))
1653
+ ));
1654
+ impl(isize, Mul(isize)(
1655
+ (*): ((a, b) -> __yo_op_mul(a, b))
1656
+ ));
1657
+ impl(isize, Div(isize)(
1658
+ (/): ((a, b) -> __yo_op_div(a, b))
1659
+ ));
1660
+ impl(isize, Mod(isize)(
1661
+ (%): ((a, b) -> __yo_op_mod(a, b))
1662
+ ));
1663
+ impl(isize, Negate(isize)(
1664
+ (neg): ((a) -> __yo_op_neg(a))
1665
+ ));
1666
+ impl(isize, BitLeftShift(isize)(
1667
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
1668
+ ));
1669
+ impl(isize, BitRightShift(isize)(
1670
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
1671
+ ));
1672
+ impl(isize, LogicalNot(
1673
+ (!): ((a) -> __yo_op_not(a))
1674
+ ));
1675
+ impl(isize, BitNot(isize)(
1676
+ (~): ((a) -> __yo_op_bit_complement(a))
1677
+ ));
1678
+ impl(isize, BitAnd(isize)(
1679
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1680
+ ));
1681
+ impl(isize, BitOr(isize)(
1682
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1683
+ ));
1684
+ impl(isize, BitXor(isize)(
1685
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1686
+ ));
1687
+ impl(isize, Eq(isize)(
1688
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1689
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1690
+ ));
1691
+ impl(isize, Ord(isize)(
1692
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1693
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1694
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1695
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1696
+ ));
1697
+ impl(isize, Hash(
1698
+ (hash): ((value) -> u64(value))
1699
+ ));
1700
+ impl(isize, Clone(isize)(
1701
+ clone: ((self) -> __yo_return_self(self))
1702
+ ));
1703
+ impl(isize, ComptAdd(isize)(
1704
+ (+) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(isize))(
1705
+ __yo_isize_add(lhs, rhs)
1706
+ )
1707
+ ));
1708
+ impl(isize, ComptSub(isize)(
1709
+ (-) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(isize))(
1710
+ __yo_isize_sub(lhs, rhs)
1711
+ )
1712
+ ));
1713
+ impl(isize, ComptMul(isize)(
1714
+ (*) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(isize))(
1715
+ __yo_isize_mul(lhs, rhs)
1716
+ )
1717
+ ));
1718
+ impl(isize, ComptDiv(isize)(
1719
+ (/) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(isize))(
1720
+ __yo_isize_div(lhs, rhs)
1721
+ )
1722
+ ));
1723
+ impl(isize, ComptMod(isize)(
1724
+ (%) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(isize))(
1725
+ __yo_isize_mod(lhs, rhs)
1726
+ )
1727
+ ));
1728
+ impl(isize, ComptNegate(isize)(
1729
+ (neg) : (fn(compt(self): isize) -> compt(isize))(
1730
+ __yo_isize_neg(self)
1731
+ )
1732
+ ));
1733
+ impl(isize, ComptEq(isize)(
1734
+ (==) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(bool))(
1735
+ __yo_isize_eq(lhs, rhs)
1736
+ ),
1737
+ (!=) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(bool))(
1738
+ __yo_isize_neq(lhs, rhs)
1739
+ )
1740
+ ));
1741
+ impl(isize, ComptOrd(isize)(
1742
+ (<) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(bool))(
1743
+ __yo_isize_lt(lhs, rhs)
1744
+ ),
1745
+ (<=) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(bool))(
1746
+ __yo_isize_lte(lhs, rhs)
1747
+ ),
1748
+ (>) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(bool))(
1749
+ __yo_isize_gt(lhs, rhs)
1750
+ ),
1751
+ (>=) : (fn(compt(lhs): isize, compt(rhs): isize) -> compt(bool))(
1752
+ __yo_isize_gte(lhs, rhs)
1753
+ )
1754
+ ));
1755
+ impl(isize, {
1756
+ (to_string) :: (fn(compt(self): isize) -> compt(compt_string))
1757
+ __yo_isize_to_string(self)
1758
+ ;
1759
+ export to_string;
1760
+ });
1761
+ _isize :: isize;
1762
+ export isize : _isize;
1763
+
1764
+ /// usize
1765
+ impl(usize, Send());
1766
+ impl(usize, Add(usize)(
1767
+ (+): ((a, b) -> __yo_op_add(a, b))
1768
+ ));
1769
+ impl(usize, Sub(usize)(
1770
+ (-): ((a, b) -> __yo_op_sub(a, b))
1771
+ ));
1772
+ impl(usize, Mul(usize)(
1773
+ (*): ((a, b) -> __yo_op_mul(a, b))
1774
+ ));
1775
+ impl(usize, Div(usize)(
1776
+ (/): ((a, b) -> __yo_op_div(a, b))
1777
+ ));
1778
+ impl(usize, Mod(usize)(
1779
+ (%): ((a, b) -> __yo_op_mod(a, b))
1780
+ ));
1781
+ impl(usize, Negate(usize)(
1782
+ (neg): ((a) -> __yo_op_neg(a))
1783
+ ));
1784
+ impl(usize, BitLeftShift(usize)(
1785
+ (<<): ((a, b) -> __yo_op_bit_left_shift(a, b))
1786
+ ));
1787
+ impl(usize, BitRightShift(usize)(
1788
+ (>>): ((a, b) -> __yo_op_bit_right_shift(a, b))
1789
+ ));
1790
+ impl(usize, LogicalNot(
1791
+ (!): ((a) -> __yo_op_not(a))
1792
+ ));
1793
+ impl(usize, BitNot(usize)(
1794
+ (~): ((a) -> __yo_op_bit_complement(a))
1795
+ ));
1796
+ impl(usize, BitAnd(usize)(
1797
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1798
+ ));
1799
+ impl(usize, BitOr(usize)(
1800
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1801
+ ));
1802
+ impl(usize, BitXor(usize)(
1803
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1804
+ ));
1805
+ impl(usize, Eq(usize)(
1806
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1807
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1808
+ ));
1809
+ impl(usize, Ord(usize)(
1810
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1811
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1812
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1813
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1814
+ ));
1815
+ impl(usize, Hash(
1816
+ (hash): ((value) -> u64(value))
1817
+ ));
1818
+ impl(usize, Clone(usize)(
1819
+ clone: ((self) -> __yo_return_self(self))
1820
+ ));
1821
+ impl(usize, ComptAdd(usize)(
1822
+ (+) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(usize))(
1823
+ __yo_usize_add(lhs, rhs)
1824
+ )
1825
+ ));
1826
+ impl(usize, ComptSub(usize)(
1827
+ (-) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(usize))(
1828
+ __yo_usize_sub(lhs, rhs)
1829
+ )
1830
+ ));
1831
+ impl(usize, ComptMul(usize)(
1832
+ (*) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(usize))(
1833
+ __yo_usize_mul(lhs, rhs)
1834
+ )
1835
+ ));
1836
+ impl(usize, ComptDiv(usize)(
1837
+ (/) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(usize))(
1838
+ __yo_usize_div(lhs, rhs)
1839
+ )
1840
+ ));
1841
+ impl(usize, ComptMod(usize)(
1842
+ (%) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(usize))(
1843
+ __yo_usize_mod(lhs, rhs)
1844
+ )
1845
+ ));
1846
+ impl(usize, ComptEq(usize)(
1847
+ (==) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(bool))(
1848
+ __yo_usize_eq(lhs, rhs)
1849
+ ),
1850
+ (!=) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(bool))(
1851
+ __yo_usize_neq(lhs, rhs)
1852
+ )
1853
+ ));
1854
+ impl(usize, ComptOrd(usize)(
1855
+ (<) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(bool))(
1856
+ __yo_usize_lt(lhs, rhs)
1857
+ ),
1858
+ (<=) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(bool))(
1859
+ __yo_usize_lte(lhs, rhs)
1860
+ ),
1861
+ (>) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(bool))(
1862
+ __yo_usize_gt(lhs, rhs)
1863
+ ),
1864
+ (>=) : (fn(compt(lhs): usize, compt(rhs): usize) -> compt(bool))(
1865
+ __yo_usize_gte(lhs, rhs)
1866
+ )
1867
+ ));
1868
+ impl(usize, {
1869
+ (to_string) :: (fn(compt(self): usize) -> compt(compt_string))
1870
+ __yo_usize_to_string(self)
1871
+ ;
1872
+ export to_string;
1873
+ });
1874
+ _usize :: usize;
1875
+ export usize : _usize;
1876
+
1877
+ /// char
1878
+ impl(char, Send());
1879
+ impl(char, Add(char)(
1880
+ (+): ((a, b) -> __yo_op_add(a, b))
1881
+ ));
1882
+ impl(char, Sub(char)(
1883
+ (-): ((a, b) -> __yo_op_sub(a, b))
1884
+ ));
1885
+ impl(char, Mul(char)(
1886
+ (*): ((a, b) -> __yo_op_mul(a, b))
1887
+ ));
1888
+ impl(char, Div(char)(
1889
+ (/): ((a, b) -> __yo_op_div(a, b))
1890
+ ));
1891
+ impl(char, Mod(char)(
1892
+ (%): ((a, b) -> __yo_op_mod(a, b))
1893
+ ));
1894
+ impl(char, Negate(char)(
1895
+ (neg): ((a) -> __yo_op_neg(a))
1896
+ ));
1897
+ impl(char, LogicalNot(
1898
+ (!): ((a) -> __yo_op_not(a))
1899
+ ));
1900
+ impl(char, BitNot(char)(
1901
+ (~): ((a) -> __yo_op_bit_complement(a))
1902
+ ));
1903
+ impl(char, BitAnd(char)(
1904
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1905
+ ));
1906
+ impl(char, BitOr(char)(
1907
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1908
+ ));
1909
+ impl(char, BitXor(char)(
1910
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1911
+ ));
1912
+ impl(char, Eq(char)(
1913
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1914
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1915
+ ));
1916
+ impl(char, Ord(char)(
1917
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1918
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1919
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1920
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1921
+ ));
1922
+ impl(char, Hash(
1923
+ (hash): ((value) -> u64(value))
1924
+ ));
1925
+ impl(char, Clone(char)(
1926
+ clone: ((self) -> __yo_return_self(self))
1927
+ ));
1928
+ _char :: char;
1929
+ export char : _char;
1930
+
1931
+ /// int
1932
+ impl(int, Send());
1933
+ impl(int, Add(int)(
1934
+ (+): ((a, b) -> __yo_op_add(a, b))
1935
+ ));
1936
+ impl(int, Sub(int)(
1937
+ (-): ((a, b) -> __yo_op_sub(a, b))
1938
+ ));
1939
+ impl(int, Mul(int)(
1940
+ (*): ((a, b) -> __yo_op_mul(a, b))
1941
+ ));
1942
+ impl(int, Div(int)(
1943
+ (/): ((a, b) -> __yo_op_div(a, b))
1944
+ ));
1945
+ impl(int, Mod(int)(
1946
+ (%): ((a, b) -> __yo_op_mod(a, b))
1947
+ ));
1948
+ impl(int, Negate(int)(
1949
+ (neg): ((a) -> __yo_op_neg(a))
1950
+ ));
1951
+ impl(int, LogicalNot(
1952
+ (!): ((a) -> __yo_op_not(a))
1953
+ ));
1954
+ impl(int, BitNot(int)(
1955
+ (~): ((a) -> __yo_op_bit_complement(a))
1956
+ ));
1957
+ impl(int, BitAnd(int)(
1958
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
1959
+ ));
1960
+ impl(int, BitOr(int)(
1961
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
1962
+ ));
1963
+ impl(int, BitXor(int)(
1964
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
1965
+ ));
1966
+ impl(int, Eq(int)(
1967
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
1968
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
1969
+ ));
1970
+ impl(int, Ord(int)(
1971
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
1972
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
1973
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
1974
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
1975
+ ));
1976
+ impl(int, Hash(
1977
+ (hash): ((value) -> u64(value))
1978
+ ));
1979
+ impl(int, Clone(int)(
1980
+ clone: ((self) -> __yo_return_self(self))
1981
+ ));
1982
+ _int :: int;
1983
+ export int : _int;
1984
+
1985
+ /// uint
1986
+ impl(uint, Send());
1987
+ impl(uint, Add(uint)(
1988
+ (+): ((a, b) -> __yo_op_add(a, b))
1989
+ ));
1990
+ impl(uint, Sub(uint)(
1991
+ (-): ((a, b) -> __yo_op_sub(a, b))
1992
+ ));
1993
+ impl(uint, Mul(uint)(
1994
+ (*): ((a, b) -> __yo_op_mul(a, b))
1995
+ ));
1996
+ impl(uint, Div(uint)(
1997
+ (/): ((a, b) -> __yo_op_div(a, b))
1998
+ ));
1999
+ impl(uint, Mod(uint)(
2000
+ (%): ((a, b) -> __yo_op_mod(a, b))
2001
+ ));
2002
+ impl(uint, Negate(uint)(
2003
+ (neg): ((a) -> __yo_op_neg(a))
2004
+ ));
2005
+ impl(uint, LogicalNot(
2006
+ (!): ((a) -> __yo_op_not(a))
2007
+ ));
2008
+ impl(uint, BitNot(uint)(
2009
+ (~): ((a) -> __yo_op_bit_complement(a))
2010
+ ));
2011
+ impl(uint, BitAnd(uint)(
2012
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
2013
+ ));
2014
+ impl(uint, BitOr(uint)(
2015
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
2016
+ ));
2017
+ impl(uint, BitXor(uint)(
2018
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
2019
+ ));
2020
+ impl(uint, Eq(uint)(
2021
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
2022
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
2023
+ ));
2024
+ impl(uint, Ord(uint)(
2025
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
2026
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
2027
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
2028
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
2029
+ ));
2030
+ impl(uint, Hash(
2031
+ (hash): ((value) -> u64(value))
2032
+ ));
2033
+ impl(uint, Clone(uint)(
2034
+ clone: ((self) -> __yo_return_self(self))
2035
+ ));
2036
+ _uint :: uint;
2037
+ export uint : _uint;
2038
+
2039
+ /// short
2040
+ impl(short, Send());
2041
+ impl(short, Add(short)(
2042
+ (+): ((a, b) -> __yo_op_add(a, b))
2043
+ ));
2044
+ impl(short, Sub(short)(
2045
+ (-): ((a, b) -> __yo_op_sub(a, b))
2046
+ ));
2047
+ impl(short, Mul(short)(
2048
+ (*): ((a, b) -> __yo_op_mul(a, b))
2049
+ ));
2050
+ impl(short, Div(short)(
2051
+ (/): ((a, b) -> __yo_op_div(a, b))
2052
+ ));
2053
+ impl(short, Mod(short)(
2054
+ (%): ((a, b) -> __yo_op_mod(a, b))
2055
+ ));
2056
+ impl(short, Negate(short)(
2057
+ (neg): ((a) -> __yo_op_neg(a))
2058
+ ));
2059
+ impl(short, LogicalNot(
2060
+ (!): ((a) -> __yo_op_not(a))
2061
+ ));
2062
+ impl(short, BitNot(short)(
2063
+ (~): ((a) -> __yo_op_bit_complement(a))
2064
+ ));
2065
+ impl(short, BitAnd(short)(
2066
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
2067
+ ));
2068
+ impl(short, BitOr(short)(
2069
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
2070
+ ));
2071
+ impl(short, BitXor(short)(
2072
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
2073
+ ));
2074
+ impl(short, Eq(short)(
2075
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
2076
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
2077
+ ));
2078
+ impl(short, Ord(short)(
2079
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
2080
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
2081
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
2082
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
2083
+ ));
2084
+ impl(short, Hash(
2085
+ (hash): ((value) -> u64(value))
2086
+ ));
2087
+ impl(short, Clone(short)(
2088
+ clone: ((self) -> __yo_return_self(self))
2089
+ ));
2090
+ _short :: short;
2091
+ export short : _short;
2092
+
2093
+ /// ushort
2094
+ impl(ushort, Send());
2095
+ impl(ushort, Add(ushort)(
2096
+ (+): ((a, b) -> __yo_op_add(a, b))
2097
+ ));
2098
+ impl(ushort, Sub(ushort)(
2099
+ (-): ((a, b) -> __yo_op_sub(a, b))
2100
+ ));
2101
+ impl(ushort, Mul(ushort)(
2102
+ (*): ((a, b) -> __yo_op_mul(a, b))
2103
+ ));
2104
+ impl(ushort, Div(ushort)(
2105
+ (/): ((a, b) -> __yo_op_div(a, b))
2106
+ ));
2107
+ impl(ushort, Mod(ushort)(
2108
+ (%): ((a, b) -> __yo_op_mod(a, b))
2109
+ ));
2110
+ impl(ushort, Negate(ushort)(
2111
+ (neg): ((a) -> __yo_op_neg(a))
2112
+ ));
2113
+ impl(ushort, LogicalNot(
2114
+ (!): ((a) -> __yo_op_not(a))
2115
+ ));
2116
+ impl(ushort, BitNot(ushort)(
2117
+ (~): ((a) -> __yo_op_bit_complement(a))
2118
+ ));
2119
+ impl(ushort, BitAnd(ushort)(
2120
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
2121
+ ));
2122
+ impl(ushort, BitOr(ushort)(
2123
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
2124
+ ));
2125
+ impl(ushort, BitXor(ushort)(
2126
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
2127
+ ));
2128
+ impl(ushort, Eq(ushort)(
2129
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
2130
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
2131
+ ));
2132
+ impl(ushort, Ord(ushort)(
2133
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
2134
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
2135
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
2136
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
2137
+ ));
2138
+ impl(ushort, Hash(
2139
+ (hash): ((value) -> u64(value))
2140
+ ));
2141
+ impl(ushort, Clone(ushort)(
2142
+ clone: ((self) -> __yo_return_self(self))
2143
+ ));
2144
+ _ushort :: ushort;
2145
+ export ushort : _ushort;
2146
+
2147
+ /// long
2148
+ impl(long, Send());
2149
+ impl(long, Add(long)(
2150
+ (+): ((a, b) -> __yo_op_add(a, b))
2151
+ ));
2152
+ impl(long, Sub(long)(
2153
+ (-): ((a, b) -> __yo_op_sub(a, b))
2154
+ ));
2155
+ impl(long, Mul(long)(
2156
+ (*): ((a, b) -> __yo_op_mul(a, b))
2157
+ ));
2158
+ impl(long, Div(long)(
2159
+ (/): ((a, b) -> __yo_op_div(a, b))
2160
+ ));
2161
+ impl(long, Mod(long)(
2162
+ (%): ((a, b) -> __yo_op_mod(a, b))
2163
+ ));
2164
+ impl(long, Negate(long)(
2165
+ (neg): ((a) -> __yo_op_neg(a))
2166
+ ));
2167
+ impl(long, LogicalNot(
2168
+ (!): ((a) -> __yo_op_not(a))
2169
+ ));
2170
+ impl(long, BitNot(long)(
2171
+ (~): ((a) -> __yo_op_bit_complement(a))
2172
+ ));
2173
+ impl(long, BitAnd(long)(
2174
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
2175
+ ));
2176
+ impl(long, BitOr(long)(
2177
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
2178
+ ));
2179
+ impl(long, BitXor(long)(
2180
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
2181
+ ));
2182
+ impl(long, Eq(long)(
2183
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
2184
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
2185
+ ));
2186
+ impl(long, Ord(long)(
2187
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
2188
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
2189
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
2190
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
2191
+ ));
2192
+ impl(long, Hash(
2193
+ (hash): ((value) -> u64(value))
2194
+ ));
2195
+ impl(long, Clone(long)(
2196
+ clone: ((self) -> __yo_return_self(self))
2197
+ ));
2198
+ _long :: long;
2199
+ export long : _long;
2200
+
2201
+
2202
+ /// ulong
2203
+ impl(ulong, Send());
2204
+ impl(ulong, Add(ulong)(
2205
+ (+): ((a, b) -> __yo_op_add(a, b))
2206
+ ));
2207
+ impl(ulong, Sub(ulong)(
2208
+ (-): ((a, b) -> __yo_op_sub(a, b))
2209
+ ));
2210
+ impl(ulong, Mul(ulong)(
2211
+ (*): ((a, b) -> __yo_op_mul(a, b))
2212
+ ));
2213
+ impl(ulong, Div(ulong)(
2214
+ (/): ((a, b) -> __yo_op_div(a, b))
2215
+ ));
2216
+ impl(ulong, Mod(ulong)(
2217
+ (%): ((a, b) -> __yo_op_mod(a, b))
2218
+ ));
2219
+ impl(ulong, Negate(ulong)(
2220
+ (neg): ((a) -> __yo_op_neg(a))
2221
+ ));
2222
+ impl(ulong, LogicalNot(
2223
+ (!): ((a) -> __yo_op_not(a))
2224
+ ));
2225
+ impl(ulong, BitNot(ulong)(
2226
+ (~): ((a) -> __yo_op_bit_complement(a))
2227
+ ));
2228
+ impl(ulong, BitAnd(ulong)(
2229
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
2230
+ ));
2231
+ impl(ulong, BitOr(ulong)(
2232
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
2233
+ ));
2234
+ impl(ulong, BitXor(ulong)(
2235
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
2236
+ ));
2237
+ impl(ulong, Eq(ulong)(
2238
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
2239
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
2240
+ ));
2241
+ impl(ulong, Ord(ulong)(
2242
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
2243
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
2244
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
2245
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
2246
+ ));
2247
+ impl(ulong, Hash(
2248
+ (hash): ((value) -> u64(value))
2249
+ ));
2250
+ impl(ulong, Clone(ulong)(
2251
+ clone: ((self) -> __yo_return_self(self))
2252
+ ));
2253
+ _ulong :: ulong;
2254
+ export ulong : _ulong;
2255
+
2256
+ /// longlong
2257
+ impl(longlong, Send());
2258
+ impl(longlong, Add(longlong)(
2259
+ (+): ((a, b) -> __yo_op_add(a, b))
2260
+ ));
2261
+ impl(longlong, Sub(longlong)(
2262
+ (-): ((a, b) -> __yo_op_sub(a, b))
2263
+ ));
2264
+ impl(longlong, Mul(longlong)(
2265
+ (*): ((a, b) -> __yo_op_mul(a, b))
2266
+ ));
2267
+ impl(longlong, Div(longlong)(
2268
+ (/): ((a, b) -> __yo_op_div(a, b))
2269
+ ));
2270
+ impl(longlong, Mod(longlong)(
2271
+ (%): ((a, b) -> __yo_op_mod(a, b))
2272
+ ));
2273
+ impl(longlong, Negate(longlong)(
2274
+ (neg): ((a) -> __yo_op_neg(a))
2275
+ ));
2276
+ impl(longlong, LogicalNot(
2277
+ (!): ((a) -> __yo_op_not(a))
2278
+ ));
2279
+ impl(longlong, BitNot(longlong)(
2280
+ (~): ((a) -> __yo_op_bit_complement(a))
2281
+ ));
2282
+ impl(longlong, BitAnd(longlong)(
2283
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
2284
+ ));
2285
+ impl(longlong, BitOr(longlong)(
2286
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
2287
+ ));
2288
+ impl(longlong, BitXor(longlong)(
2289
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
2290
+ ));
2291
+ impl(longlong, Eq(longlong)(
2292
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
2293
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
2294
+ ));
2295
+ impl(longlong, Ord(longlong)(
2296
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
2297
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
2298
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
2299
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
2300
+ ));
2301
+ impl(longlong, Hash(
2302
+ (hash): ((value) -> u64(value))
2303
+ ));
2304
+ impl(longlong, Clone(longlong)(
2305
+ clone: ((self) -> __yo_return_self(self))
2306
+ ));
2307
+ _longlong :: longlong;
2308
+ export longlong : _longlong;
2309
+
2310
+ /// ulonglong
2311
+ impl(ulonglong, Send());
2312
+ impl(ulonglong, Add(ulonglong)(
2313
+ (+): ((a, b) -> __yo_op_add(a, b))
2314
+ ));
2315
+ impl(ulonglong, Sub(ulonglong)(
2316
+ (-): ((a, b) -> __yo_op_sub(a, b))
2317
+ ));
2318
+ impl(ulonglong, Mul(ulonglong)(
2319
+ (*): ((a, b) -> __yo_op_mul(a, b))
2320
+ ));
2321
+ impl(ulonglong, Div(ulonglong)(
2322
+ (/): ((a, b) -> __yo_op_div(a, b))
2323
+ ));
2324
+ impl(ulonglong, Mod(ulonglong)(
2325
+ (%): ((a, b) -> __yo_op_mod(a, b))
2326
+ ));
2327
+ impl(ulonglong, Negate(ulonglong)(
2328
+ (neg): ((a) -> __yo_op_neg(a))
2329
+ ));
2330
+ impl(ulonglong, LogicalNot(
2331
+ (!): ((a) -> __yo_op_not(a))
2332
+ ));
2333
+ impl(ulonglong, BitNot(ulonglong)(
2334
+ (~): ((a) -> __yo_op_bit_complement(a))
2335
+ ));
2336
+ impl(ulonglong, BitAnd(ulonglong)(
2337
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
2338
+ ));
2339
+ impl(ulonglong, BitOr(ulonglong)(
2340
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
2341
+ ));
2342
+ impl(ulonglong, BitXor(ulonglong)(
2343
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
2344
+ ));
2345
+ impl(ulonglong, Eq(ulonglong)(
2346
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
2347
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
2348
+ ));
2349
+ impl(ulonglong, Ord(ulonglong)(
2350
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
2351
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
2352
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
2353
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
2354
+ ));
2355
+ impl(ulonglong, Hash(
2356
+ (hash): ((value) -> u64(value))
2357
+ ));
2358
+ impl(ulonglong, Clone(ulonglong)(
2359
+ clone: ((self) -> __yo_return_self(self))
2360
+ ));
2361
+ _ulonglong :: ulonglong;
2362
+ export ulonglong : _ulonglong;
2363
+
2364
+ /// longdouble
2365
+ impl(longdouble, Send());
2366
+ impl(longdouble, Add(longdouble)(
2367
+ (+): ((a, b) -> __yo_op_add(a, b))
2368
+ ));
2369
+ impl(longdouble, Sub(longdouble)(
2370
+ (-): ((a, b) -> __yo_op_sub(a, b))
2371
+ ));
2372
+ impl(longdouble, Mul(longdouble)(
2373
+ (*): ((a, b) -> __yo_op_mul(a, b))
2374
+ ));
2375
+ impl(longdouble, Div(longdouble)(
2376
+ (/): ((a, b) -> __yo_op_div(a, b))
2377
+ ));
2378
+ impl(longdouble, Mod(longdouble)(
2379
+ (%): ((a, b) -> __yo_op_mod(a, b))
2380
+ ));
2381
+ impl(longdouble, Negate(longdouble)(
2382
+ (neg): ((a) -> __yo_op_neg(a))
2383
+ ));
2384
+ impl(longdouble, LogicalNot(
2385
+ (!): ((a) -> __yo_op_not(a))
2386
+ ));
2387
+ impl(longdouble, BitNot(longdouble)(
2388
+ (~): ((a) -> __yo_op_bit_complement(a))
2389
+ ));
2390
+ impl(longdouble, BitAnd(longdouble)(
2391
+ (&): ((a, b) -> __yo_op_bit_and(a, b))
2392
+ ));
2393
+ impl(longdouble, BitOr(longdouble)(
2394
+ (|): ((a, b) -> __yo_op_bit_or(a, b))
2395
+ ));
2396
+ impl(longdouble, BitXor(longdouble)(
2397
+ (^): ((a, b) -> __yo_op_bit_xor(a, b))
2398
+ ));
2399
+ impl(longdouble, Eq(longdouble)(
2400
+ (==) : ((a, b) -> __yo_op_eq(a, b)),
2401
+ (!=) : ((a, b) -> __yo_op_neq(a, b))
2402
+ ));
2403
+ impl(longdouble, Ord(longdouble)(
2404
+ (<) : ((a, b) -> __yo_op_lt(a, b)),
2405
+ (<=) : ((a, b) -> __yo_op_lte(a, b)),
2406
+ (>) : ((a, b) -> __yo_op_gt(a, b)),
2407
+ (>=) : ((a, b) -> __yo_op_gte(a, b))
2408
+ ));
2409
+ impl(longdouble, Hash(
2410
+ (hash): ((value) -> u64(i64(value)))
2411
+ ));
2412
+ impl(longdouble, Clone(longdouble)(
2413
+ clone: ((self) -> __yo_return_self(self))
2414
+ ));
2415
+ _longdouble :: longdouble;
2416
+ export longdouble : _longdouble;
2417
+
2418
+
2419
+ /// compt_int
2420
+ impl(compt_int, ComptAdd(compt_int)(
2421
+ (+) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(compt_int))(
2422
+ __yo_compt_int_add(lhs, rhs)
2423
+ )
2424
+ ));
2425
+ impl(compt_int, ComptSub(compt_int)(
2426
+ (-) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(compt_int))(
2427
+ __yo_compt_int_sub(lhs, rhs)
2428
+ )
2429
+ ));
2430
+ impl(compt_int, ComptMul(compt_int)(
2431
+ (*) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(compt_int))(
2432
+ __yo_compt_int_mul(lhs, rhs)
2433
+ )
2434
+ ));
2435
+ impl(compt_int, ComptDiv(compt_int)(
2436
+ (/) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(compt_int))(
2437
+ __yo_compt_int_div(lhs, rhs)
2438
+ )
2439
+ ));
2440
+ impl(compt_int, ComptMod(compt_int)(
2441
+ (%) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(compt_int))(
2442
+ __yo_compt_int_mod(lhs, rhs)
2443
+ )
2444
+ ));
2445
+ impl(compt_int, ComptNegate(compt_int)(
2446
+ (neg) : (fn(compt(self): compt_int) -> compt(compt_int))(
2447
+ __yo_compt_int_neg(self)
2448
+ )
2449
+ ));
2450
+ impl(compt_int, ComptEq(compt_int)(
2451
+ (==) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(bool))(
2452
+ __yo_compt_int_eq(lhs, rhs)
2453
+ ),
2454
+ (!=) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(bool))(
2455
+ __yo_compt_int_neq(lhs, rhs)
2456
+ )
2457
+ ));
2458
+ impl(compt_int, ComptOrd(compt_int)(
2459
+ (<) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(bool))(
2460
+ __yo_compt_int_lt(lhs, rhs)
2461
+ ),
2462
+ (<=) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(bool))(
2463
+ __yo_compt_int_lte(lhs, rhs)
2464
+ ),
2465
+ (>) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(bool))(
2466
+ __yo_compt_int_gt(lhs, rhs)
2467
+ ),
2468
+ (>=) : (fn(compt(lhs): compt_int, compt(rhs): compt_int) -> compt(bool))(
2469
+ __yo_compt_int_gte(lhs, rhs)
2470
+ )
2471
+ ));
2472
+ impl(compt_int, {
2473
+ (to_string) :: (fn(compt(self): compt_int) -> compt(compt_string))(
2474
+ __yo_compt_int_to_string(self)
2475
+ );
2476
+ export to_string;
2477
+ });
2478
+ _compt_int :: compt_int;
2479
+ export compt_int : _compt_int;
2480
+
2481
+ /// compt_float
2482
+ impl(compt_float, ComptAdd(compt_float)(
2483
+ (+) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(compt_float))(
2484
+ __yo_compt_float_add(lhs, rhs)
2485
+ )
2486
+ ));
2487
+ impl(compt_float, ComptSub(compt_float)(
2488
+ (-) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(compt_float))(
2489
+ __yo_compt_float_sub(lhs, rhs)
2490
+ )
2491
+ ));
2492
+ impl(compt_float, ComptMul(compt_float)(
2493
+ (*) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(compt_float))(
2494
+ __yo_compt_float_mul(lhs, rhs)
2495
+ )
2496
+ ));
2497
+ impl(compt_float, ComptDiv(compt_float)(
2498
+ (/) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(compt_float))(
2499
+ __yo_compt_float_div(lhs, rhs)
2500
+ )
2501
+ ));
2502
+ impl(compt_float, ComptNegate(compt_float)(
2503
+ (neg) : (fn(compt(self): compt_float) -> compt(compt_float))(
2504
+ __yo_compt_float_neg(self)
2505
+ )
2506
+ ));
2507
+ impl(compt_float, ComptEq(compt_float)(
2508
+ (==) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(bool))(
2509
+ __yo_compt_float_eq(lhs, rhs)
2510
+ ),
2511
+ (!=) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(bool))(
2512
+ __yo_compt_float_neq(lhs, rhs)
2513
+ )
2514
+ ));
2515
+ impl(compt_float, ComptOrd(compt_float)(
2516
+ (<) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(bool))(
2517
+ __yo_compt_float_lt(lhs, rhs)
2518
+ ),
2519
+ (<=) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(bool))(
2520
+ __yo_compt_float_lte(lhs, rhs)
2521
+ ),
2522
+ (>) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(bool))(
2523
+ __yo_compt_float_gt(lhs, rhs)
2524
+ ),
2525
+ (>=) : (fn(compt(lhs): compt_float, compt(rhs): compt_float) -> compt(bool))(
2526
+ __yo_compt_float_gte(lhs, rhs)
2527
+ )
2528
+ ));
2529
+ impl(compt_float, {
2530
+ (to_string) :: (fn(compt(self): compt_float) -> compt(compt_string))(
2531
+ __yo_compt_float_to_string(self)
2532
+ );
2533
+ export to_string;
2534
+ });
2535
+ _compt_float :: compt_float;
2536
+ export compt_float : _compt_float;
2537
+
2538
+ /// compt_string
2539
+ impl(compt_string, ComptAdd(compt_string)(
2540
+ (+) : (fn(compt(lhs): compt_string, compt(rhs): compt_string) -> compt(compt_string))(
2541
+ __yo_compt_string_concat(lhs, rhs)
2542
+ )
2543
+ ));
2544
+ impl(compt_string, ComptEq(compt_string)(
2545
+ (==) : (fn(compt(lhs): compt_string, compt(rhs): compt_string) -> compt(bool))(
2546
+ __yo_compt_string_eq(lhs, rhs)
2547
+ ),
2548
+ (!=) : (fn(compt(lhs): compt_string, compt(rhs): compt_string) -> compt(bool))(
2549
+ __yo_compt_string_neq(lhs, rhs)
2550
+ )
2551
+ ));
2552
+ impl(compt_string, ComptOrd(compt_string)(
2553
+ (<) : (fn(compt(lhs): compt_string, compt(rhs): compt_string) -> compt(bool))(
2554
+ __yo_compt_string_lt(lhs, rhs)
2555
+ ),
2556
+ (<=) : (fn(compt(lhs): compt_string, compt(rhs): compt_string) -> compt(bool))(
2557
+ __yo_compt_string_lte(lhs, rhs)
2558
+ ),
2559
+ (>) : (fn(compt(lhs): compt_string, compt(rhs): compt_string) -> compt(bool))(
2560
+ __yo_compt_string_gt(lhs, rhs)
2561
+ ),
2562
+ (>=) : (fn(compt(lhs): compt_string, compt(rhs): compt_string) -> compt(bool))(
2563
+ __yo_compt_string_gte(lhs, rhs)
2564
+ )
2565
+ ));
2566
+ impl(compt_string, {
2567
+ len :: (fn(compt(self): compt_string) -> compt(compt_int))(
2568
+ __yo_compt_string_length(self)
2569
+ );
2570
+ export len;
2571
+
2572
+ (to_upper) :: (fn(compt(self): compt_string) -> compt(compt_string))(
2573
+ __yo_compt_string_to_upper(self)
2574
+ );
2575
+ export to_upper;
2576
+
2577
+ (to_lower) :: (fn(compt(self): compt_string) -> compt(compt_string))(
2578
+ __yo_compt_string_to_lower(self)
2579
+ );
2580
+ export to_lower;
2581
+
2582
+ slice :: (fn(compt(self): compt_string, compt(start): compt_int, compt(end): compt_int) -> compt(compt_string))(
2583
+ __yo_compt_string_slice(self, start, end)
2584
+ );
2585
+ export slice;
2586
+ });
2587
+ _compt_string :: compt_string;
2588
+ export compt_string : _compt_string;
2589
+
2590
+ /// Ptr
2591
+ impl(forall(T : Type), where(T <: Send), *(T), Send());
2592
+ /*
2593
+ impl(forall(T : Type), *(T), Add(usize, *(T))(
2594
+ (+) : ((lhs, rhs) -> __yo_ptr_add(lhs, rhs))
2595
+ ));
2596
+ impl(forall(T : Type), *(T), Sub(usize, *(T))(
2597
+ (-) : ((lhs, rhs) -> __yo_ptr_sub(lhs, rhs))
2598
+ ));
2599
+ impl(forall(T : Type), *(T), Eq(*(T))(
2600
+ (==) : ((lhs, rhs) -> __yo_ptr_eq(lhs, rhs)),
2601
+ (!=) : ((lhs, rhs) -> __yo_ptr_neq(lhs, rhs))
2602
+ ));
2603
+ impl(forall(T : Type), *(T), Ord(*(T))(
2604
+ (<) : ((lhs, rhs) -> __yo_ptr_lt(lhs, rhs)),
2605
+ (<=) : ((lhs, rhs) -> __yo_ptr_lte(lhs, rhs)),
2606
+ (>) : ((lhs, rhs) -> __yo_ptr_gt(lhs, rhs)),
2607
+ (>=) : ((lhs, rhs) -> __yo_ptr_gte(lhs, rhs))
2608
+ ));
2609
+ impl(forall(T : Type), *(T), {
2610
+ diff :: (fn(lhs : Self, rhs : Self) -> isize) {
2611
+ return __yo_ptr_diff(lhs, rhs);
2612
+ };
2613
+ cast :: (fn(self : Self, compt(Target) : Type) -> Target) {
2614
+ return __yo_as(self, Target);
2615
+ };
2616
+ export diff, cast;
2617
+ });
2618
+ */
2619
+ impl(forall(T : Type), *(T), {
2620
+ (&+) :: (fn(self : Self, offset : usize) -> Self)
2621
+ __yo_ptr_add(self, offset)
2622
+ ;
2623
+ (&-) :: (fn(self : Self, offset : usize) -> Self)
2624
+ __yo_ptr_sub(self, offset)
2625
+ ;
2626
+ (&==) :: (fn(self : Self, another : Self) -> bool)
2627
+ __yo_ptr_eq(self, another)
2628
+ ;
2629
+ (&!=) :: (fn(self : Self, another : Self) -> bool)
2630
+ __yo_ptr_neq(self, another)
2631
+ ;
2632
+ (&<) :: (fn(self : Self, another : Self) -> bool)
2633
+ __yo_ptr_lt(self, another)
2634
+ ;
2635
+ (&<=) :: (fn(self : Self, another : Self) -> bool)
2636
+ __yo_ptr_lte(self, another)
2637
+ ;
2638
+ (&>) :: (fn(self : Self, another : Self) -> bool)
2639
+ __yo_ptr_gt(self, another)
2640
+ ;
2641
+ (&>=) :: (fn(self : Self, another : Self) -> bool)
2642
+ __yo_ptr_gte(self, another)
2643
+ ;
2644
+ (&/) :: (fn(self : Self, another : Self) -> isize)
2645
+ __yo_ptr_diff(self, another)
2646
+ ;
2647
+
2648
+ export (&+), (&-), (&==), (&!=), (&<), (&<=), (&>), (&>=), (&/);
2649
+ });
2650
+
2651
+ /// Array
2652
+ impl(forall(T : Type, U : usize), where(T <: Send), Array(T, U), Send());
2653
+ impl(forall(T : Type, U : usize), Array(T, U), {
2654
+ len :: (fn(self : *(Self)) -> usize) {
2655
+ return U;
2656
+ };
2657
+
2658
+ export len;
2659
+ });
2660
+
2661
+ /// Slice
2662
+ impl(forall(T : Type), Slice(T), {
2663
+ len :: (fn(self : Self) -> usize)(
2664
+ __yo_slice_len(self)
2665
+ );
2666
+ export len;
2667
+ });
2668
+
2669
+ /// ComptList
2670
+ impl(forall(T : Type), ComptList(T), {
2671
+ car :: (fn(compt(self): Self) -> compt(__yo_compt_list_element_type(Self)))(
2672
+ __yo_compt_list_car(self)
2673
+ );
2674
+ cdr :: (fn(compt(self): Self) -> compt(Self))(
2675
+ __yo_compt_list_cdr(self)
2676
+ );
2677
+ first :: car;
2678
+ rest :: cdr;
2679
+ append :: (fn(compt(self): Self, compt(another): Self) -> compt(Self))(
2680
+ __yo_compt_list_append(self, another)
2681
+ );
2682
+ len :: (fn(compt(self): Self) -> compt(usize))(
2683
+ __yo_compt_list_length(self)
2684
+ );
2685
+ export car, cdr, first, rest, append, len;
2686
+ });
2687
+
2688
+ /// ExprList
2689
+ ExprList :: ComptList(Expr);
2690
+ export ExprList;
2691
+
2692
+ /// Expr
2693
+ impl(Expr, ComptEq(Expr)(
2694
+ (==) : (fn(compt(lhs): Expr, compt(rhs): Expr) -> compt(bool))(
2695
+ __yo_expr_eq(lhs, rhs)
2696
+ )
2697
+ ));
2698
+ impl(Expr, {
2699
+ is_atom :: (fn(compt(self): Expr) -> compt(bool))(
2700
+ __yo_expr_is_atom(self)
2701
+ );
2702
+ export is_atom;
2703
+
2704
+ is_fn_call :: (fn(compt(self): Expr) -> compt(bool))(
2705
+ __yo_expr_is_fn_call(self)
2706
+ );
2707
+ export is_fn_call;
2708
+
2709
+ get_callee :: (fn(compt(self): Expr) -> compt(Expr))(
2710
+ __yo_expr_get_callee(self)
2711
+ );
2712
+ export get_callee;
2713
+
2714
+ get_args :: (fn(compt(self): Expr) -> compt(ExprList))(
2715
+ __yo_expr_get_args(self)
2716
+ );
2717
+ export get_args;
2718
+
2719
+ cons :: (fn(compt(self): Expr, compt(rest): ExprList) -> compt(ExprList))(
2720
+ __yo_compt_list_cons(self, rest)
2721
+ );
2722
+ export cons;
2723
+
2724
+ (to_string) :: (fn(compt(self): Expr) -> compt(compt_string))(
2725
+ __yo_expr_to_string(self)
2726
+ );
2727
+ export to_string;
2728
+ });
2729
+ _Expr :: Expr;
2730
+ export Expr : _Expr;
2731
+
2732
+ // Type
2733
+ impl(Type, {
2734
+ to_string :: (fn(compt(self): Type) -> compt(compt_string))({
2735
+ return __yo_type_to_string(self);
2736
+ });
2737
+ export to_string;
2738
+
2739
+ is_compatible_with :: (fn(compt(self): Type, compt(expected_type): Type) -> compt(bool))({
2740
+ return __yo_are_types_compatible(expected_type, self);
2741
+ });
2742
+ export is_compatible_with;
2743
+
2744
+ contains_gc_type :: (fn(compt(self): Type) -> compt(bool))({
2745
+ return __yo_type_contains_gc_type(self);
2746
+ });
2747
+ export contains_gc_type;
2748
+
2749
+ can_form_gc_cycle :: (fn(compt(self): Type) -> compt(bool))({
2750
+ return __yo_type_can_form_gc_cycle(self);
2751
+ });
2752
+ export can_form_gc_cycle;
2753
+
2754
+ impls :: (fn(compt(self): Type, compt(marker): Module) -> compt(bool))({
2755
+ return __yo_type_impls(self, marker);
2756
+ });
2757
+ export impls;
2758
+ });
2759
+ _Type :: Type;
2760
+ export Type : _Type;
2761
+
2762
+ // Variable
2763
+ Var :: impl({
2764
+ print_info :: (fn(quote(variable) : Expr) -> unquote(Expr)) {
2765
+ return quote {
2766
+ __yo_var_print_info(unquote(variable));
2767
+ };
2768
+ };
2769
+ export print_info;
2770
+
2771
+ is_owning_the_gc_value :: (fn(quote(variable) : Expr) -> unquote(Expr)) {
2772
+ return quote __yo_var_is_owning_the_gc_value(unquote(variable));
2773
+ };
2774
+ export is_owning_the_gc_value;
2775
+
2776
+ has_other_aliases :: (fn(quote(variable) : Expr) -> unquote(Expr)) {
2777
+ return quote __yo_var_has_other_aliases(unquote(variable));
2778
+ };
2779
+ export has_other_aliases;
2780
+ });
2781
+ export Var;
2782
+
2783
+ // === Data Types ===
2784
+ /// === Option ===
2785
+ Option :: (fn(compt(T) : Type) -> compt(Type))
2786
+ enum(
2787
+ None,
2788
+ Some(value: T),
2789
+
2790
+ unwrap :: (fn(self : Self) -> T)(
2791
+ match(self,
2792
+ .Some(value) => value,
2793
+ .None => panic("Called unwrap on a None value")
2794
+ )
2795
+ ),
2796
+
2797
+ is_some :: (fn(self : Self) -> bool)(
2798
+ match(self,
2799
+ .Some(_) => true,
2800
+ .None => false
2801
+ )
2802
+ ),
2803
+
2804
+ is_none :: (fn(self : Self) -> bool)(
2805
+ match(self,
2806
+ .None => true,
2807
+ .Some(_) => false
2808
+ )
2809
+ )
2810
+ )
2811
+ ;
2812
+ // Alias of the Option type
2813
+ ? :: Option;
2814
+ // Nullable pointer
2815
+ (?*) :: (fn(compt(T): Type) -> compt(Type))
2816
+ Option(*(T))
2817
+ ;
2818
+ export
2819
+ Option,
2820
+ ?,
2821
+ (?*)
2822
+ ;
2823
+
2824
+
2825
+ /// === Result ===
2826
+ Result :: (fn(compt(OkType): Type, compt(ErrorType): Type) -> compt(Type))
2827
+ enum
2828
+ Ok(value: OkType),
2829
+ Err(error: ErrorType),
2830
+
2831
+ unwrap :: (fn(self : Self) -> OkType)(
2832
+ match(self,
2833
+ .Ok(value) => value,
2834
+ .Err(_) => panic("Called unwrap on an Error value")
2835
+ )
2836
+ ),
2837
+
2838
+ is_ok :: (fn(self : Self) -> bool)(
2839
+ match(self,
2840
+ .Ok(_) => true,
2841
+ .Err(_) => false
2842
+ )
2843
+ ),
2844
+
2845
+ is_err :: (fn(self : Self) -> bool)(
2846
+ match(self,
2847
+ .Err(_) => true,
2848
+ .Ok(_) => false
2849
+ )
2850
+ )
2851
+ ;
2852
+ export
2853
+ Result
2854
+ ;
2855
+
2856
+ /// === Box ===
2857
+ Box :: (fn(compt(V) : Type) -> compt(Type))
2858
+ object(
2859
+ (*) : V
2860
+ )
2861
+ ;
2862
+ box :: (fn(forall(V : Type), value : V) -> Box(V))
2863
+ Box(V)(value)
2864
+ ;
2865
+ impl(forall(T : Type), Box(T), Isolation(
2866
+ can_isolate : ((self) -> (rc(self) == 1))
2867
+ ));
2868
+
2869
+ export
2870
+ Box,
2871
+ box
2872
+ ;
2873
+
2874
+ /// === Iso ===
2875
+ impl(forall(T : Type), Iso(T), Send());
2876
+ impl(forall(T : Type), Iso(T), {
2877
+ extract :: (fn(self : Self) -> Option(T))(
2878
+ __yo_iso_extract(self)
2879
+ );
2880
+ export extract;
2881
+ });
2882
+
2883
+ (^) :: (fn(quote(v) : Expr) -> unquote(Expr))({
2884
+ temp :: cond(
2885
+ v.is_atom() => v,
2886
+ true => gensym("iso_extract_temp")
2887
+ );
2888
+ temp_type :: gensym("iso_extract_temp_type");
2889
+ assignment :: cond(
2890
+ v.is_atom() => quote(()),
2891
+ true => quote(unquote(temp) := unquote(v))
2892
+ );
2893
+ return quote {
2894
+ unquote(assignment);
2895
+ unquote(temp_type) :: typeof(unquote(temp));
2896
+ cond(
2897
+ Type.contains_gc_type(unquote(temp_type)) => // compile-time check
2898
+ cond(
2899
+ Type.can_form_gc_cycle(unquote(temp_type)) => { // compile-time check
2900
+ consume(unquote(temp));
2901
+ compt_assert(false, "Cannot isolate value of type containing GC type that can form cycles");
2902
+ Option(Iso(unquote(temp_type))).None
2903
+ },
2904
+ !(Var.is_owning_the_gc_value(unquote(temp))) => { // compile-time check
2905
+ consume(unquote(temp));
2906
+ compt_assert(false, "Cannot isolate value of type that is not owned");
2907
+ Option(Iso(unquote(temp_type))).None
2908
+ },
2909
+ (Var.has_other_aliases(unquote(temp))) => { // compile-time check
2910
+ consume(unquote(temp));
2911
+ compt_assert(false, "Cannot isolate value of type that has other aliases");
2912
+ Option(Iso(unquote(temp_type))).None
2913
+ },
2914
+ (unquote(temp_type) <: Isolation).can_isolate(unquote(temp)) => // run-time check
2915
+ Option(Iso(unquote(temp_type))).Some(Iso(unquote(temp_type))(unquote(temp))),
2916
+ true => { // run-time check
2917
+ consume(unquote(temp));
2918
+ Option(Iso(unquote(temp_type))).None
2919
+ }
2920
+ ),
2921
+ true => { // compile-time check
2922
+ compt_assert(false, "Cannot isolate value type that does not contain GC type");
2923
+ Option(Iso(unquote(temp_type))).Some(Iso(unquote(temp_type))(unquote(temp)))
2924
+ }
2925
+ )
2926
+ };
2927
+ });
2928
+ export (^);
2929
+
2930
+ /// === MaybeUninit ===
2931
+ extern "Yo",
2932
+ __yo_maybe_uninit_new :
2933
+ (fn(compt(_Self) : Type) -> _Self),
2934
+ __yo_maybe_uninit_as_ptr :
2935
+ (fn(compt(_Self) : Type, compt(BaseType): Type, self: *(_Self)) -> *(BaseType)),
2936
+ __yo_maybe_uninit_assume_init :
2937
+ (fn(compt(_Self) : Type, compt(BaseType): Type, self: _Self) -> BaseType)
2938
+ ;
2939
+
2940
+ MaybeUninit :: (fn(compt(BaseType): Type) -> compt(Type))
2941
+ struct(
2942
+ value: BaseType,
2943
+
2944
+ new :: (fn() -> Self)(__yo_maybe_uninit_new(Self)),
2945
+
2946
+ as_ptr :: (fn(self: *(Self)) -> *(BaseType))(
2947
+ __yo_maybe_uninit_as_ptr(Self, BaseType, self)
2948
+ ),
2949
+
2950
+ assume_init :: (fn(self : Self) -> BaseType)(
2951
+ __yo_maybe_uninit_assume_init(Self, BaseType, self)
2952
+ )
2953
+ )
2954
+ ;
2955
+
2956
+ export
2957
+ MaybeUninit
2958
+ ;
2959
+
2960
+ // === Modules again ===
2961
+ /// === Iterator ===
2962
+ Iterator :: (fn(compt(Item) : Type) -> compt(Module)) {
2963
+ return module(
2964
+ Item := Item,
2965
+ next :
2966
+ fn(self : *(Self)) -> Option(Self.Item)
2967
+ );
2968
+ };
2969
+ export Iterator;
2970
+
2971
+ /// === IntoIterator ===
2972
+ IntoIterator :: (fn(
2973
+ compt(Item) : Type,
2974
+ compt(IntoIter) : Type,
2975
+ where(IntoIter <: Iterator(Item))) -> compt(Module)) {
2976
+ return module(
2977
+ Item := Item,
2978
+ IntoIter := IntoIter,
2979
+ into_iter :
2980
+ fn(self : Self) -> Self.IntoIter
2981
+ );
2982
+ };
2983
+ export IntoIterator;
2984
+
2985
+
2986
+ // === Macros ===
2987
+ /// === if ===
2988
+ if :: (fn(quote(condition) : Expr,
2989
+ quote(then) : Expr,
2990
+ (quote(else) : Expr) ?= quote(())
2991
+ ) -> unquote(Expr))
2992
+ quote
2993
+ cond
2994
+ unquote(condition) => unquote(then),
2995
+ true => unquote(else)
2996
+ ;
2997
+ export
2998
+ if
2999
+ ;
3000
+
3001
+ /// === runtval ===
3002
+
3003
+ /**
3004
+ * This function is used to construct a runtime value from an expression.
3005
+ */
3006
+ runtval :: (fn(quote(val_expr) : Expr) -> unquote(Expr)) {
3007
+ temp :: gensym("runtval");
3008
+ quote {
3009
+ unquote(temp) := unquote(val_expr);
3010
+ unquote(temp)
3011
+ }
3012
+ };
3013
+ export
3014
+ runtval
3015
+ ;
3016
+
3017
+
3018
+ /**
3019
+ * try macro for handling Result types.
3020
+ */
3021
+ try :: (fn(quote(expr_to_try): Expr) -> unquote(Expr)) {
3022
+ temp :: gensym("try");
3023
+ quote {
3024
+ unquote(temp) := unquote(expr_to_try);
3025
+ match(unquote(temp),
3026
+ .Ok => unquote(temp).value,
3027
+ .Err => {
3028
+ return unquote(temp).error;
3029
+ }
3030
+ )
3031
+ }
3032
+ };
3033
+ export try;
3034
+
3035
+ /**
3036
+ * `for` macro to run while loop over an iterator
3037
+ * eg:
3038
+ *
3039
+ * for box.into_iter(), (value) => {
3040
+ * printf("value %d\n", value);
3041
+ * };
3042
+ *
3043
+ * transforms to
3044
+ *
3045
+ * iter := box.into_iter();
3046
+ * while true, {
3047
+ * value := iter.next();
3048
+ * match(value,
3049
+ * .Some(value) => {
3050
+ * printf("value %d\n", value);
3051
+ * }),
3052
+ * .None => { break; }
3053
+ * }
3054
+ */
3055
+ for :: (fn(
3056
+ quote(iter) : Expr,
3057
+ quote(handle) : Expr
3058
+ ) -> unquote(Expr)) {
3059
+ // Check if `handle` is a function call of `=>`
3060
+ return cond(
3061
+ (handle.is_fn_call()) => {
3062
+ callee :: handle.get_callee();
3063
+ cond(
3064
+ (callee.is_atom() && (callee == quote(=>))) => {
3065
+ args :: handle.get_args();
3066
+ compt_assert(args.len() == 2, "'for' macro requires 2 arguments in the function handle");
3067
+ variable :: args.car();
3068
+ body :: args.cdr().car();
3069
+
3070
+ iter_var :: gensym("for_iter_var");
3071
+ temp_var :: gensym("for_temp_var");
3072
+ quote({
3073
+ unquote(iter_var) := unquote(iter);
3074
+ while runtval(true), {
3075
+ unquote(temp_var) := &(unquote(iter_var)).next();
3076
+ match(unquote(temp_var),
3077
+ .Some(unquote(variable)) => unquote(body),
3078
+ .None => { break; }
3079
+ )
3080
+ };
3081
+ })
3082
+ },
3083
+ true => {
3084
+ compt_assert(false, "for macro requires a function handle with `=>`");
3085
+ quote(false)
3086
+ }
3087
+ )
3088
+ },
3089
+ true => {
3090
+ compt_assert(false, "for macro requires a function handle with `=>`");
3091
+ quote(false)
3092
+ });
3093
+ };
3094
+ export for;