skill-universe 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/README.md +24 -0
  2. package/bin/skillc.mjs +3 -0
  3. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache +0 -0
  4. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_inline +0 -0
  5. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_meta +0 -0
  6. package/build/dev/javascript/argv/argv.erl +12 -0
  7. package/build/dev/javascript/argv/argv.mjs +31 -0
  8. package/build/dev/javascript/argv/argv_ffi.erl +27 -0
  9. package/build/dev/javascript/argv/argv_ffi.mjs +20 -0
  10. package/build/dev/javascript/argv/gleam.mjs +1 -0
  11. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache +0 -0
  12. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_inline +0 -0
  13. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_meta +0 -0
  14. package/build/dev/javascript/filepath/filepath.erl +425 -0
  15. package/build/dev/javascript/filepath/filepath.mjs +529 -0
  16. package/build/dev/javascript/filepath/filepath_ffi.erl +9 -0
  17. package/build/dev/javascript/filepath/filepath_ffi.mjs +6 -0
  18. package/build/dev/javascript/filepath/gleam.mjs +1 -0
  19. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
  20. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline +0 -0
  21. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta +0 -0
  22. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
  23. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
  24. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta +0 -0
  25. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
  26. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline +0 -0
  27. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta +0 -0
  28. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
  29. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline +0 -0
  30. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta +0 -0
  31. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
  32. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline +0 -0
  33. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta +0 -0
  34. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
  35. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline +0 -0
  36. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
  37. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
  38. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline +0 -0
  39. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta +0 -0
  40. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
  41. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline +0 -0
  42. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta +0 -0
  43. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
  44. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline +0 -0
  45. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta +0 -0
  46. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
  47. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline +0 -0
  48. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta +0 -0
  49. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
  50. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline +0 -0
  51. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta +0 -0
  52. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
  53. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline +0 -0
  54. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta +0 -0
  55. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
  56. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline +0 -0
  57. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta +0 -0
  58. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
  59. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline +0 -0
  60. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta +0 -0
  61. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
  62. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
  63. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta +0 -0
  64. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
  65. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline +0 -0
  66. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta +0 -0
  67. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
  68. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline +0 -0
  69. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
  70. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
  71. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline +0 -0
  72. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta +0 -0
  73. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
  74. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline +0 -0
  75. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta +0 -0
  76. package/build/dev/javascript/gleam_stdlib/dict.mjs +710 -0
  77. package/build/dev/javascript/gleam_stdlib/gleam/bit_array.mjs +285 -0
  78. package/build/dev/javascript/gleam_stdlib/gleam/bool.mjs +313 -0
  79. package/build/dev/javascript/gleam_stdlib/gleam/bytes_tree.mjs +225 -0
  80. package/build/dev/javascript/gleam_stdlib/gleam/dict.mjs +456 -0
  81. package/build/dev/javascript/gleam_stdlib/gleam/dynamic/decode.mjs +985 -0
  82. package/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs +35 -0
  83. package/build/dev/javascript/gleam_stdlib/gleam/float.mjs +572 -0
  84. package/build/dev/javascript/gleam_stdlib/gleam/function.mjs +6 -0
  85. package/build/dev/javascript/gleam_stdlib/gleam/int.mjs +832 -0
  86. package/build/dev/javascript/gleam_stdlib/gleam/io.mjs +8 -0
  87. package/build/dev/javascript/gleam_stdlib/gleam/list.mjs +3160 -0
  88. package/build/dev/javascript/gleam_stdlib/gleam/option.mjs +418 -0
  89. package/build/dev/javascript/gleam_stdlib/gleam/order.mjs +178 -0
  90. package/build/dev/javascript/gleam_stdlib/gleam/pair.mjs +102 -0
  91. package/build/dev/javascript/gleam_stdlib/gleam/result.mjs +480 -0
  92. package/build/dev/javascript/gleam_stdlib/gleam/set.mjs +416 -0
  93. package/build/dev/javascript/gleam_stdlib/gleam/string.mjs +723 -0
  94. package/build/dev/javascript/gleam_stdlib/gleam/string_tree.mjs +133 -0
  95. package/build/dev/javascript/gleam_stdlib/gleam/uri.mjs +1155 -0
  96. package/build/dev/javascript/gleam_stdlib/gleam.mjs +1 -0
  97. package/build/dev/javascript/gleam_stdlib/gleam@bit_array.erl +347 -0
  98. package/build/dev/javascript/gleam_stdlib/gleam@bool.erl +352 -0
  99. package/build/dev/javascript/gleam_stdlib/gleam@bytes_tree.erl +211 -0
  100. package/build/dev/javascript/gleam_stdlib/gleam@dict.erl +521 -0
  101. package/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl +106 -0
  102. package/build/dev/javascript/gleam_stdlib/gleam@dynamic@decode.erl +1112 -0
  103. package/build/dev/javascript/gleam_stdlib/gleam@float.erl +764 -0
  104. package/build/dev/javascript/gleam_stdlib/gleam@function.erl +18 -0
  105. package/build/dev/javascript/gleam_stdlib/gleam@int.erl +1004 -0
  106. package/build/dev/javascript/gleam_stdlib/gleam@io.erl +80 -0
  107. package/build/dev/javascript/gleam_stdlib/gleam@list.erl +2832 -0
  108. package/build/dev/javascript/gleam_stdlib/gleam@option.erl +413 -0
  109. package/build/dev/javascript/gleam_stdlib/gleam@order.erl +200 -0
  110. package/build/dev/javascript/gleam_stdlib/gleam@pair.erl +110 -0
  111. package/build/dev/javascript/gleam_stdlib/gleam@result.erl +532 -0
  112. package/build/dev/javascript/gleam_stdlib/gleam@set.erl +433 -0
  113. package/build/dev/javascript/gleam_stdlib/gleam@string.erl +1012 -0
  114. package/build/dev/javascript/gleam_stdlib/gleam@string_tree.erl +207 -0
  115. package/build/dev/javascript/gleam_stdlib/gleam@uri.erl +1049 -0
  116. package/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl +529 -0
  117. package/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs +1050 -0
  118. package/build/dev/javascript/gleam_version +1 -0
  119. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache +0 -0
  120. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_inline +0 -0
  121. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_meta +0 -0
  122. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache +0 -0
  123. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_inline +0 -0
  124. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_meta +0 -0
  125. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache +0 -0
  126. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_inline +0 -0
  127. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_meta +0 -0
  128. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache +0 -0
  129. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_inline +0 -0
  130. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta +0 -0
  131. package/build/dev/javascript/gleeunit/gleam.mjs +1 -0
  132. package/build/dev/javascript/gleeunit/gleeunit/internal/gleam_panic.mjs +180 -0
  133. package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.erl +49 -0
  134. package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs +91 -0
  135. package/build/dev/javascript/gleeunit/gleeunit/internal/reporting.mjs +256 -0
  136. package/build/dev/javascript/gleeunit/gleeunit/should.mjs +135 -0
  137. package/build/dev/javascript/gleeunit/gleeunit.erl +89 -0
  138. package/build/dev/javascript/gleeunit/gleeunit.mjs +62 -0
  139. package/build/dev/javascript/gleeunit/gleeunit@internal@gleam_panic.erl +56 -0
  140. package/build/dev/javascript/gleeunit/gleeunit@internal@reporting.erl +343 -0
  141. package/build/dev/javascript/gleeunit/gleeunit@should.erl +153 -0
  142. package/build/dev/javascript/gleeunit/gleeunit_ffi.erl +21 -0
  143. package/build/dev/javascript/gleeunit/gleeunit_ffi.mjs +100 -0
  144. package/build/dev/javascript/gleeunit/gleeunit_progress.erl +72 -0
  145. package/build/dev/javascript/prelude.mjs +1575 -0
  146. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache +0 -0
  147. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_inline +0 -0
  148. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_meta +0 -0
  149. package/build/dev/javascript/simplifile/gleam.mjs +1 -0
  150. package/build/dev/javascript/simplifile/simplifile.erl +893 -0
  151. package/build/dev/javascript/simplifile/simplifile.mjs +893 -0
  152. package/build/dev/javascript/simplifile/simplifile_erl.erl +244 -0
  153. package/build/dev/javascript/simplifile/simplifile_js.mjs +400 -0
  154. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache +0 -0
  155. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_inline +0 -0
  156. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_meta +0 -0
  157. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_warnings +0 -0
  158. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache +0 -0
  159. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_inline +0 -0
  160. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_meta +0 -0
  161. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_warnings +0 -0
  162. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache +0 -0
  163. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_inline +0 -0
  164. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_meta +0 -0
  165. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_warnings +0 -0
  166. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache +0 -0
  167. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_inline +0 -0
  168. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_meta +0 -0
  169. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_warnings +0 -0
  170. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache +0 -0
  171. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_inline +0 -0
  172. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_meta +0 -0
  173. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_warnings +0 -0
  174. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache +0 -0
  175. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_inline +0 -0
  176. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_meta +0 -0
  177. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_warnings +0 -0
  178. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache +0 -0
  179. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_inline +0 -0
  180. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_meta +0 -0
  181. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_warnings +0 -0
  182. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache +0 -0
  183. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_inline +0 -0
  184. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_meta +0 -0
  185. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_warnings +0 -0
  186. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache +0 -0
  187. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_inline +0 -0
  188. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_meta +0 -0
  189. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_warnings +0 -0
  190. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache +0 -0
  191. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_inline +0 -0
  192. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_meta +0 -0
  193. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_warnings +0 -0
  194. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache +0 -0
  195. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_inline +0 -0
  196. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_meta +0 -0
  197. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_warnings +0 -0
  198. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache +0 -0
  199. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_inline +0 -0
  200. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_meta +0 -0
  201. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_warnings +0 -0
  202. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache +0 -0
  203. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_inline +0 -0
  204. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_meta +0 -0
  205. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_warnings +0 -0
  206. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache +0 -0
  207. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_inline +0 -0
  208. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_meta +0 -0
  209. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_warnings +0 -0
  210. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache +0 -0
  211. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_inline +0 -0
  212. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_meta +0 -0
  213. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_warnings +0 -0
  214. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache +0 -0
  215. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_inline +0 -0
  216. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_meta +0 -0
  217. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_warnings +0 -0
  218. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache +0 -0
  219. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_inline +0 -0
  220. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_meta +0 -0
  221. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_warnings +0 -0
  222. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache +0 -0
  223. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_inline +0 -0
  224. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_meta +0 -0
  225. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_warnings +0 -0
  226. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache +0 -0
  227. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_inline +0 -0
  228. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_meta +0 -0
  229. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_warnings +0 -0
  230. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache +0 -0
  231. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_inline +0 -0
  232. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_meta +0 -0
  233. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_warnings +0 -0
  234. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache +0 -0
  235. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_inline +0 -0
  236. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_meta +0 -0
  237. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_warnings +0 -0
  238. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache +0 -0
  239. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_inline +0 -0
  240. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_meta +0 -0
  241. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_warnings +0 -0
  242. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache +0 -0
  243. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_inline +0 -0
  244. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_meta +0 -0
  245. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_warnings +0 -0
  246. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache +0 -0
  247. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_inline +0 -0
  248. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_meta +0 -0
  249. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_warnings +0 -0
  250. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache +0 -0
  251. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_inline +0 -0
  252. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_meta +0 -0
  253. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_warnings +0 -0
  254. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache +0 -0
  255. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_inline +0 -0
  256. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_meta +0 -0
  257. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_warnings +0 -0
  258. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache +0 -0
  259. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_inline +0 -0
  260. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_meta +0 -0
  261. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_warnings +0 -0
  262. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache +0 -0
  263. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_inline +0 -0
  264. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_meta +0 -0
  265. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_warnings +0 -0
  266. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache +0 -0
  267. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_inline +0 -0
  268. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_meta +0 -0
  269. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_warnings +0 -0
  270. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache +0 -0
  271. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_inline +0 -0
  272. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_meta +0 -0
  273. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_warnings +0 -0
  274. package/build/dev/javascript/skillc/cli_test.mjs +461 -0
  275. package/build/dev/javascript/skillc/compiler_test.mjs +3089 -0
  276. package/build/dev/javascript/skillc/config_test.mjs +308 -0
  277. package/build/dev/javascript/skillc/gleam.main.mjs +2 -0
  278. package/build/dev/javascript/skillc/gleam.mjs +1 -0
  279. package/build/dev/javascript/skillc/importer_test.mjs +1643 -0
  280. package/build/dev/javascript/skillc/parser_test.mjs +1601 -0
  281. package/build/dev/javascript/skillc/path_test.mjs +26 -0
  282. package/build/dev/javascript/skillc/provider_test.mjs +221 -0
  283. package/build/dev/javascript/skillc/registry_test.mjs +359 -0
  284. package/build/dev/javascript/skillc/scaffold_test.mjs +405 -0
  285. package/build/dev/javascript/skillc/skillc/compiler.mjs +724 -0
  286. package/build/dev/javascript/skillc/skillc/config.mjs +172 -0
  287. package/build/dev/javascript/skillc/skillc/error.mjs +145 -0
  288. package/build/dev/javascript/skillc/skillc/fs.mjs +40 -0
  289. package/build/dev/javascript/skillc/skillc/importer.mjs +975 -0
  290. package/build/dev/javascript/skillc/skillc/parser.mjs +427 -0
  291. package/build/dev/javascript/skillc/skillc/path.mjs +52 -0
  292. package/build/dev/javascript/skillc/skillc/platform.mjs +44 -0
  293. package/build/dev/javascript/skillc/skillc/provider.mjs +86 -0
  294. package/build/dev/javascript/skillc/skillc/registry.mjs +701 -0
  295. package/build/dev/javascript/skillc/skillc/scaffold.mjs +117 -0
  296. package/build/dev/javascript/skillc/skillc/semver.mjs +293 -0
  297. package/build/dev/javascript/skillc/skillc/shell.mjs +14 -0
  298. package/build/dev/javascript/skillc/skillc/template.mjs +1177 -0
  299. package/build/dev/javascript/skillc/skillc/types.mjs +249 -0
  300. package/build/dev/javascript/skillc/skillc/version_constraint.mjs +290 -0
  301. package/build/dev/javascript/skillc/skillc/yaml.mjs +51 -0
  302. package/build/dev/javascript/skillc/skillc.mjs +873 -0
  303. package/build/dev/javascript/skillc/skillc_ffi.mjs +30 -0
  304. package/build/dev/javascript/skillc/skillc_test.mjs +5 -0
  305. package/build/dev/javascript/skillc/template_test.mjs +1638 -0
  306. package/build/dev/javascript/skillc/version_constraint_test.mjs +1325 -0
  307. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache +0 -0
  308. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_inline +0 -0
  309. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_meta +0 -0
  310. package/build/dev/javascript/yay/gleam.mjs +1 -0
  311. package/build/dev/javascript/yay/yaml_ffi.erl +106 -0
  312. package/build/dev/javascript/yay/yaml_ffi.mjs +373 -0
  313. package/build/dev/javascript/yay/yay.erl +1218 -0
  314. package/build/dev/javascript/yay/yay.mjs +1403 -0
  315. package/package.json +28 -0
  316. package/src/skillc/compiler.gleam +561 -0
  317. package/src/skillc/config.gleam +91 -0
  318. package/src/skillc/error.gleam +37 -0
  319. package/src/skillc/fs.gleam +31 -0
  320. package/src/skillc/importer.gleam +709 -0
  321. package/src/skillc/parser.gleam +279 -0
  322. package/src/skillc/path.gleam +30 -0
  323. package/src/skillc/platform.gleam +25 -0
  324. package/src/skillc/provider.gleam +58 -0
  325. package/src/skillc/registry.gleam +472 -0
  326. package/src/skillc/scaffold.gleam +112 -0
  327. package/src/skillc/semver.gleam +165 -0
  328. package/src/skillc/shell.gleam +12 -0
  329. package/src/skillc/template.gleam +885 -0
  330. package/src/skillc/types.gleam +93 -0
  331. package/src/skillc/version_constraint.gleam +163 -0
  332. package/src/skillc/yaml.gleam +27 -0
  333. package/src/skillc.gleam +466 -0
  334. package/src/skillc_ffi.mjs +30 -0
@@ -0,0 +1,1004 @@
1
+ -module(gleam@int).
2
+ -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
3
+ -define(FILEPATH, "src/gleam/int.gleam").
4
+ -export([absolute_value/1, parse/1, base_parse/2, to_string/1, to_base_string/2, to_base2/1, to_base8/1, to_base16/1, to_base36/1, to_float/1, power/2, square_root/1, compare/2, min/2, max/2, clamp/3, is_even/1, is_odd/1, negate/1, sum/1, product/1, random/1, divide/2, remainder/2, modulo/2, floor_divide/2, add/2, multiply/2, subtract/2, bitwise_and/2, bitwise_not/1, bitwise_or/2, bitwise_exclusive_or/2, bitwise_shift_left/2, bitwise_shift_right/2, range/4]).
5
+
6
+ -if(?OTP_RELEASE >= 27).
7
+ -define(MODULEDOC(Str), -moduledoc(Str)).
8
+ -define(DOC(Str), -doc(Str)).
9
+ -else.
10
+ -define(MODULEDOC(Str), -compile([])).
11
+ -define(DOC(Str), -compile([])).
12
+ -endif.
13
+
14
+ ?MODULEDOC(
15
+ " Functions for working with integers.\n"
16
+ "\n"
17
+ " ## Division by zero\n"
18
+ "\n"
19
+ " In Erlang division by zero results in a crash, however Gleam does not have\n"
20
+ " partial functions and operators in core so instead division by zero returns\n"
21
+ " zero, a behaviour taken from Pony, Coq, and Lean.\n"
22
+ "\n"
23
+ " This may seem unexpected at first, but it is no less mathematically valid\n"
24
+ " than crashing or returning a special value. Division by zero is undefined\n"
25
+ " in mathematics.\n"
26
+ ).
27
+
28
+ -file("src/gleam/int.gleam", 30).
29
+ ?DOC(
30
+ " Returns the absolute value of the input.\n"
31
+ "\n"
32
+ " ## Examples\n"
33
+ "\n"
34
+ " ```gleam\n"
35
+ " absolute_value(-12)\n"
36
+ " // -> 12\n"
37
+ " ```\n"
38
+ "\n"
39
+ " ```gleam\n"
40
+ " absolute_value(10)\n"
41
+ " // -> 10\n"
42
+ " ```\n"
43
+ ).
44
+ -spec absolute_value(integer()) -> integer().
45
+ absolute_value(X) ->
46
+ case X >= 0 of
47
+ true ->
48
+ X;
49
+
50
+ false ->
51
+ X * -1
52
+ end.
53
+
54
+ -file("src/gleam/int.gleam", 109).
55
+ ?DOC(
56
+ " Parses a given string as an int if possible.\n"
57
+ "\n"
58
+ " ## Examples\n"
59
+ "\n"
60
+ " ```gleam\n"
61
+ " parse(\"2\")\n"
62
+ " // -> Ok(2)\n"
63
+ " ```\n"
64
+ "\n"
65
+ " ```gleam\n"
66
+ " parse(\"ABC\")\n"
67
+ " // -> Error(Nil)\n"
68
+ " ```\n"
69
+ ).
70
+ -spec parse(binary()) -> {ok, integer()} | {error, nil}.
71
+ parse(String) ->
72
+ gleam_stdlib:parse_int(String).
73
+
74
+ -file("src/gleam/int.gleam", 141).
75
+ ?DOC(
76
+ " Parses a given string as an int in a given base if possible.\n"
77
+ " Supports only bases 2 to 36, for values outside of which this function returns an `Error(Nil)`.\n"
78
+ "\n"
79
+ " ## Examples\n"
80
+ "\n"
81
+ " ```gleam\n"
82
+ " base_parse(\"10\", 2)\n"
83
+ " // -> Ok(2)\n"
84
+ " ```\n"
85
+ "\n"
86
+ " ```gleam\n"
87
+ " base_parse(\"30\", 16)\n"
88
+ " // -> Ok(48)\n"
89
+ " ```\n"
90
+ "\n"
91
+ " ```gleam\n"
92
+ " base_parse(\"1C\", 36)\n"
93
+ " // -> Ok(48)\n"
94
+ " ```\n"
95
+ "\n"
96
+ " ```gleam\n"
97
+ " base_parse(\"48\", 1)\n"
98
+ " // -> Error(Nil)\n"
99
+ " ```\n"
100
+ "\n"
101
+ " ```gleam\n"
102
+ " base_parse(\"48\", 37)\n"
103
+ " // -> Error(Nil)\n"
104
+ " ```\n"
105
+ ).
106
+ -spec base_parse(binary(), integer()) -> {ok, integer()} | {error, nil}.
107
+ base_parse(String, Base) ->
108
+ case (Base >= 2) andalso (Base =< 36) of
109
+ true ->
110
+ gleam_stdlib:int_from_base_string(String, Base);
111
+
112
+ false ->
113
+ {error, nil}
114
+ end.
115
+
116
+ -file("src/gleam/int.gleam", 163).
117
+ ?DOC(
118
+ " Prints a given int to a string.\n"
119
+ "\n"
120
+ " ## Examples\n"
121
+ "\n"
122
+ " ```gleam\n"
123
+ " to_string(2)\n"
124
+ " // -> \"2\"\n"
125
+ " ```\n"
126
+ ).
127
+ -spec to_string(integer()) -> binary().
128
+ to_string(X) ->
129
+ erlang:integer_to_binary(X).
130
+
131
+ -file("src/gleam/int.gleam", 196).
132
+ ?DOC(
133
+ " Prints a given int to a string using the base number provided.\n"
134
+ " Supports only bases 2 to 36, for values outside of which this function returns an `Error(Nil)`.\n"
135
+ " For common bases (2, 8, 16, 36), use the `to_baseN` functions.\n"
136
+ "\n"
137
+ " ## Examples\n"
138
+ "\n"
139
+ " ```gleam\n"
140
+ " to_base_string(2, 2)\n"
141
+ " // -> Ok(\"10\")\n"
142
+ " ```\n"
143
+ "\n"
144
+ " ```gleam\n"
145
+ " to_base_string(48, 16)\n"
146
+ " // -> Ok(\"30\")\n"
147
+ " ```\n"
148
+ "\n"
149
+ " ```gleam\n"
150
+ " to_base_string(48, 36)\n"
151
+ " // -> Ok(\"1C\")\n"
152
+ " ```\n"
153
+ "\n"
154
+ " ```gleam\n"
155
+ " to_base_string(48, 1)\n"
156
+ " // -> Error(Nil)\n"
157
+ " ```\n"
158
+ "\n"
159
+ " ```gleam\n"
160
+ " to_base_string(48, 37)\n"
161
+ " // -> Error(Nil)\n"
162
+ " ```\n"
163
+ ).
164
+ -spec to_base_string(integer(), integer()) -> {ok, binary()} | {error, nil}.
165
+ to_base_string(X, Base) ->
166
+ case (Base >= 2) andalso (Base =< 36) of
167
+ true ->
168
+ {ok, erlang:integer_to_binary(X, Base)};
169
+
170
+ false ->
171
+ {error, nil}
172
+ end.
173
+
174
+ -file("src/gleam/int.gleam", 216).
175
+ ?DOC(
176
+ " Prints a given int to a string using base-2.\n"
177
+ "\n"
178
+ " ## Examples\n"
179
+ "\n"
180
+ " ```gleam\n"
181
+ " to_base2(2)\n"
182
+ " // -> \"10\"\n"
183
+ " ```\n"
184
+ ).
185
+ -spec to_base2(integer()) -> binary().
186
+ to_base2(X) ->
187
+ erlang:integer_to_binary(X, 2).
188
+
189
+ -file("src/gleam/int.gleam", 229).
190
+ ?DOC(
191
+ " Prints a given int to a string using base-8.\n"
192
+ "\n"
193
+ " ## Examples\n"
194
+ "\n"
195
+ " ```gleam\n"
196
+ " to_base8(15)\n"
197
+ " // -> \"17\"\n"
198
+ " ```\n"
199
+ ).
200
+ -spec to_base8(integer()) -> binary().
201
+ to_base8(X) ->
202
+ erlang:integer_to_binary(X, 8).
203
+
204
+ -file("src/gleam/int.gleam", 242).
205
+ ?DOC(
206
+ " Prints a given int to a string using base-16.\n"
207
+ "\n"
208
+ " ## Examples\n"
209
+ "\n"
210
+ " ```gleam\n"
211
+ " to_base16(48)\n"
212
+ " // -> \"30\"\n"
213
+ " ```\n"
214
+ ).
215
+ -spec to_base16(integer()) -> binary().
216
+ to_base16(X) ->
217
+ erlang:integer_to_binary(X, 16).
218
+
219
+ -file("src/gleam/int.gleam", 255).
220
+ ?DOC(
221
+ " Prints a given int to a string using base-36.\n"
222
+ "\n"
223
+ " ## Examples\n"
224
+ "\n"
225
+ " ```gleam\n"
226
+ " to_base36(48)\n"
227
+ " // -> \"1C\"\n"
228
+ " ```\n"
229
+ ).
230
+ -spec to_base36(integer()) -> binary().
231
+ to_base36(X) ->
232
+ erlang:integer_to_binary(X, 36).
233
+
234
+ -file("src/gleam/int.gleam", 280).
235
+ ?DOC(
236
+ " Takes an int and returns its value as a float.\n"
237
+ "\n"
238
+ " ## Examples\n"
239
+ "\n"
240
+ " ```gleam\n"
241
+ " to_float(5)\n"
242
+ " // -> 5.0\n"
243
+ " ```\n"
244
+ "\n"
245
+ " ```gleam\n"
246
+ " to_float(0)\n"
247
+ " // -> 0.0\n"
248
+ " ```\n"
249
+ "\n"
250
+ " ```gleam\n"
251
+ " to_float(-3)\n"
252
+ " // -> -3.0\n"
253
+ " ```\n"
254
+ ).
255
+ -spec to_float(integer()) -> float().
256
+ to_float(X) ->
257
+ erlang:float(X).
258
+
259
+ -file("src/gleam/int.gleam", 67).
260
+ ?DOC(
261
+ " Returns the result of the base being raised to the power of the\n"
262
+ " exponent, as a `Float`.\n"
263
+ "\n"
264
+ " ## Examples\n"
265
+ "\n"
266
+ " ```gleam\n"
267
+ " power(2, -1.0)\n"
268
+ " // -> Ok(0.5)\n"
269
+ " ```\n"
270
+ "\n"
271
+ " ```gleam\n"
272
+ " power(2, 2.0)\n"
273
+ " // -> Ok(4.0)\n"
274
+ " ```\n"
275
+ "\n"
276
+ " ```gleam\n"
277
+ " power(8, 1.5)\n"
278
+ " // -> Ok(22.627416997969522)\n"
279
+ " ```\n"
280
+ "\n"
281
+ " ```gleam\n"
282
+ " 4 |> power(of: 2.0)\n"
283
+ " // -> Ok(16.0)\n"
284
+ " ```\n"
285
+ "\n"
286
+ " ```gleam\n"
287
+ " power(-1, 0.5)\n"
288
+ " // -> Error(Nil)\n"
289
+ " ```\n"
290
+ ).
291
+ -spec power(integer(), float()) -> {ok, float()} | {error, nil}.
292
+ power(Base, Exponent) ->
293
+ _pipe = Base,
294
+ _pipe@1 = erlang:float(_pipe),
295
+ gleam@float:power(_pipe@1, Exponent).
296
+
297
+ -file("src/gleam/int.gleam", 87).
298
+ ?DOC(
299
+ " Returns the square root of the input as a `Float`.\n"
300
+ "\n"
301
+ " ## Examples\n"
302
+ "\n"
303
+ " ```gleam\n"
304
+ " square_root(4)\n"
305
+ " // -> Ok(2.0)\n"
306
+ " ```\n"
307
+ "\n"
308
+ " ```gleam\n"
309
+ " square_root(-16)\n"
310
+ " // -> Error(Nil)\n"
311
+ " ```\n"
312
+ ).
313
+ -spec square_root(integer()) -> {ok, float()} | {error, nil}.
314
+ square_root(X) ->
315
+ _pipe = X,
316
+ _pipe@1 = erlang:float(_pipe),
317
+ gleam@float:square_root(_pipe@1).
318
+
319
+ -file("src/gleam/int.gleam", 326).
320
+ ?DOC(
321
+ " Compares two ints, returning an order.\n"
322
+ "\n"
323
+ " ## Examples\n"
324
+ "\n"
325
+ " ```gleam\n"
326
+ " compare(2, 3)\n"
327
+ " // -> Lt\n"
328
+ " ```\n"
329
+ "\n"
330
+ " ```gleam\n"
331
+ " compare(4, 3)\n"
332
+ " // -> Gt\n"
333
+ " ```\n"
334
+ "\n"
335
+ " ```gleam\n"
336
+ " compare(3, 3)\n"
337
+ " // -> Eq\n"
338
+ " ```\n"
339
+ ).
340
+ -spec compare(integer(), integer()) -> gleam@order:order().
341
+ compare(A, B) ->
342
+ case A =:= B of
343
+ true ->
344
+ eq;
345
+
346
+ false ->
347
+ case A < B of
348
+ true ->
349
+ lt;
350
+
351
+ false ->
352
+ gt
353
+ end
354
+ end.
355
+
356
+ -file("src/gleam/int.gleam", 346).
357
+ ?DOC(
358
+ " Compares two ints, returning the smaller of the two.\n"
359
+ "\n"
360
+ " ## Examples\n"
361
+ "\n"
362
+ " ```gleam\n"
363
+ " min(2, 3)\n"
364
+ " // -> 2\n"
365
+ " ```\n"
366
+ ).
367
+ -spec min(integer(), integer()) -> integer().
368
+ min(A, B) ->
369
+ case A < B of
370
+ true ->
371
+ A;
372
+
373
+ false ->
374
+ B
375
+ end.
376
+
377
+ -file("src/gleam/int.gleam", 362).
378
+ ?DOC(
379
+ " Compares two ints, returning the larger of the two.\n"
380
+ "\n"
381
+ " ## Examples\n"
382
+ "\n"
383
+ " ```gleam\n"
384
+ " max(2, 3)\n"
385
+ " // -> 3\n"
386
+ " ```\n"
387
+ ).
388
+ -spec max(integer(), integer()) -> integer().
389
+ max(A, B) ->
390
+ case A > B of
391
+ true ->
392
+ A;
393
+
394
+ false ->
395
+ B
396
+ end.
397
+
398
+ -file("src/gleam/int.gleam", 300).
399
+ ?DOC(
400
+ " Restricts an int between two bounds.\n"
401
+ "\n"
402
+ " Note: If the `min` argument is larger than the `max` argument then they\n"
403
+ " will be swapped, so the minimum bound is always lower than the maximum\n"
404
+ " bound.\n"
405
+ "\n"
406
+ " ## Examples\n"
407
+ "\n"
408
+ " ```gleam\n"
409
+ " clamp(40, min: 50, max: 60)\n"
410
+ " // -> 50\n"
411
+ " ```\n"
412
+ "\n"
413
+ " ```gleam\n"
414
+ " clamp(40, min: 50, max: 30)\n"
415
+ " // -> 40\n"
416
+ " ```\n"
417
+ ).
418
+ -spec clamp(integer(), integer(), integer()) -> integer().
419
+ clamp(X, Min_bound, Max_bound) ->
420
+ case Min_bound >= Max_bound of
421
+ true ->
422
+ _pipe = X,
423
+ _pipe@1 = min(_pipe, Min_bound),
424
+ max(_pipe@1, Max_bound);
425
+
426
+ false ->
427
+ _pipe@2 = X,
428
+ _pipe@3 = min(_pipe@2, Max_bound),
429
+ max(_pipe@3, Min_bound)
430
+ end.
431
+
432
+ -file("src/gleam/int.gleam", 383).
433
+ ?DOC(
434
+ " Returns whether the value provided is even.\n"
435
+ "\n"
436
+ " ## Examples\n"
437
+ "\n"
438
+ " ```gleam\n"
439
+ " is_even(2)\n"
440
+ " // -> True\n"
441
+ " ```\n"
442
+ "\n"
443
+ " ```gleam\n"
444
+ " is_even(3)\n"
445
+ " // -> False\n"
446
+ " ```\n"
447
+ ).
448
+ -spec is_even(integer()) -> boolean().
449
+ is_even(X) ->
450
+ (X rem 2) =:= 0.
451
+
452
+ -file("src/gleam/int.gleam", 401).
453
+ ?DOC(
454
+ " Returns whether the value provided is odd.\n"
455
+ "\n"
456
+ " ## Examples\n"
457
+ "\n"
458
+ " ```gleam\n"
459
+ " is_odd(3)\n"
460
+ " // -> True\n"
461
+ " ```\n"
462
+ "\n"
463
+ " ```gleam\n"
464
+ " is_odd(2)\n"
465
+ " // -> False\n"
466
+ " ```\n"
467
+ ).
468
+ -spec is_odd(integer()) -> boolean().
469
+ is_odd(X) ->
470
+ (X rem 2) /= 0.
471
+
472
+ -file("src/gleam/int.gleam", 414).
473
+ ?DOC(
474
+ " Returns the negative of the value provided.\n"
475
+ "\n"
476
+ " ## Examples\n"
477
+ "\n"
478
+ " ```gleam\n"
479
+ " negate(1)\n"
480
+ " // -> -1\n"
481
+ " ```\n"
482
+ ).
483
+ -spec negate(integer()) -> integer().
484
+ negate(X) ->
485
+ -1 * X.
486
+
487
+ -file("src/gleam/int.gleam", 431).
488
+ -spec sum_loop(list(integer()), integer()) -> integer().
489
+ sum_loop(Numbers, Initial) ->
490
+ case Numbers of
491
+ [First | Rest] ->
492
+ sum_loop(Rest, First + Initial);
493
+
494
+ [] ->
495
+ Initial
496
+ end.
497
+
498
+ -file("src/gleam/int.gleam", 427).
499
+ ?DOC(
500
+ " Sums a list of ints.\n"
501
+ "\n"
502
+ " ## Example\n"
503
+ "\n"
504
+ " ```gleam\n"
505
+ " sum([1, 2, 3])\n"
506
+ " // -> 6\n"
507
+ " ```\n"
508
+ ).
509
+ -spec sum(list(integer())) -> integer().
510
+ sum(Numbers) ->
511
+ sum_loop(Numbers, 0).
512
+
513
+ -file("src/gleam/int.gleam", 451).
514
+ -spec product_loop(list(integer()), integer()) -> integer().
515
+ product_loop(Numbers, Initial) ->
516
+ case Numbers of
517
+ [First | Rest] ->
518
+ product_loop(Rest, First * Initial);
519
+
520
+ [] ->
521
+ Initial
522
+ end.
523
+
524
+ -file("src/gleam/int.gleam", 447).
525
+ ?DOC(
526
+ " Multiplies a list of ints and returns the product.\n"
527
+ "\n"
528
+ " ## Example\n"
529
+ "\n"
530
+ " ```gleam\n"
531
+ " product([2, 3, 4])\n"
532
+ " // -> 24\n"
533
+ " ```\n"
534
+ ).
535
+ -spec product(list(integer())) -> integer().
536
+ product(Numbers) ->
537
+ product_loop(Numbers, 1).
538
+
539
+ -file("src/gleam/int.gleam", 479).
540
+ ?DOC(
541
+ " Generates a random int between zero and the given maximum.\n"
542
+ "\n"
543
+ " The lower number is inclusive, the upper number is exclusive.\n"
544
+ "\n"
545
+ " ## Examples\n"
546
+ "\n"
547
+ " ```gleam\n"
548
+ " random(10)\n"
549
+ " // -> 4\n"
550
+ " ```\n"
551
+ "\n"
552
+ " ```gleam\n"
553
+ " random(1)\n"
554
+ " // -> 0\n"
555
+ " ```\n"
556
+ "\n"
557
+ " ```gleam\n"
558
+ " random(-1)\n"
559
+ " // -> -1\n"
560
+ " ```\n"
561
+ ).
562
+ -spec random(integer()) -> integer().
563
+ random(Max) ->
564
+ _pipe = (rand:uniform() * erlang:float(Max)),
565
+ _pipe@1 = math:floor(_pipe),
566
+ erlang:round(_pipe@1).
567
+
568
+ -file("src/gleam/int.gleam", 512).
569
+ ?DOC(
570
+ " Performs a truncated integer division.\n"
571
+ "\n"
572
+ " Returns division of the inputs as a `Result`: If the given divisor equals\n"
573
+ " `0`, this function returns an `Error`.\n"
574
+ "\n"
575
+ " ## Examples\n"
576
+ "\n"
577
+ " ```gleam\n"
578
+ " divide(0, 1)\n"
579
+ " // -> Ok(0)\n"
580
+ " ```\n"
581
+ "\n"
582
+ " ```gleam\n"
583
+ " divide(1, 0)\n"
584
+ " // -> Error(Nil)\n"
585
+ " ```\n"
586
+ "\n"
587
+ " ```gleam\n"
588
+ " divide(5, 2)\n"
589
+ " // -> Ok(2)\n"
590
+ " ```\n"
591
+ "\n"
592
+ " ```gleam\n"
593
+ " divide(-99, 2)\n"
594
+ " // -> Ok(-49)\n"
595
+ " ```\n"
596
+ ).
597
+ -spec divide(integer(), integer()) -> {ok, integer()} | {error, nil}.
598
+ divide(Dividend, Divisor) ->
599
+ case Divisor of
600
+ 0 ->
601
+ {error, nil};
602
+
603
+ Divisor@1 ->
604
+ {ok, case Divisor@1 of
605
+ 0 -> 0;
606
+ Gleam@denominator -> Dividend div Gleam@denominator
607
+ end}
608
+ end.
609
+
610
+ -file("src/gleam/int.gleam", 564).
611
+ ?DOC(
612
+ " Computes the remainder of an integer division of inputs as a `Result`.\n"
613
+ "\n"
614
+ " Returns division of the inputs as a `Result`: If the given divisor equals\n"
615
+ " `0`, this function returns an `Error`.\n"
616
+ "\n"
617
+ " Most of the time you will want to use the `%` operator instead of this\n"
618
+ " function.\n"
619
+ "\n"
620
+ " ## Examples\n"
621
+ "\n"
622
+ " ```gleam\n"
623
+ " remainder(3, 2)\n"
624
+ " // -> Ok(1)\n"
625
+ " ```\n"
626
+ "\n"
627
+ " ```gleam\n"
628
+ " remainder(1, 0)\n"
629
+ " // -> Error(Nil)\n"
630
+ " ```\n"
631
+ "\n"
632
+ " ```gleam\n"
633
+ " remainder(10, -1)\n"
634
+ " // -> Ok(0)\n"
635
+ " ```\n"
636
+ "\n"
637
+ " ```gleam\n"
638
+ " remainder(13, by: 3)\n"
639
+ " // -> Ok(1)\n"
640
+ " ```\n"
641
+ "\n"
642
+ " ```gleam\n"
643
+ " remainder(-13, by: 3)\n"
644
+ " // -> Ok(-1)\n"
645
+ " ```\n"
646
+ "\n"
647
+ " ```gleam\n"
648
+ " remainder(13, by: -3)\n"
649
+ " // -> Ok(1)\n"
650
+ " ```\n"
651
+ "\n"
652
+ " ```gleam\n"
653
+ " remainder(-13, by: -3)\n"
654
+ " // -> Ok(-1)\n"
655
+ " ```\n"
656
+ ).
657
+ -spec remainder(integer(), integer()) -> {ok, integer()} | {error, nil}.
658
+ remainder(Dividend, Divisor) ->
659
+ case Divisor of
660
+ 0 ->
661
+ {error, nil};
662
+
663
+ Divisor@1 ->
664
+ {ok, case Divisor@1 of
665
+ 0 -> 0;
666
+ Gleam@denominator -> Dividend rem Gleam@denominator
667
+ end}
668
+ end.
669
+
670
+ -file("src/gleam/int.gleam", 611).
671
+ ?DOC(
672
+ " Computes the modulo of an integer division of inputs as a `Result`.\n"
673
+ "\n"
674
+ " Returns division of the inputs as a `Result`: If the given divisor equals\n"
675
+ " `0`, this function returns an `Error`.\n"
676
+ "\n"
677
+ " Note that this is different from `int.remainder` and `%` in that the\n"
678
+ " computed value will always have the same sign as the `divisor`.\n"
679
+ "\n"
680
+ " ## Examples\n"
681
+ "\n"
682
+ " ```gleam\n"
683
+ " modulo(3, 2)\n"
684
+ " // -> Ok(1)\n"
685
+ " ```\n"
686
+ "\n"
687
+ " ```gleam\n"
688
+ " modulo(1, 0)\n"
689
+ " // -> Error(Nil)\n"
690
+ " ```\n"
691
+ "\n"
692
+ " ```gleam\n"
693
+ " modulo(10, -1)\n"
694
+ " // -> Ok(0)\n"
695
+ " ```\n"
696
+ "\n"
697
+ " ```gleam\n"
698
+ " modulo(13, by: 3)\n"
699
+ " // -> Ok(1)\n"
700
+ " ```\n"
701
+ "\n"
702
+ " ```gleam\n"
703
+ " modulo(-13, by: 3)\n"
704
+ " // -> Ok(2)\n"
705
+ " ```\n"
706
+ "\n"
707
+ " ```gleam\n"
708
+ " modulo(13, by: -3)\n"
709
+ " // -> Ok(-2)\n"
710
+ " ```\n"
711
+ ).
712
+ -spec modulo(integer(), integer()) -> {ok, integer()} | {error, nil}.
713
+ modulo(Dividend, Divisor) ->
714
+ case Divisor of
715
+ 0 ->
716
+ {error, nil};
717
+
718
+ _ ->
719
+ Remainder = case Divisor of
720
+ 0 -> 0;
721
+ Gleam@denominator -> Dividend rem Gleam@denominator
722
+ end,
723
+ case (Remainder * Divisor) < 0 of
724
+ true ->
725
+ {ok, Remainder + Divisor};
726
+
727
+ false ->
728
+ {ok, Remainder}
729
+ end
730
+ end.
731
+
732
+ -file("src/gleam/int.gleam", 655).
733
+ ?DOC(
734
+ " Performs a *floored* integer division, which means that the result will\n"
735
+ " always be rounded towards negative infinity.\n"
736
+ "\n"
737
+ " If you want to perform truncated integer division (rounding towards zero),\n"
738
+ " use `int.divide()` or the `/` operator instead.\n"
739
+ "\n"
740
+ " Returns division of the inputs as a `Result`: If the given divisor equals\n"
741
+ " `0`, this function returns an `Error`.\n"
742
+ "\n"
743
+ " ## Examples\n"
744
+ "\n"
745
+ " ```gleam\n"
746
+ " floor_divide(1, 0)\n"
747
+ " // -> Error(Nil)\n"
748
+ " ```\n"
749
+ "\n"
750
+ " ```gleam\n"
751
+ " floor_divide(5, 2)\n"
752
+ " // -> Ok(2)\n"
753
+ " ```\n"
754
+ "\n"
755
+ " ```gleam\n"
756
+ " floor_divide(6, -4)\n"
757
+ " // -> Ok(-2)\n"
758
+ " ```\n"
759
+ "\n"
760
+ " ```gleam\n"
761
+ " floor_divide(-99, 2)\n"
762
+ " // -> Ok(-50)\n"
763
+ " ```\n"
764
+ ).
765
+ -spec floor_divide(integer(), integer()) -> {ok, integer()} | {error, nil}.
766
+ floor_divide(Dividend, Divisor) ->
767
+ case Divisor of
768
+ 0 ->
769
+ {error, nil};
770
+
771
+ Divisor@1 ->
772
+ case ((Dividend * Divisor@1) < 0) andalso ((case Divisor@1 of
773
+ 0 -> 0;
774
+ Gleam@denominator -> Dividend rem Gleam@denominator
775
+ end) /= 0) of
776
+ true ->
777
+ {ok, (case Divisor@1 of
778
+ 0 -> 0;
779
+ Gleam@denominator@1 -> Dividend div Gleam@denominator@1
780
+ end) - 1};
781
+
782
+ false ->
783
+ {ok, case Divisor@1 of
784
+ 0 -> 0;
785
+ Gleam@denominator@2 -> Dividend div Gleam@denominator@2
786
+ end}
787
+ end
788
+ end.
789
+
790
+ -file("src/gleam/int.gleam", 689).
791
+ ?DOC(
792
+ " Adds two integers together.\n"
793
+ "\n"
794
+ " It's the function equivalent of the `+` operator.\n"
795
+ " This function is useful in higher order functions or pipes.\n"
796
+ "\n"
797
+ " ## Examples\n"
798
+ "\n"
799
+ " ```gleam\n"
800
+ " add(1, 2)\n"
801
+ " // -> 3\n"
802
+ " ```\n"
803
+ "\n"
804
+ " ```gleam\n"
805
+ " import gleam/list\n"
806
+ " list.fold([1, 2, 3], 0, add)\n"
807
+ " // -> 6\n"
808
+ " ```\n"
809
+ "\n"
810
+ " ```gleam\n"
811
+ " 3 |> add(2)\n"
812
+ " // -> 5\n"
813
+ " ```\n"
814
+ ).
815
+ -spec add(integer(), integer()) -> integer().
816
+ add(A, B) ->
817
+ A + B.
818
+
819
+ -file("src/gleam/int.gleam", 717).
820
+ ?DOC(
821
+ " Multiplies two integers together.\n"
822
+ "\n"
823
+ " It's the function equivalent of the `*` operator.\n"
824
+ " This function is useful in higher order functions or pipes.\n"
825
+ "\n"
826
+ " ## Examples\n"
827
+ "\n"
828
+ " ```gleam\n"
829
+ " multiply(2, 4)\n"
830
+ " // -> 8\n"
831
+ " ```\n"
832
+ "\n"
833
+ " ```gleam\n"
834
+ " import gleam/list\n"
835
+ "\n"
836
+ " list.fold([2, 3, 4], 1, multiply)\n"
837
+ " // -> 24\n"
838
+ " ```\n"
839
+ "\n"
840
+ " ```gleam\n"
841
+ " 3 |> multiply(2)\n"
842
+ " // -> 6\n"
843
+ " ```\n"
844
+ ).
845
+ -spec multiply(integer(), integer()) -> integer().
846
+ multiply(A, B) ->
847
+ A * B.
848
+
849
+ -file("src/gleam/int.gleam", 750).
850
+ ?DOC(
851
+ " Subtracts one int from another.\n"
852
+ "\n"
853
+ " It's the function equivalent of the `-` operator.\n"
854
+ " This function is useful in higher order functions or pipes.\n"
855
+ "\n"
856
+ " ## Examples\n"
857
+ "\n"
858
+ " ```gleam\n"
859
+ " subtract(3, 1)\n"
860
+ " // -> 2\n"
861
+ " ```\n"
862
+ "\n"
863
+ " ```gleam\n"
864
+ " import gleam/list\n"
865
+ "\n"
866
+ " list.fold([1, 2, 3], 10, subtract)\n"
867
+ " // -> 4\n"
868
+ " ```\n"
869
+ "\n"
870
+ " ```gleam\n"
871
+ " 3 |> subtract(2)\n"
872
+ " // -> 1\n"
873
+ " ```\n"
874
+ "\n"
875
+ " ```gleam\n"
876
+ " 3 |> subtract(2, _)\n"
877
+ " // -> -1\n"
878
+ " ```\n"
879
+ ).
880
+ -spec subtract(integer(), integer()) -> integer().
881
+ subtract(A, B) ->
882
+ A - B.
883
+
884
+ -file("src/gleam/int.gleam", 762).
885
+ ?DOC(
886
+ " Calculates the bitwise AND of its arguments.\n"
887
+ "\n"
888
+ " The exact behaviour of this function depends on the target platform.\n"
889
+ " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n"
890
+ " is equivalent to bitwise operations on big-ints.\n"
891
+ ).
892
+ -spec bitwise_and(integer(), integer()) -> integer().
893
+ bitwise_and(X, Y) ->
894
+ erlang:'band'(X, Y).
895
+
896
+ -file("src/gleam/int.gleam", 772).
897
+ ?DOC(
898
+ " Calculates the bitwise NOT of its argument.\n"
899
+ "\n"
900
+ " The exact behaviour of this function depends on the target platform.\n"
901
+ " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n"
902
+ " is equivalent to bitwise operations on big-ints.\n"
903
+ ).
904
+ -spec bitwise_not(integer()) -> integer().
905
+ bitwise_not(X) ->
906
+ erlang:'bnot'(X).
907
+
908
+ -file("src/gleam/int.gleam", 782).
909
+ ?DOC(
910
+ " Calculates the bitwise OR of its arguments.\n"
911
+ "\n"
912
+ " The exact behaviour of this function depends on the target platform.\n"
913
+ " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n"
914
+ " is equivalent to bitwise operations on big-ints.\n"
915
+ ).
916
+ -spec bitwise_or(integer(), integer()) -> integer().
917
+ bitwise_or(X, Y) ->
918
+ erlang:'bor'(X, Y).
919
+
920
+ -file("src/gleam/int.gleam", 792).
921
+ ?DOC(
922
+ " Calculates the bitwise XOR of its arguments.\n"
923
+ "\n"
924
+ " The exact behaviour of this function depends on the target platform.\n"
925
+ " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n"
926
+ " is equivalent to bitwise operations on big-ints.\n"
927
+ ).
928
+ -spec bitwise_exclusive_or(integer(), integer()) -> integer().
929
+ bitwise_exclusive_or(X, Y) ->
930
+ erlang:'bxor'(X, Y).
931
+
932
+ -file("src/gleam/int.gleam", 802).
933
+ ?DOC(
934
+ " Calculates the result of an arithmetic left bitshift.\n"
935
+ "\n"
936
+ " The exact behaviour of this function depends on the target platform.\n"
937
+ " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n"
938
+ " is equivalent to bitwise operations on big-ints.\n"
939
+ ).
940
+ -spec bitwise_shift_left(integer(), integer()) -> integer().
941
+ bitwise_shift_left(X, Y) ->
942
+ erlang:'bsl'(X, Y).
943
+
944
+ -file("src/gleam/int.gleam", 812).
945
+ ?DOC(
946
+ " Calculates the result of an arithmetic right bitshift.\n"
947
+ "\n"
948
+ " The exact behaviour of this function depends on the target platform.\n"
949
+ " On Erlang it is equivalent to bitwise operations on ints, on JavaScript it\n"
950
+ " is equivalent to bitwise operations on big-ints.\n"
951
+ ).
952
+ -spec bitwise_shift_right(integer(), integer()) -> integer().
953
+ bitwise_shift_right(X, Y) ->
954
+ erlang:'bsr'(X, Y).
955
+
956
+ -file("src/gleam/int.gleam", 845).
957
+ -spec range_loop(
958
+ integer(),
959
+ integer(),
960
+ integer(),
961
+ CM,
962
+ fun((CM, integer()) -> CM)
963
+ ) -> CM.
964
+ range_loop(Current, Stop, Increment, Acc, Reducer) ->
965
+ case Current =:= Stop of
966
+ true ->
967
+ Acc;
968
+
969
+ false ->
970
+ Acc@1 = Reducer(Acc, Current),
971
+ Current@1 = Current + Increment,
972
+ range_loop(Current@1, Stop, Increment, Acc@1, Reducer)
973
+ end.
974
+
975
+ -file("src/gleam/int.gleam", 832).
976
+ ?DOC(
977
+ " Run a function for each int between ints `from` and `to`.\n"
978
+ "\n"
979
+ " `from` is inclusive, and `to` is exclusive.\n"
980
+ "\n"
981
+ " ## Examples\n"
982
+ "\n"
983
+ " ```gleam\n"
984
+ " range(from: 0, to: 3, with: \"\", run: fn(acc, i) {\n"
985
+ " acc <> to_string(i)\n"
986
+ " })\n"
987
+ " // -> \"012\"\n"
988
+ " ```\n"
989
+ "\n"
990
+ " ```gleam\n"
991
+ " range(from: 1, to: -2, with: [], run: list.prepend)\n"
992
+ " // -> [-1, 0, 1]\n"
993
+ " ```\n"
994
+ ).
995
+ -spec range(integer(), integer(), CL, fun((CL, integer()) -> CL)) -> CL.
996
+ range(Start, Stop, Acc, Reducer) ->
997
+ Increment = case Start < Stop of
998
+ true ->
999
+ 1;
1000
+
1001
+ false ->
1002
+ -1
1003
+ end,
1004
+ range_loop(Start, Stop, Increment, Acc, Reducer).