@mojir/dvala 0.0.10 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1141) hide show
  1. package/dist/cli/cli.js +33052 -36955
  2. package/package.json +194 -31
  3. package/dist/bundler.esm.js +0 -2
  4. package/dist/bundler.esm.js.map +0 -1
  5. package/dist/bundler.js +0 -2
  6. package/dist/bundler.js.map +0 -1
  7. package/dist/cli/cli/src/cli.d.ts +0 -2
  8. package/dist/cli/cli/src/cliDocumentation/formatCliDescription.d.ts +0 -3
  9. package/dist/cli/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +0 -3
  10. package/dist/cli/cli/src/cliDocumentation/getCliDocumentation.d.ts +0 -2
  11. package/dist/cli/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +0 -3
  12. package/dist/cli/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +0 -3
  13. package/dist/cli/cli/src/cliDocumentation/getCliTitle.d.ts +0 -3
  14. package/dist/cli/cli/src/cliDocumentation/getCliType.d.ts +0 -3
  15. package/dist/cli/cli/src/cliFormatterRules.d.ts +0 -13
  16. package/dist/cli/cli/src/colorizer.d.ts +0 -939
  17. package/dist/cli/cli/src/createReadlineInterface.d.ts +0 -5
  18. package/dist/cli/cli/src/js-interop/Cli/Fs/index.d.ts +0 -2
  19. package/dist/cli/cli/src/js-interop/Cli/Proc/index.d.ts +0 -3
  20. package/dist/cli/cli/src/js-interop/Cli/index.d.ts +0 -2
  21. package/dist/cli/common/createFormatter.d.ts +0 -6
  22. package/dist/cli/common/utils.d.ts +0 -2
  23. package/dist/cli/reference/api.d.ts +0 -73
  24. package/dist/cli/reference/datatype.d.ts +0 -3
  25. package/dist/cli/reference/examples.d.ts +0 -11
  26. package/dist/cli/reference/index.d.ts +0 -195
  27. package/dist/cli/reference/shorthand.d.ts +0 -3
  28. package/dist/cli/src/AutoCompleter/AutoCompleter.d.ts +0 -27
  29. package/dist/cli/src/Cache.d.ts +0 -16
  30. package/dist/cli/src/allModules.d.ts +0 -2
  31. package/dist/cli/src/builtin/bindingNode.d.ts +0 -11
  32. package/dist/cli/src/builtin/core/array.d.ts +0 -2
  33. package/dist/cli/src/builtin/core/assertion.d.ts +0 -2
  34. package/dist/cli/src/builtin/core/bitwise.d.ts +0 -2
  35. package/dist/cli/src/builtin/core/collection.d.ts +0 -2
  36. package/dist/cli/src/builtin/core/functional.d.ts +0 -2
  37. package/dist/cli/src/builtin/core/math.d.ts +0 -2
  38. package/dist/cli/src/builtin/core/meta.d.ts +0 -3
  39. package/dist/cli/src/builtin/core/misc.d.ts +0 -2
  40. package/dist/cli/src/builtin/core/object.d.ts +0 -2
  41. package/dist/cli/src/builtin/core/predicates.d.ts +0 -2
  42. package/dist/cli/src/builtin/core/regexp.d.ts +0 -2
  43. package/dist/cli/src/builtin/core/sequence.d.ts +0 -2
  44. package/dist/cli/src/builtin/core/string.d.ts +0 -2
  45. package/dist/cli/src/builtin/core/vector.d.ts +0 -2
  46. package/dist/cli/src/builtin/index.d.ts +0 -13
  47. package/dist/cli/src/builtin/interface.d.ts +0 -113
  48. package/dist/cli/src/builtin/modules/assertion/docs.d.ts +0 -2
  49. package/dist/cli/src/builtin/modules/assertion/index.d.ts +0 -2
  50. package/dist/cli/src/builtin/modules/bitwise/index.d.ts +0 -2
  51. package/dist/cli/src/builtin/modules/collection/index.d.ts +0 -2
  52. package/dist/cli/src/builtin/modules/convert/index.d.ts +0 -2
  53. package/dist/cli/src/builtin/modules/functional/index.d.ts +0 -2
  54. package/dist/cli/src/builtin/modules/grid/docs.d.ts +0 -2
  55. package/dist/cli/src/builtin/modules/grid/fromArray.d.ts +0 -8
  56. package/dist/cli/src/builtin/modules/grid/index.d.ts +0 -2
  57. package/dist/cli/src/builtin/modules/grid/transpose.d.ts +0 -2
  58. package/dist/cli/src/builtin/modules/interface.d.ts +0 -28
  59. package/dist/cli/src/builtin/modules/linear-algebra/docs.d.ts +0 -2
  60. package/dist/cli/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +0 -1
  61. package/dist/cli/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +0 -2
  62. package/dist/cli/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +0 -8
  63. package/dist/cli/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +0 -4
  64. package/dist/cli/src/builtin/modules/linear-algebra/helpers/dot.d.ts +0 -1
  65. package/dist/cli/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +0 -7
  66. package/dist/cli/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +0 -2
  67. package/dist/cli/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +0 -1
  68. package/dist/cli/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +0 -10
  69. package/dist/cli/src/builtin/modules/linear-algebra/helpers/length.d.ts +0 -1
  70. package/dist/cli/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +0 -1
  71. package/dist/cli/src/builtin/modules/linear-algebra/helpers/scale.d.ts +0 -1
  72. package/dist/cli/src/builtin/modules/linear-algebra/helpers/solve.d.ts +0 -8
  73. package/dist/cli/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +0 -1
  74. package/dist/cli/src/builtin/modules/linear-algebra/index.d.ts +0 -4
  75. package/dist/cli/src/builtin/modules/math/index.d.ts +0 -2
  76. package/dist/cli/src/builtin/modules/matrix/docs.d.ts +0 -2
  77. package/dist/cli/src/builtin/modules/matrix/helpers/adjugate.d.ts +0 -1
  78. package/dist/cli/src/builtin/modules/matrix/helpers/band.d.ts +0 -9
  79. package/dist/cli/src/builtin/modules/matrix/helpers/cofactor.d.ts +0 -1
  80. package/dist/cli/src/builtin/modules/matrix/helpers/determinant.d.ts +0 -6
  81. package/dist/cli/src/builtin/modules/matrix/helpers/inverse.d.ts +0 -6
  82. package/dist/cli/src/builtin/modules/matrix/helpers/isBanded.d.ts +0 -11
  83. package/dist/cli/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +0 -10
  84. package/dist/cli/src/builtin/modules/matrix/helpers/isIdentity.d.ts +0 -1
  85. package/dist/cli/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +0 -1
  86. package/dist/cli/src/builtin/modules/matrix/helpers/isSquare.d.ts +0 -1
  87. package/dist/cli/src/builtin/modules/matrix/helpers/isSymetric.d.ts +0 -8
  88. package/dist/cli/src/builtin/modules/matrix/helpers/isTriangular.d.ts +0 -13
  89. package/dist/cli/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +0 -7
  90. package/dist/cli/src/builtin/modules/matrix/helpers/minor.d.ts +0 -1
  91. package/dist/cli/src/builtin/modules/matrix/helpers/norm1.d.ts +0 -1
  92. package/dist/cli/src/builtin/modules/matrix/helpers/trace.d.ts +0 -8
  93. package/dist/cli/src/builtin/modules/matrix/index.d.ts +0 -4
  94. package/dist/cli/src/builtin/modules/number-theory/binomialCefficient.d.ts +0 -1
  95. package/dist/cli/src/builtin/modules/number-theory/combinations.d.ts +0 -2
  96. package/dist/cli/src/builtin/modules/number-theory/derangements.d.ts +0 -2
  97. package/dist/cli/src/builtin/modules/number-theory/divisors.d.ts +0 -4
  98. package/dist/cli/src/builtin/modules/number-theory/docs.d.ts +0 -2
  99. package/dist/cli/src/builtin/modules/number-theory/factorial.d.ts +0 -3
  100. package/dist/cli/src/builtin/modules/number-theory/index.d.ts +0 -4
  101. package/dist/cli/src/builtin/modules/number-theory/partitions.d.ts +0 -2
  102. package/dist/cli/src/builtin/modules/number-theory/permutations.d.ts +0 -2
  103. package/dist/cli/src/builtin/modules/number-theory/powerSet.d.ts +0 -2
  104. package/dist/cli/src/builtin/modules/number-theory/primeFactors.d.ts +0 -11
  105. package/dist/cli/src/builtin/modules/number-theory/sequences/abundant.d.ts +0 -2
  106. package/dist/cli/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +0 -2
  107. package/dist/cli/src/builtin/modules/number-theory/sequences/bell.d.ts +0 -1
  108. package/dist/cli/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +0 -2
  109. package/dist/cli/src/builtin/modules/number-theory/sequences/catalan.d.ts +0 -1
  110. package/dist/cli/src/builtin/modules/number-theory/sequences/collatz.d.ts +0 -2
  111. package/dist/cli/src/builtin/modules/number-theory/sequences/composite.d.ts +0 -3
  112. package/dist/cli/src/builtin/modules/number-theory/sequences/deficient.d.ts +0 -2
  113. package/dist/cli/src/builtin/modules/number-theory/sequences/factorial.d.ts +0 -1
  114. package/dist/cli/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +0 -1
  115. package/dist/cli/src/builtin/modules/number-theory/sequences/geometric.d.ts +0 -2
  116. package/dist/cli/src/builtin/modules/number-theory/sequences/golomb.d.ts +0 -2
  117. package/dist/cli/src/builtin/modules/number-theory/sequences/happy.d.ts +0 -2
  118. package/dist/cli/src/builtin/modules/number-theory/sequences/index.d.ts +0 -27
  119. package/dist/cli/src/builtin/modules/number-theory/sequences/juggler.d.ts +0 -2
  120. package/dist/cli/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +0 -2
  121. package/dist/cli/src/builtin/modules/number-theory/sequences/lucas.d.ts +0 -1
  122. package/dist/cli/src/builtin/modules/number-theory/sequences/lucky.d.ts +0 -2
  123. package/dist/cli/src/builtin/modules/number-theory/sequences/mersenne.d.ts +0 -1
  124. package/dist/cli/src/builtin/modules/number-theory/sequences/padovan.d.ts +0 -2
  125. package/dist/cli/src/builtin/modules/number-theory/sequences/partition.d.ts +0 -1
  126. package/dist/cli/src/builtin/modules/number-theory/sequences/pell.d.ts +0 -1
  127. package/dist/cli/src/builtin/modules/number-theory/sequences/perfect.d.ts +0 -1
  128. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +0 -2
  129. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +0 -10
  130. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +0 -2
  131. package/dist/cli/src/builtin/modules/number-theory/sequences/poligonal.d.ts +0 -2
  132. package/dist/cli/src/builtin/modules/number-theory/sequences/prime.d.ts +0 -3
  133. package/dist/cli/src/builtin/modules/number-theory/sequences/recaman.d.ts +0 -9
  134. package/dist/cli/src/builtin/modules/number-theory/sequences/sylvester.d.ts +0 -1
  135. package/dist/cli/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +0 -2
  136. package/dist/cli/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +0 -1
  137. package/dist/cli/src/builtin/modules/sequence/index.d.ts +0 -2
  138. package/dist/cli/src/builtin/modules/string/index.d.ts +0 -2
  139. package/dist/cli/src/builtin/modules/vector/bincount.d.ts +0 -9
  140. package/dist/cli/src/builtin/modules/vector/calcMad.d.ts +0 -1
  141. package/dist/cli/src/builtin/modules/vector/calcMean.d.ts +0 -1
  142. package/dist/cli/src/builtin/modules/vector/calcMedad.d.ts +0 -1
  143. package/dist/cli/src/builtin/modules/vector/calcMedian.d.ts +0 -1
  144. package/dist/cli/src/builtin/modules/vector/calcStdDev.d.ts +0 -2
  145. package/dist/cli/src/builtin/modules/vector/calcVariance.d.ts +0 -2
  146. package/dist/cli/src/builtin/modules/vector/docs.d.ts +0 -2
  147. package/dist/cli/src/builtin/modules/vector/entropy.d.ts +0 -8
  148. package/dist/cli/src/builtin/modules/vector/histogram.d.ts +0 -9
  149. package/dist/cli/src/builtin/modules/vector/index.d.ts +0 -2
  150. package/dist/cli/src/builtin/modules/vector/mode.d.ts +0 -6
  151. package/dist/cli/src/builtin/modules/vector/outliers.d.ts +0 -7
  152. package/dist/cli/src/builtin/modules/vector/percentile.d.ts +0 -7
  153. package/dist/cli/src/builtin/modules/vector/quartiles.d.ts +0 -1
  154. package/dist/cli/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +0 -2
  155. package/dist/cli/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +0 -2
  156. package/dist/cli/src/builtin/modules/vector/reductionFunctions/index.d.ts +0 -13
  157. package/dist/cli/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +0 -2
  158. package/dist/cli/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +0 -5
  159. package/dist/cli/src/builtin/modules/vector/reductionFunctions/mad.d.ts +0 -2
  160. package/dist/cli/src/builtin/modules/vector/reductionFunctions/mean.d.ts +0 -4
  161. package/dist/cli/src/builtin/modules/vector/reductionFunctions/medad.d.ts +0 -2
  162. package/dist/cli/src/builtin/modules/vector/reductionFunctions/median.d.ts +0 -2
  163. package/dist/cli/src/builtin/modules/vector/reductionFunctions/prod.d.ts +0 -2
  164. package/dist/cli/src/builtin/modules/vector/reductionFunctions/rms.d.ts +0 -2
  165. package/dist/cli/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +0 -3
  166. package/dist/cli/src/builtin/modules/vector/reductionFunctions/span.d.ts +0 -2
  167. package/dist/cli/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +0 -3
  168. package/dist/cli/src/builtin/modules/vector/reductionFunctions/sum.d.ts +0 -2
  169. package/dist/cli/src/builtin/modules/vector/reductionFunctions/variance.d.ts +0 -3
  170. package/dist/cli/src/builtin/normalExpressions/index.d.ts +0 -9
  171. package/dist/cli/src/builtin/normalExpressions/initCoreDvala.d.ts +0 -1
  172. package/dist/cli/src/builtin/specialExpressionTypes.d.ts +0 -24
  173. package/dist/cli/src/builtin/specialExpressions/and.d.ts +0 -6
  174. package/dist/cli/src/builtin/specialExpressions/array.d.ts +0 -6
  175. package/dist/cli/src/builtin/specialExpressions/block.d.ts +0 -7
  176. package/dist/cli/src/builtin/specialExpressions/cond.d.ts +0 -6
  177. package/dist/cli/src/builtin/specialExpressions/defined.d.ts +0 -5
  178. package/dist/cli/src/builtin/specialExpressions/effect.d.ts +0 -5
  179. package/dist/cli/src/builtin/specialExpressions/functions.d.ts +0 -6
  180. package/dist/cli/src/builtin/specialExpressions/if.d.ts +0 -6
  181. package/dist/cli/src/builtin/specialExpressions/import.d.ts +0 -6
  182. package/dist/cli/src/builtin/specialExpressions/let.d.ts +0 -6
  183. package/dist/cli/src/builtin/specialExpressions/loop.d.ts +0 -6
  184. package/dist/cli/src/builtin/specialExpressions/loops.d.ts +0 -9
  185. package/dist/cli/src/builtin/specialExpressions/match.d.ts +0 -7
  186. package/dist/cli/src/builtin/specialExpressions/object.d.ts +0 -6
  187. package/dist/cli/src/builtin/specialExpressions/or.d.ts +0 -6
  188. package/dist/cli/src/builtin/specialExpressions/parallel.d.ts +0 -6
  189. package/dist/cli/src/builtin/specialExpressions/perform.d.ts +0 -6
  190. package/dist/cli/src/builtin/specialExpressions/qq.d.ts +0 -6
  191. package/dist/cli/src/builtin/specialExpressions/race.d.ts +0 -6
  192. package/dist/cli/src/builtin/specialExpressions/recur.d.ts +0 -5
  193. package/dist/cli/src/builtin/specialExpressions/unless.d.ts +0 -6
  194. package/dist/cli/src/builtin/utils.d.ts +0 -6
  195. package/dist/cli/src/bundler/index.d.ts +0 -9
  196. package/dist/cli/src/bundler/interface.d.ts +0 -15
  197. package/dist/cli/src/bundler.d.ts +0 -3
  198. package/dist/cli/src/cli.d.ts +0 -2
  199. package/dist/cli/src/cliDocumentation/formatCliDescription.d.ts +0 -3
  200. package/dist/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +0 -3
  201. package/dist/cli/src/cliDocumentation/getCliDocumentation.d.ts +0 -2
  202. package/dist/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +0 -3
  203. package/dist/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +0 -3
  204. package/dist/cli/src/cliDocumentation/getCliTitle.d.ts +0 -3
  205. package/dist/cli/src/cliDocumentation/getCliType.d.ts +0 -3
  206. package/dist/cli/src/cliFormatterRules.d.ts +0 -13
  207. package/dist/cli/src/colorizer.d.ts +0 -939
  208. package/dist/cli/src/constants/constants.d.ts +0 -19
  209. package/dist/cli/src/createDvala.d.ts +0 -47
  210. package/dist/cli/src/createReadlineInterface.d.ts +0 -5
  211. package/dist/cli/src/errors.d.ts +0 -24
  212. package/dist/cli/src/evaluator/ContextStack.d.ts +0 -70
  213. package/dist/cli/src/evaluator/contentHash.d.ts +0 -21
  214. package/dist/cli/src/evaluator/dedupSubTrees.d.ts +0 -37
  215. package/dist/cli/src/evaluator/effectRef.d.ts +0 -27
  216. package/dist/cli/src/evaluator/effectTypes.d.ts +0 -199
  217. package/dist/cli/src/evaluator/frames.d.ts +0 -513
  218. package/dist/cli/src/evaluator/interface.d.ts +0 -14
  219. package/dist/cli/src/evaluator/standardEffects.d.ts +0 -50
  220. package/dist/cli/src/evaluator/step.d.ts +0 -175
  221. package/dist/cli/src/evaluator/suspension.d.ts +0 -92
  222. package/dist/cli/src/evaluator/trampoline.d.ts +0 -138
  223. package/dist/cli/src/getUndefinedSymbols/index.d.ts +0 -7
  224. package/dist/cli/src/initReferenceData.d.ts +0 -1
  225. package/dist/cli/src/interface.d.ts +0 -7
  226. package/dist/cli/src/js-interop/Cli/Fs/index.d.ts +0 -2
  227. package/dist/cli/src/js-interop/Cli/Proc/index.d.ts +0 -3
  228. package/dist/cli/src/js-interop/Cli/index.d.ts +0 -2
  229. package/dist/cli/src/parser/ParserContext.d.ts +0 -20
  230. package/dist/cli/src/parser/getPrecedence.d.ts +0 -3
  231. package/dist/cli/src/parser/helpers.d.ts +0 -19
  232. package/dist/cli/src/parser/index.d.ts +0 -5
  233. package/dist/cli/src/parser/subParsers/parseArray.d.ts +0 -3
  234. package/dist/cli/src/parser/subParsers/parseBindingTarget.d.ts +0 -8
  235. package/dist/cli/src/parser/subParsers/parseCond.d.ts +0 -4
  236. package/dist/cli/src/parser/subParsers/parseDo.d.ts +0 -3
  237. package/dist/cli/src/parser/subParsers/parseExpression.d.ts +0 -5
  238. package/dist/cli/src/parser/subParsers/parseForOrDoseq.d.ts +0 -4
  239. package/dist/cli/src/parser/subParsers/parseFunction.d.ts +0 -4
  240. package/dist/cli/src/parser/subParsers/parseFunctionCall.d.ts +0 -3
  241. package/dist/cli/src/parser/subParsers/parseIfOrUnless.d.ts +0 -5
  242. package/dist/cli/src/parser/subParsers/parseImplicitBlock.d.ts +0 -5
  243. package/dist/cli/src/parser/subParsers/parseLet.d.ts +0 -4
  244. package/dist/cli/src/parser/subParsers/parseLoop.d.ts +0 -4
  245. package/dist/cli/src/parser/subParsers/parseMatch.d.ts +0 -4
  246. package/dist/cli/src/parser/subParsers/parseNumber.d.ts +0 -3
  247. package/dist/cli/src/parser/subParsers/parseObject.d.ts +0 -3
  248. package/dist/cli/src/parser/subParsers/parseOperand.d.ts +0 -3
  249. package/dist/cli/src/parser/subParsers/parseRegexpShorthand.d.ts +0 -3
  250. package/dist/cli/src/parser/subParsers/parseReservedSymbol.d.ts +0 -3
  251. package/dist/cli/src/parser/subParsers/parseString.d.ts +0 -4
  252. package/dist/cli/src/parser/subParsers/parseSymbol.d.ts +0 -3
  253. package/dist/cli/src/parser/types.d.ts +0 -128
  254. package/dist/cli/src/symbolPatterns.d.ts +0 -2
  255. package/dist/cli/src/testFramework/index.d.ts +0 -15
  256. package/dist/cli/src/tokenizer/minifyTokenStream.d.ts +0 -4
  257. package/dist/cli/src/tokenizer/operators.d.ts +0 -12
  258. package/dist/cli/src/tokenizer/reservedNames.d.ts +0 -65
  259. package/dist/cli/src/tokenizer/token.d.ts +0 -82
  260. package/dist/cli/src/tokenizer/tokenize.d.ts +0 -7
  261. package/dist/cli/src/tokenizer/tokenizers.d.ts +0 -13
  262. package/dist/cli/src/tooling.d.ts +0 -51
  263. package/dist/cli/src/transformer/index.d.ts +0 -2
  264. package/dist/cli/src/typeGuards/annotatedCollections.d.ts +0 -16
  265. package/dist/cli/src/typeGuards/array.d.ts +0 -9
  266. package/dist/cli/src/typeGuards/astNode.d.ts +0 -19
  267. package/dist/cli/src/typeGuards/dvala.d.ts +0 -26
  268. package/dist/cli/src/typeGuards/dvalaFunction.d.ts +0 -9
  269. package/dist/cli/src/typeGuards/index.d.ts +0 -7
  270. package/dist/cli/src/typeGuards/number.d.ts +0 -66
  271. package/dist/cli/src/typeGuards/string.d.ts +0 -15
  272. package/dist/cli/src/untokenizer/index.d.ts +0 -2
  273. package/dist/cli/src/utils/arity.d.ts +0 -10
  274. package/dist/cli/src/utils/debug/debugTools.d.ts +0 -1
  275. package/dist/cli/src/utils/debug/getCodeMarker.d.ts +0 -2
  276. package/dist/cli/src/utils/debug/getSourceCodeInfo.d.ts +0 -2
  277. package/dist/cli/src/utils/docString/generateDocString.d.ts +0 -4
  278. package/dist/cli/src/utils/getAssertionError.d.ts +0 -3
  279. package/dist/cli/src/utils/index.d.ts +0 -14
  280. package/dist/cli/src/utils/maybePromise.d.ts +0 -54
  281. package/dist/cli/src/utils/symbols.d.ts +0 -3
  282. package/dist/common/createFormatter.d.ts +0 -6
  283. package/dist/common/utils.d.ts +0 -2
  284. package/dist/debug.esm.js +0 -2
  285. package/dist/debug.esm.js.map +0 -1
  286. package/dist/debug.js +0 -2
  287. package/dist/debug.js.map +0 -1
  288. package/dist/dvala.iife.js +0 -2
  289. package/dist/dvala.iife.js.map +0 -1
  290. package/dist/full.esm.js +0 -2
  291. package/dist/full.esm.js.map +0 -1
  292. package/dist/full.js +0 -2
  293. package/dist/full.js.map +0 -1
  294. package/dist/index.esm.js +0 -2
  295. package/dist/index.esm.js.map +0 -1
  296. package/dist/index.js +0 -2
  297. package/dist/index.js.map +0 -1
  298. package/dist/mcp-server/common/utils.d.ts +0 -2
  299. package/dist/mcp-server/mcp-server/src/server.d.ts +0 -1
  300. package/dist/mcp-server/reference/api.d.ts +0 -73
  301. package/dist/mcp-server/reference/datatype.d.ts +0 -3
  302. package/dist/mcp-server/reference/examples.d.ts +0 -11
  303. package/dist/mcp-server/reference/index.d.ts +0 -195
  304. package/dist/mcp-server/reference/shorthand.d.ts +0 -3
  305. package/dist/mcp-server/server.js +0 -36377
  306. package/dist/mcp-server/src/AutoCompleter/AutoCompleter.d.ts +0 -27
  307. package/dist/mcp-server/src/Cache.d.ts +0 -16
  308. package/dist/mcp-server/src/allModules.d.ts +0 -2
  309. package/dist/mcp-server/src/builtin/bindingNode.d.ts +0 -11
  310. package/dist/mcp-server/src/builtin/core/array.d.ts +0 -2
  311. package/dist/mcp-server/src/builtin/core/assertion.d.ts +0 -2
  312. package/dist/mcp-server/src/builtin/core/bitwise.d.ts +0 -2
  313. package/dist/mcp-server/src/builtin/core/collection.d.ts +0 -2
  314. package/dist/mcp-server/src/builtin/core/functional.d.ts +0 -2
  315. package/dist/mcp-server/src/builtin/core/math.d.ts +0 -2
  316. package/dist/mcp-server/src/builtin/core/meta.d.ts +0 -3
  317. package/dist/mcp-server/src/builtin/core/misc.d.ts +0 -2
  318. package/dist/mcp-server/src/builtin/core/object.d.ts +0 -2
  319. package/dist/mcp-server/src/builtin/core/predicates.d.ts +0 -2
  320. package/dist/mcp-server/src/builtin/core/regexp.d.ts +0 -2
  321. package/dist/mcp-server/src/builtin/core/sequence.d.ts +0 -2
  322. package/dist/mcp-server/src/builtin/core/string.d.ts +0 -2
  323. package/dist/mcp-server/src/builtin/core/vector.d.ts +0 -2
  324. package/dist/mcp-server/src/builtin/index.d.ts +0 -13
  325. package/dist/mcp-server/src/builtin/interface.d.ts +0 -113
  326. package/dist/mcp-server/src/builtin/modules/assertion/docs.d.ts +0 -2
  327. package/dist/mcp-server/src/builtin/modules/assertion/index.d.ts +0 -2
  328. package/dist/mcp-server/src/builtin/modules/bitwise/index.d.ts +0 -2
  329. package/dist/mcp-server/src/builtin/modules/collection/index.d.ts +0 -2
  330. package/dist/mcp-server/src/builtin/modules/convert/index.d.ts +0 -2
  331. package/dist/mcp-server/src/builtin/modules/functional/index.d.ts +0 -2
  332. package/dist/mcp-server/src/builtin/modules/grid/docs.d.ts +0 -2
  333. package/dist/mcp-server/src/builtin/modules/grid/fromArray.d.ts +0 -8
  334. package/dist/mcp-server/src/builtin/modules/grid/index.d.ts +0 -2
  335. package/dist/mcp-server/src/builtin/modules/grid/transpose.d.ts +0 -2
  336. package/dist/mcp-server/src/builtin/modules/interface.d.ts +0 -28
  337. package/dist/mcp-server/src/builtin/modules/linear-algebra/docs.d.ts +0 -2
  338. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +0 -1
  339. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +0 -2
  340. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +0 -8
  341. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +0 -4
  342. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/dot.d.ts +0 -1
  343. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +0 -7
  344. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +0 -2
  345. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +0 -1
  346. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +0 -10
  347. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/length.d.ts +0 -1
  348. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +0 -1
  349. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/scale.d.ts +0 -1
  350. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/solve.d.ts +0 -8
  351. package/dist/mcp-server/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +0 -1
  352. package/dist/mcp-server/src/builtin/modules/linear-algebra/index.d.ts +0 -4
  353. package/dist/mcp-server/src/builtin/modules/math/index.d.ts +0 -2
  354. package/dist/mcp-server/src/builtin/modules/matrix/docs.d.ts +0 -2
  355. package/dist/mcp-server/src/builtin/modules/matrix/helpers/adjugate.d.ts +0 -1
  356. package/dist/mcp-server/src/builtin/modules/matrix/helpers/band.d.ts +0 -9
  357. package/dist/mcp-server/src/builtin/modules/matrix/helpers/cofactor.d.ts +0 -1
  358. package/dist/mcp-server/src/builtin/modules/matrix/helpers/determinant.d.ts +0 -6
  359. package/dist/mcp-server/src/builtin/modules/matrix/helpers/inverse.d.ts +0 -6
  360. package/dist/mcp-server/src/builtin/modules/matrix/helpers/isBanded.d.ts +0 -11
  361. package/dist/mcp-server/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +0 -10
  362. package/dist/mcp-server/src/builtin/modules/matrix/helpers/isIdentity.d.ts +0 -1
  363. package/dist/mcp-server/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +0 -1
  364. package/dist/mcp-server/src/builtin/modules/matrix/helpers/isSquare.d.ts +0 -1
  365. package/dist/mcp-server/src/builtin/modules/matrix/helpers/isSymetric.d.ts +0 -8
  366. package/dist/mcp-server/src/builtin/modules/matrix/helpers/isTriangular.d.ts +0 -13
  367. package/dist/mcp-server/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +0 -7
  368. package/dist/mcp-server/src/builtin/modules/matrix/helpers/minor.d.ts +0 -1
  369. package/dist/mcp-server/src/builtin/modules/matrix/helpers/norm1.d.ts +0 -1
  370. package/dist/mcp-server/src/builtin/modules/matrix/helpers/trace.d.ts +0 -8
  371. package/dist/mcp-server/src/builtin/modules/matrix/index.d.ts +0 -4
  372. package/dist/mcp-server/src/builtin/modules/number-theory/binomialCefficient.d.ts +0 -1
  373. package/dist/mcp-server/src/builtin/modules/number-theory/combinations.d.ts +0 -2
  374. package/dist/mcp-server/src/builtin/modules/number-theory/derangements.d.ts +0 -2
  375. package/dist/mcp-server/src/builtin/modules/number-theory/divisors.d.ts +0 -4
  376. package/dist/mcp-server/src/builtin/modules/number-theory/docs.d.ts +0 -2
  377. package/dist/mcp-server/src/builtin/modules/number-theory/factorial.d.ts +0 -3
  378. package/dist/mcp-server/src/builtin/modules/number-theory/index.d.ts +0 -4
  379. package/dist/mcp-server/src/builtin/modules/number-theory/partitions.d.ts +0 -2
  380. package/dist/mcp-server/src/builtin/modules/number-theory/permutations.d.ts +0 -2
  381. package/dist/mcp-server/src/builtin/modules/number-theory/powerSet.d.ts +0 -2
  382. package/dist/mcp-server/src/builtin/modules/number-theory/primeFactors.d.ts +0 -11
  383. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/abundant.d.ts +0 -2
  384. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +0 -2
  385. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/bell.d.ts +0 -1
  386. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +0 -2
  387. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/catalan.d.ts +0 -1
  388. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/collatz.d.ts +0 -2
  389. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/composite.d.ts +0 -3
  390. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/deficient.d.ts +0 -2
  391. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/factorial.d.ts +0 -1
  392. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +0 -1
  393. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/geometric.d.ts +0 -2
  394. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/golomb.d.ts +0 -2
  395. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/happy.d.ts +0 -2
  396. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/index.d.ts +0 -27
  397. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/juggler.d.ts +0 -2
  398. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +0 -2
  399. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/lucas.d.ts +0 -1
  400. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/lucky.d.ts +0 -2
  401. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/mersenne.d.ts +0 -1
  402. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/padovan.d.ts +0 -2
  403. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/partition.d.ts +0 -1
  404. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/pell.d.ts +0 -1
  405. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/perfect.d.ts +0 -1
  406. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +0 -2
  407. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +0 -10
  408. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +0 -2
  409. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/poligonal.d.ts +0 -2
  410. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/prime.d.ts +0 -3
  411. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/recaman.d.ts +0 -9
  412. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/sylvester.d.ts +0 -1
  413. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +0 -2
  414. package/dist/mcp-server/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +0 -1
  415. package/dist/mcp-server/src/builtin/modules/sequence/index.d.ts +0 -2
  416. package/dist/mcp-server/src/builtin/modules/string/index.d.ts +0 -2
  417. package/dist/mcp-server/src/builtin/modules/vector/bincount.d.ts +0 -9
  418. package/dist/mcp-server/src/builtin/modules/vector/calcMad.d.ts +0 -1
  419. package/dist/mcp-server/src/builtin/modules/vector/calcMean.d.ts +0 -1
  420. package/dist/mcp-server/src/builtin/modules/vector/calcMedad.d.ts +0 -1
  421. package/dist/mcp-server/src/builtin/modules/vector/calcMedian.d.ts +0 -1
  422. package/dist/mcp-server/src/builtin/modules/vector/calcStdDev.d.ts +0 -2
  423. package/dist/mcp-server/src/builtin/modules/vector/calcVariance.d.ts +0 -2
  424. package/dist/mcp-server/src/builtin/modules/vector/docs.d.ts +0 -2
  425. package/dist/mcp-server/src/builtin/modules/vector/entropy.d.ts +0 -8
  426. package/dist/mcp-server/src/builtin/modules/vector/histogram.d.ts +0 -9
  427. package/dist/mcp-server/src/builtin/modules/vector/index.d.ts +0 -2
  428. package/dist/mcp-server/src/builtin/modules/vector/mode.d.ts +0 -6
  429. package/dist/mcp-server/src/builtin/modules/vector/outliers.d.ts +0 -7
  430. package/dist/mcp-server/src/builtin/modules/vector/percentile.d.ts +0 -7
  431. package/dist/mcp-server/src/builtin/modules/vector/quartiles.d.ts +0 -1
  432. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +0 -2
  433. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +0 -2
  434. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/index.d.ts +0 -13
  435. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +0 -2
  436. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +0 -5
  437. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/mad.d.ts +0 -2
  438. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/mean.d.ts +0 -4
  439. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/medad.d.ts +0 -2
  440. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/median.d.ts +0 -2
  441. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/prod.d.ts +0 -2
  442. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/rms.d.ts +0 -2
  443. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +0 -3
  444. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/span.d.ts +0 -2
  445. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +0 -3
  446. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/sum.d.ts +0 -2
  447. package/dist/mcp-server/src/builtin/modules/vector/reductionFunctions/variance.d.ts +0 -3
  448. package/dist/mcp-server/src/builtin/normalExpressions/index.d.ts +0 -9
  449. package/dist/mcp-server/src/builtin/normalExpressions/initCoreDvala.d.ts +0 -1
  450. package/dist/mcp-server/src/builtin/specialExpressionTypes.d.ts +0 -24
  451. package/dist/mcp-server/src/builtin/specialExpressions/and.d.ts +0 -6
  452. package/dist/mcp-server/src/builtin/specialExpressions/array.d.ts +0 -6
  453. package/dist/mcp-server/src/builtin/specialExpressions/block.d.ts +0 -7
  454. package/dist/mcp-server/src/builtin/specialExpressions/cond.d.ts +0 -6
  455. package/dist/mcp-server/src/builtin/specialExpressions/defined.d.ts +0 -5
  456. package/dist/mcp-server/src/builtin/specialExpressions/effect.d.ts +0 -5
  457. package/dist/mcp-server/src/builtin/specialExpressions/functions.d.ts +0 -6
  458. package/dist/mcp-server/src/builtin/specialExpressions/if.d.ts +0 -6
  459. package/dist/mcp-server/src/builtin/specialExpressions/import.d.ts +0 -6
  460. package/dist/mcp-server/src/builtin/specialExpressions/let.d.ts +0 -6
  461. package/dist/mcp-server/src/builtin/specialExpressions/loop.d.ts +0 -6
  462. package/dist/mcp-server/src/builtin/specialExpressions/loops.d.ts +0 -9
  463. package/dist/mcp-server/src/builtin/specialExpressions/match.d.ts +0 -7
  464. package/dist/mcp-server/src/builtin/specialExpressions/object.d.ts +0 -6
  465. package/dist/mcp-server/src/builtin/specialExpressions/or.d.ts +0 -6
  466. package/dist/mcp-server/src/builtin/specialExpressions/parallel.d.ts +0 -6
  467. package/dist/mcp-server/src/builtin/specialExpressions/perform.d.ts +0 -6
  468. package/dist/mcp-server/src/builtin/specialExpressions/qq.d.ts +0 -6
  469. package/dist/mcp-server/src/builtin/specialExpressions/race.d.ts +0 -6
  470. package/dist/mcp-server/src/builtin/specialExpressions/recur.d.ts +0 -5
  471. package/dist/mcp-server/src/builtin/specialExpressions/unless.d.ts +0 -6
  472. package/dist/mcp-server/src/builtin/utils.d.ts +0 -6
  473. package/dist/mcp-server/src/bundler/interface.d.ts +0 -15
  474. package/dist/mcp-server/src/constants/constants.d.ts +0 -19
  475. package/dist/mcp-server/src/createDvala.d.ts +0 -47
  476. package/dist/mcp-server/src/errors.d.ts +0 -24
  477. package/dist/mcp-server/src/evaluator/ContextStack.d.ts +0 -70
  478. package/dist/mcp-server/src/evaluator/contentHash.d.ts +0 -21
  479. package/dist/mcp-server/src/evaluator/dedupSubTrees.d.ts +0 -37
  480. package/dist/mcp-server/src/evaluator/effectRef.d.ts +0 -27
  481. package/dist/mcp-server/src/evaluator/effectTypes.d.ts +0 -199
  482. package/dist/mcp-server/src/evaluator/frames.d.ts +0 -513
  483. package/dist/mcp-server/src/evaluator/interface.d.ts +0 -14
  484. package/dist/mcp-server/src/evaluator/standardEffects.d.ts +0 -50
  485. package/dist/mcp-server/src/evaluator/step.d.ts +0 -175
  486. package/dist/mcp-server/src/evaluator/suspension.d.ts +0 -92
  487. package/dist/mcp-server/src/evaluator/trampoline.d.ts +0 -138
  488. package/dist/mcp-server/src/getUndefinedSymbols/index.d.ts +0 -7
  489. package/dist/mcp-server/src/initReferenceData.d.ts +0 -1
  490. package/dist/mcp-server/src/interface.d.ts +0 -7
  491. package/dist/mcp-server/src/parser/ParserContext.d.ts +0 -20
  492. package/dist/mcp-server/src/parser/getPrecedence.d.ts +0 -3
  493. package/dist/mcp-server/src/parser/helpers.d.ts +0 -19
  494. package/dist/mcp-server/src/parser/index.d.ts +0 -5
  495. package/dist/mcp-server/src/parser/subParsers/parseArray.d.ts +0 -3
  496. package/dist/mcp-server/src/parser/subParsers/parseBindingTarget.d.ts +0 -8
  497. package/dist/mcp-server/src/parser/subParsers/parseCond.d.ts +0 -4
  498. package/dist/mcp-server/src/parser/subParsers/parseDo.d.ts +0 -3
  499. package/dist/mcp-server/src/parser/subParsers/parseExpression.d.ts +0 -5
  500. package/dist/mcp-server/src/parser/subParsers/parseForOrDoseq.d.ts +0 -4
  501. package/dist/mcp-server/src/parser/subParsers/parseFunction.d.ts +0 -4
  502. package/dist/mcp-server/src/parser/subParsers/parseFunctionCall.d.ts +0 -3
  503. package/dist/mcp-server/src/parser/subParsers/parseIfOrUnless.d.ts +0 -5
  504. package/dist/mcp-server/src/parser/subParsers/parseImplicitBlock.d.ts +0 -5
  505. package/dist/mcp-server/src/parser/subParsers/parseLet.d.ts +0 -4
  506. package/dist/mcp-server/src/parser/subParsers/parseLoop.d.ts +0 -4
  507. package/dist/mcp-server/src/parser/subParsers/parseMatch.d.ts +0 -4
  508. package/dist/mcp-server/src/parser/subParsers/parseNumber.d.ts +0 -3
  509. package/dist/mcp-server/src/parser/subParsers/parseObject.d.ts +0 -3
  510. package/dist/mcp-server/src/parser/subParsers/parseOperand.d.ts +0 -3
  511. package/dist/mcp-server/src/parser/subParsers/parseRegexpShorthand.d.ts +0 -3
  512. package/dist/mcp-server/src/parser/subParsers/parseReservedSymbol.d.ts +0 -3
  513. package/dist/mcp-server/src/parser/subParsers/parseString.d.ts +0 -4
  514. package/dist/mcp-server/src/parser/subParsers/parseSymbol.d.ts +0 -3
  515. package/dist/mcp-server/src/parser/types.d.ts +0 -128
  516. package/dist/mcp-server/src/tokenizer/minifyTokenStream.d.ts +0 -4
  517. package/dist/mcp-server/src/tokenizer/operators.d.ts +0 -12
  518. package/dist/mcp-server/src/tokenizer/reservedNames.d.ts +0 -65
  519. package/dist/mcp-server/src/tokenizer/token.d.ts +0 -82
  520. package/dist/mcp-server/src/tokenizer/tokenize.d.ts +0 -7
  521. package/dist/mcp-server/src/tokenizer/tokenizers.d.ts +0 -13
  522. package/dist/mcp-server/src/tooling.d.ts +0 -51
  523. package/dist/mcp-server/src/transformer/index.d.ts +0 -2
  524. package/dist/mcp-server/src/typeGuards/annotatedCollections.d.ts +0 -16
  525. package/dist/mcp-server/src/typeGuards/array.d.ts +0 -9
  526. package/dist/mcp-server/src/typeGuards/astNode.d.ts +0 -19
  527. package/dist/mcp-server/src/typeGuards/dvala.d.ts +0 -26
  528. package/dist/mcp-server/src/typeGuards/dvalaFunction.d.ts +0 -9
  529. package/dist/mcp-server/src/typeGuards/index.d.ts +0 -7
  530. package/dist/mcp-server/src/typeGuards/number.d.ts +0 -66
  531. package/dist/mcp-server/src/typeGuards/string.d.ts +0 -15
  532. package/dist/mcp-server/src/untokenizer/index.d.ts +0 -2
  533. package/dist/mcp-server/src/utils/arity.d.ts +0 -10
  534. package/dist/mcp-server/src/utils/debug/debugTools.d.ts +0 -1
  535. package/dist/mcp-server/src/utils/debug/getCodeMarker.d.ts +0 -2
  536. package/dist/mcp-server/src/utils/debug/getSourceCodeInfo.d.ts +0 -2
  537. package/dist/mcp-server/src/utils/docString/generateDocString.d.ts +0 -4
  538. package/dist/mcp-server/src/utils/getAssertionError.d.ts +0 -3
  539. package/dist/mcp-server/src/utils/index.d.ts +0 -14
  540. package/dist/mcp-server/src/utils/maybePromise.d.ts +0 -54
  541. package/dist/mcp-server/src/utils/symbols.d.ts +0 -3
  542. package/dist/modules/assertion.esm.js +0 -2
  543. package/dist/modules/assertion.esm.js.map +0 -1
  544. package/dist/modules/assertion.js +0 -2
  545. package/dist/modules/assertion.js.map +0 -1
  546. package/dist/modules/bitwise.esm.js +0 -2
  547. package/dist/modules/bitwise.esm.js.map +0 -1
  548. package/dist/modules/bitwise.js +0 -2
  549. package/dist/modules/bitwise.js.map +0 -1
  550. package/dist/modules/cli/src/cli.d.ts +0 -2
  551. package/dist/modules/cli/src/cliDocumentation/formatCliDescription.d.ts +0 -3
  552. package/dist/modules/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +0 -3
  553. package/dist/modules/cli/src/cliDocumentation/getCliDocumentation.d.ts +0 -2
  554. package/dist/modules/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +0 -3
  555. package/dist/modules/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +0 -3
  556. package/dist/modules/cli/src/cliDocumentation/getCliTitle.d.ts +0 -3
  557. package/dist/modules/cli/src/cliDocumentation/getCliType.d.ts +0 -3
  558. package/dist/modules/cli/src/cliFormatterRules.d.ts +0 -13
  559. package/dist/modules/cli/src/colorizer.d.ts +0 -939
  560. package/dist/modules/cli/src/createReadlineInterface.d.ts +0 -5
  561. package/dist/modules/cli/src/js-interop/Cli/Fs/index.d.ts +0 -2
  562. package/dist/modules/cli/src/js-interop/Cli/Proc/index.d.ts +0 -3
  563. package/dist/modules/cli/src/js-interop/Cli/index.d.ts +0 -2
  564. package/dist/modules/collection.esm.js +0 -2
  565. package/dist/modules/collection.esm.js.map +0 -1
  566. package/dist/modules/collection.js +0 -2
  567. package/dist/modules/collection.js.map +0 -1
  568. package/dist/modules/common/createFormatter.d.ts +0 -6
  569. package/dist/modules/common/utils.d.ts +0 -2
  570. package/dist/modules/convert.esm.js +0 -2
  571. package/dist/modules/convert.esm.js.map +0 -1
  572. package/dist/modules/convert.js +0 -2
  573. package/dist/modules/convert.js.map +0 -1
  574. package/dist/modules/functional.esm.js +0 -2
  575. package/dist/modules/functional.esm.js.map +0 -1
  576. package/dist/modules/functional.js +0 -2
  577. package/dist/modules/functional.js.map +0 -1
  578. package/dist/modules/grid.esm.js +0 -2
  579. package/dist/modules/grid.esm.js.map +0 -1
  580. package/dist/modules/grid.js +0 -2
  581. package/dist/modules/grid.js.map +0 -1
  582. package/dist/modules/linear-algebra.esm.js +0 -2
  583. package/dist/modules/linear-algebra.esm.js.map +0 -1
  584. package/dist/modules/linear-algebra.js +0 -2
  585. package/dist/modules/linear-algebra.js.map +0 -1
  586. package/dist/modules/math.esm.js +0 -2
  587. package/dist/modules/math.esm.js.map +0 -1
  588. package/dist/modules/math.js +0 -2
  589. package/dist/modules/math.js.map +0 -1
  590. package/dist/modules/matrix.esm.js +0 -2
  591. package/dist/modules/matrix.esm.js.map +0 -1
  592. package/dist/modules/matrix.js +0 -2
  593. package/dist/modules/matrix.js.map +0 -1
  594. package/dist/modules/number-theory.esm.js +0 -2
  595. package/dist/modules/number-theory.esm.js.map +0 -1
  596. package/dist/modules/number-theory.js +0 -2
  597. package/dist/modules/number-theory.js.map +0 -1
  598. package/dist/modules/reference/api.d.ts +0 -73
  599. package/dist/modules/reference/datatype.d.ts +0 -3
  600. package/dist/modules/reference/index.d.ts +0 -195
  601. package/dist/modules/reference/shorthand.d.ts +0 -3
  602. package/dist/modules/sequence.esm.js +0 -2
  603. package/dist/modules/sequence.esm.js.map +0 -1
  604. package/dist/modules/sequence.js +0 -2
  605. package/dist/modules/sequence.js.map +0 -1
  606. package/dist/modules/src/AutoCompleter/AutoCompleter.d.ts +0 -27
  607. package/dist/modules/src/Cache.d.ts +0 -16
  608. package/dist/modules/src/allModules.d.ts +0 -2
  609. package/dist/modules/src/builtin/bindingNode.d.ts +0 -11
  610. package/dist/modules/src/builtin/core/array.d.ts +0 -2
  611. package/dist/modules/src/builtin/core/assertion.d.ts +0 -2
  612. package/dist/modules/src/builtin/core/bitwise.d.ts +0 -2
  613. package/dist/modules/src/builtin/core/collection.d.ts +0 -2
  614. package/dist/modules/src/builtin/core/functional.d.ts +0 -2
  615. package/dist/modules/src/builtin/core/math.d.ts +0 -2
  616. package/dist/modules/src/builtin/core/meta.d.ts +0 -3
  617. package/dist/modules/src/builtin/core/misc.d.ts +0 -2
  618. package/dist/modules/src/builtin/core/object.d.ts +0 -2
  619. package/dist/modules/src/builtin/core/predicates.d.ts +0 -2
  620. package/dist/modules/src/builtin/core/regexp.d.ts +0 -2
  621. package/dist/modules/src/builtin/core/sequence.d.ts +0 -2
  622. package/dist/modules/src/builtin/core/string.d.ts +0 -2
  623. package/dist/modules/src/builtin/core/vector.d.ts +0 -2
  624. package/dist/modules/src/builtin/index.d.ts +0 -13
  625. package/dist/modules/src/builtin/interface.d.ts +0 -113
  626. package/dist/modules/src/builtin/modules/assertion/docs.d.ts +0 -2
  627. package/dist/modules/src/builtin/modules/assertion/index.d.ts +0 -2
  628. package/dist/modules/src/builtin/modules/bitwise/index.d.ts +0 -2
  629. package/dist/modules/src/builtin/modules/collection/index.d.ts +0 -2
  630. package/dist/modules/src/builtin/modules/convert/index.d.ts +0 -2
  631. package/dist/modules/src/builtin/modules/functional/index.d.ts +0 -2
  632. package/dist/modules/src/builtin/modules/grid/docs.d.ts +0 -2
  633. package/dist/modules/src/builtin/modules/grid/fromArray.d.ts +0 -8
  634. package/dist/modules/src/builtin/modules/grid/index.d.ts +0 -2
  635. package/dist/modules/src/builtin/modules/grid/transpose.d.ts +0 -2
  636. package/dist/modules/src/builtin/modules/interface.d.ts +0 -28
  637. package/dist/modules/src/builtin/modules/linear-algebra/docs.d.ts +0 -2
  638. package/dist/modules/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +0 -1
  639. package/dist/modules/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +0 -2
  640. package/dist/modules/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +0 -8
  641. package/dist/modules/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +0 -4
  642. package/dist/modules/src/builtin/modules/linear-algebra/helpers/dot.d.ts +0 -1
  643. package/dist/modules/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +0 -7
  644. package/dist/modules/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +0 -2
  645. package/dist/modules/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +0 -1
  646. package/dist/modules/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +0 -10
  647. package/dist/modules/src/builtin/modules/linear-algebra/helpers/length.d.ts +0 -1
  648. package/dist/modules/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +0 -1
  649. package/dist/modules/src/builtin/modules/linear-algebra/helpers/scale.d.ts +0 -1
  650. package/dist/modules/src/builtin/modules/linear-algebra/helpers/solve.d.ts +0 -8
  651. package/dist/modules/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +0 -1
  652. package/dist/modules/src/builtin/modules/linear-algebra/index.d.ts +0 -4
  653. package/dist/modules/src/builtin/modules/math/index.d.ts +0 -2
  654. package/dist/modules/src/builtin/modules/matrix/docs.d.ts +0 -2
  655. package/dist/modules/src/builtin/modules/matrix/helpers/adjugate.d.ts +0 -1
  656. package/dist/modules/src/builtin/modules/matrix/helpers/band.d.ts +0 -9
  657. package/dist/modules/src/builtin/modules/matrix/helpers/cofactor.d.ts +0 -1
  658. package/dist/modules/src/builtin/modules/matrix/helpers/determinant.d.ts +0 -6
  659. package/dist/modules/src/builtin/modules/matrix/helpers/diagonal.d.ts +0 -1
  660. package/dist/modules/src/builtin/modules/matrix/helpers/inverse.d.ts +0 -6
  661. package/dist/modules/src/builtin/modules/matrix/helpers/isBanded.d.ts +0 -11
  662. package/dist/modules/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +0 -10
  663. package/dist/modules/src/builtin/modules/matrix/helpers/isIdentity.d.ts +0 -1
  664. package/dist/modules/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +0 -1
  665. package/dist/modules/src/builtin/modules/matrix/helpers/isSquare.d.ts +0 -1
  666. package/dist/modules/src/builtin/modules/matrix/helpers/isSymetric.d.ts +0 -8
  667. package/dist/modules/src/builtin/modules/matrix/helpers/isTriangular.d.ts +0 -13
  668. package/dist/modules/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +0 -7
  669. package/dist/modules/src/builtin/modules/matrix/helpers/minor.d.ts +0 -1
  670. package/dist/modules/src/builtin/modules/matrix/helpers/norm1.d.ts +0 -1
  671. package/dist/modules/src/builtin/modules/matrix/helpers/trace.d.ts +0 -8
  672. package/dist/modules/src/builtin/modules/matrix/index.d.ts +0 -4
  673. package/dist/modules/src/builtin/modules/number-theory/binomialCefficient.d.ts +0 -1
  674. package/dist/modules/src/builtin/modules/number-theory/combinations.d.ts +0 -2
  675. package/dist/modules/src/builtin/modules/number-theory/derangements.d.ts +0 -2
  676. package/dist/modules/src/builtin/modules/number-theory/divisors.d.ts +0 -4
  677. package/dist/modules/src/builtin/modules/number-theory/docs.d.ts +0 -2
  678. package/dist/modules/src/builtin/modules/number-theory/factorial.d.ts +0 -3
  679. package/dist/modules/src/builtin/modules/number-theory/index.d.ts +0 -4
  680. package/dist/modules/src/builtin/modules/number-theory/partitions.d.ts +0 -2
  681. package/dist/modules/src/builtin/modules/number-theory/permutations.d.ts +0 -2
  682. package/dist/modules/src/builtin/modules/number-theory/powerSet.d.ts +0 -2
  683. package/dist/modules/src/builtin/modules/number-theory/primeFactors.d.ts +0 -11
  684. package/dist/modules/src/builtin/modules/number-theory/sequences/abundant.d.ts +0 -2
  685. package/dist/modules/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +0 -2
  686. package/dist/modules/src/builtin/modules/number-theory/sequences/bell.d.ts +0 -1
  687. package/dist/modules/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +0 -2
  688. package/dist/modules/src/builtin/modules/number-theory/sequences/catalan.d.ts +0 -1
  689. package/dist/modules/src/builtin/modules/number-theory/sequences/collatz.d.ts +0 -2
  690. package/dist/modules/src/builtin/modules/number-theory/sequences/composite.d.ts +0 -3
  691. package/dist/modules/src/builtin/modules/number-theory/sequences/deficient.d.ts +0 -2
  692. package/dist/modules/src/builtin/modules/number-theory/sequences/factorial.d.ts +0 -1
  693. package/dist/modules/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +0 -1
  694. package/dist/modules/src/builtin/modules/number-theory/sequences/geometric.d.ts +0 -2
  695. package/dist/modules/src/builtin/modules/number-theory/sequences/golomb.d.ts +0 -2
  696. package/dist/modules/src/builtin/modules/number-theory/sequences/happy.d.ts +0 -2
  697. package/dist/modules/src/builtin/modules/number-theory/sequences/index.d.ts +0 -27
  698. package/dist/modules/src/builtin/modules/number-theory/sequences/juggler.d.ts +0 -2
  699. package/dist/modules/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +0 -2
  700. package/dist/modules/src/builtin/modules/number-theory/sequences/lucas.d.ts +0 -1
  701. package/dist/modules/src/builtin/modules/number-theory/sequences/lucky.d.ts +0 -2
  702. package/dist/modules/src/builtin/modules/number-theory/sequences/mersenne.d.ts +0 -1
  703. package/dist/modules/src/builtin/modules/number-theory/sequences/padovan.d.ts +0 -2
  704. package/dist/modules/src/builtin/modules/number-theory/sequences/partition.d.ts +0 -1
  705. package/dist/modules/src/builtin/modules/number-theory/sequences/pell.d.ts +0 -1
  706. package/dist/modules/src/builtin/modules/number-theory/sequences/perfect.d.ts +0 -1
  707. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +0 -2
  708. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +0 -10
  709. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +0 -2
  710. package/dist/modules/src/builtin/modules/number-theory/sequences/poligonal.d.ts +0 -2
  711. package/dist/modules/src/builtin/modules/number-theory/sequences/prime.d.ts +0 -3
  712. package/dist/modules/src/builtin/modules/number-theory/sequences/recaman.d.ts +0 -9
  713. package/dist/modules/src/builtin/modules/number-theory/sequences/sylvester.d.ts +0 -1
  714. package/dist/modules/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +0 -2
  715. package/dist/modules/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +0 -1
  716. package/dist/modules/src/builtin/modules/sequence/index.d.ts +0 -2
  717. package/dist/modules/src/builtin/modules/string/index.d.ts +0 -2
  718. package/dist/modules/src/builtin/modules/vector/bincount.d.ts +0 -9
  719. package/dist/modules/src/builtin/modules/vector/calcMad.d.ts +0 -1
  720. package/dist/modules/src/builtin/modules/vector/calcMean.d.ts +0 -1
  721. package/dist/modules/src/builtin/modules/vector/calcMedad.d.ts +0 -1
  722. package/dist/modules/src/builtin/modules/vector/calcMedian.d.ts +0 -1
  723. package/dist/modules/src/builtin/modules/vector/calcStdDev.d.ts +0 -2
  724. package/dist/modules/src/builtin/modules/vector/calcVariance.d.ts +0 -2
  725. package/dist/modules/src/builtin/modules/vector/docs.d.ts +0 -2
  726. package/dist/modules/src/builtin/modules/vector/entropy.d.ts +0 -8
  727. package/dist/modules/src/builtin/modules/vector/histogram.d.ts +0 -9
  728. package/dist/modules/src/builtin/modules/vector/index.d.ts +0 -2
  729. package/dist/modules/src/builtin/modules/vector/mode.d.ts +0 -6
  730. package/dist/modules/src/builtin/modules/vector/outliers.d.ts +0 -7
  731. package/dist/modules/src/builtin/modules/vector/percentile.d.ts +0 -7
  732. package/dist/modules/src/builtin/modules/vector/quartiles.d.ts +0 -1
  733. package/dist/modules/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +0 -2
  734. package/dist/modules/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +0 -2
  735. package/dist/modules/src/builtin/modules/vector/reductionFunctions/index.d.ts +0 -13
  736. package/dist/modules/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +0 -2
  737. package/dist/modules/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +0 -5
  738. package/dist/modules/src/builtin/modules/vector/reductionFunctions/mad.d.ts +0 -2
  739. package/dist/modules/src/builtin/modules/vector/reductionFunctions/mean.d.ts +0 -4
  740. package/dist/modules/src/builtin/modules/vector/reductionFunctions/medad.d.ts +0 -2
  741. package/dist/modules/src/builtin/modules/vector/reductionFunctions/median.d.ts +0 -2
  742. package/dist/modules/src/builtin/modules/vector/reductionFunctions/prod.d.ts +0 -2
  743. package/dist/modules/src/builtin/modules/vector/reductionFunctions/rms.d.ts +0 -2
  744. package/dist/modules/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +0 -3
  745. package/dist/modules/src/builtin/modules/vector/reductionFunctions/span.d.ts +0 -2
  746. package/dist/modules/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +0 -3
  747. package/dist/modules/src/builtin/modules/vector/reductionFunctions/sum.d.ts +0 -2
  748. package/dist/modules/src/builtin/modules/vector/reductionFunctions/variance.d.ts +0 -3
  749. package/dist/modules/src/builtin/normalExpressions/index.d.ts +0 -9
  750. package/dist/modules/src/builtin/normalExpressions/initCoreDvala.d.ts +0 -1
  751. package/dist/modules/src/builtin/specialExpressionTypes.d.ts +0 -24
  752. package/dist/modules/src/builtin/specialExpressions/and.d.ts +0 -6
  753. package/dist/modules/src/builtin/specialExpressions/array.d.ts +0 -6
  754. package/dist/modules/src/builtin/specialExpressions/block.d.ts +0 -7
  755. package/dist/modules/src/builtin/specialExpressions/cond.d.ts +0 -6
  756. package/dist/modules/src/builtin/specialExpressions/defined.d.ts +0 -5
  757. package/dist/modules/src/builtin/specialExpressions/effect.d.ts +0 -5
  758. package/dist/modules/src/builtin/specialExpressions/functions.d.ts +0 -6
  759. package/dist/modules/src/builtin/specialExpressions/if.d.ts +0 -6
  760. package/dist/modules/src/builtin/specialExpressions/import.d.ts +0 -6
  761. package/dist/modules/src/builtin/specialExpressions/let.d.ts +0 -6
  762. package/dist/modules/src/builtin/specialExpressions/loop.d.ts +0 -6
  763. package/dist/modules/src/builtin/specialExpressions/loops.d.ts +0 -9
  764. package/dist/modules/src/builtin/specialExpressions/match.d.ts +0 -7
  765. package/dist/modules/src/builtin/specialExpressions/object.d.ts +0 -6
  766. package/dist/modules/src/builtin/specialExpressions/or.d.ts +0 -6
  767. package/dist/modules/src/builtin/specialExpressions/parallel.d.ts +0 -6
  768. package/dist/modules/src/builtin/specialExpressions/perform.d.ts +0 -6
  769. package/dist/modules/src/builtin/specialExpressions/qq.d.ts +0 -6
  770. package/dist/modules/src/builtin/specialExpressions/race.d.ts +0 -6
  771. package/dist/modules/src/builtin/specialExpressions/recur.d.ts +0 -5
  772. package/dist/modules/src/builtin/specialExpressions/unless.d.ts +0 -6
  773. package/dist/modules/src/builtin/utils.d.ts +0 -6
  774. package/dist/modules/src/bundler/index.d.ts +0 -9
  775. package/dist/modules/src/bundler/interface.d.ts +0 -15
  776. package/dist/modules/src/bundler.d.ts +0 -3
  777. package/dist/modules/src/constants/constants.d.ts +0 -19
  778. package/dist/modules/src/createDvala.d.ts +0 -47
  779. package/dist/modules/src/debug.d.ts +0 -115
  780. package/dist/modules/src/errors.d.ts +0 -24
  781. package/dist/modules/src/evaluator/ContextStack.d.ts +0 -70
  782. package/dist/modules/src/evaluator/contentHash.d.ts +0 -21
  783. package/dist/modules/src/evaluator/dedupSubTrees.d.ts +0 -37
  784. package/dist/modules/src/evaluator/effectRef.d.ts +0 -27
  785. package/dist/modules/src/evaluator/effectTypes.d.ts +0 -199
  786. package/dist/modules/src/evaluator/frames.d.ts +0 -513
  787. package/dist/modules/src/evaluator/interface.d.ts +0 -14
  788. package/dist/modules/src/evaluator/serialization.d.ts +0 -38
  789. package/dist/modules/src/evaluator/standardEffects.d.ts +0 -50
  790. package/dist/modules/src/evaluator/step.d.ts +0 -175
  791. package/dist/modules/src/evaluator/suspension.d.ts +0 -92
  792. package/dist/modules/src/evaluator/trampoline.d.ts +0 -138
  793. package/dist/modules/src/full.d.ts +0 -16
  794. package/dist/modules/src/getUndefinedSymbols/index.d.ts +0 -7
  795. package/dist/modules/src/index.d.ts +0 -23
  796. package/dist/modules/src/initReferenceData.d.ts +0 -1
  797. package/dist/modules/src/interface.d.ts +0 -7
  798. package/dist/modules/src/modules/assertion.d.ts +0 -2
  799. package/dist/modules/src/modules/bitwise.d.ts +0 -2
  800. package/dist/modules/src/modules/collection.d.ts +0 -2
  801. package/dist/modules/src/modules/convert.d.ts +0 -2
  802. package/dist/modules/src/modules/functional.d.ts +0 -2
  803. package/dist/modules/src/modules/grid.d.ts +0 -2
  804. package/dist/modules/src/modules/linear-algebra.d.ts +0 -2
  805. package/dist/modules/src/modules/math.d.ts +0 -2
  806. package/dist/modules/src/modules/matrix.d.ts +0 -2
  807. package/dist/modules/src/modules/number-theory.d.ts +0 -2
  808. package/dist/modules/src/modules/sequence.d.ts +0 -2
  809. package/dist/modules/src/modules/string.d.ts +0 -2
  810. package/dist/modules/src/modules/vector.d.ts +0 -2
  811. package/dist/modules/src/parser/ParserContext.d.ts +0 -20
  812. package/dist/modules/src/parser/getPrecedence.d.ts +0 -3
  813. package/dist/modules/src/parser/helpers.d.ts +0 -19
  814. package/dist/modules/src/parser/index.d.ts +0 -5
  815. package/dist/modules/src/parser/subParsers/parseArray.d.ts +0 -3
  816. package/dist/modules/src/parser/subParsers/parseBindingTarget.d.ts +0 -8
  817. package/dist/modules/src/parser/subParsers/parseCond.d.ts +0 -4
  818. package/dist/modules/src/parser/subParsers/parseDo.d.ts +0 -3
  819. package/dist/modules/src/parser/subParsers/parseExpression.d.ts +0 -5
  820. package/dist/modules/src/parser/subParsers/parseForOrDoseq.d.ts +0 -4
  821. package/dist/modules/src/parser/subParsers/parseFunction.d.ts +0 -4
  822. package/dist/modules/src/parser/subParsers/parseFunctionCall.d.ts +0 -3
  823. package/dist/modules/src/parser/subParsers/parseIfOrUnless.d.ts +0 -5
  824. package/dist/modules/src/parser/subParsers/parseImplicitBlock.d.ts +0 -5
  825. package/dist/modules/src/parser/subParsers/parseLet.d.ts +0 -4
  826. package/dist/modules/src/parser/subParsers/parseLoop.d.ts +0 -4
  827. package/dist/modules/src/parser/subParsers/parseMatch.d.ts +0 -4
  828. package/dist/modules/src/parser/subParsers/parseNumber.d.ts +0 -3
  829. package/dist/modules/src/parser/subParsers/parseObject.d.ts +0 -3
  830. package/dist/modules/src/parser/subParsers/parseOperand.d.ts +0 -3
  831. package/dist/modules/src/parser/subParsers/parseRegexpShorthand.d.ts +0 -3
  832. package/dist/modules/src/parser/subParsers/parseReservedSymbol.d.ts +0 -3
  833. package/dist/modules/src/parser/subParsers/parseString.d.ts +0 -4
  834. package/dist/modules/src/parser/subParsers/parseSymbol.d.ts +0 -3
  835. package/dist/modules/src/parser/types.d.ts +0 -128
  836. package/dist/modules/src/resume.d.ts +0 -41
  837. package/dist/modules/src/retrigger.d.ts +0 -39
  838. package/dist/modules/src/symbolPatterns.d.ts +0 -2
  839. package/dist/modules/src/testFramework/index.d.ts +0 -15
  840. package/dist/modules/src/tokenizer/minifyTokenStream.d.ts +0 -4
  841. package/dist/modules/src/tokenizer/operators.d.ts +0 -12
  842. package/dist/modules/src/tokenizer/reservedNames.d.ts +0 -65
  843. package/dist/modules/src/tokenizer/token.d.ts +0 -82
  844. package/dist/modules/src/tokenizer/tokenize.d.ts +0 -7
  845. package/dist/modules/src/tokenizer/tokenizers.d.ts +0 -13
  846. package/dist/modules/src/tooling.d.ts +0 -51
  847. package/dist/modules/src/transformer/index.d.ts +0 -2
  848. package/dist/modules/src/typeGuards/annotatedCollections.d.ts +0 -16
  849. package/dist/modules/src/typeGuards/array.d.ts +0 -9
  850. package/dist/modules/src/typeGuards/astNode.d.ts +0 -19
  851. package/dist/modules/src/typeGuards/dvala.d.ts +0 -26
  852. package/dist/modules/src/typeGuards/dvalaFunction.d.ts +0 -9
  853. package/dist/modules/src/typeGuards/index.d.ts +0 -7
  854. package/dist/modules/src/typeGuards/number.d.ts +0 -66
  855. package/dist/modules/src/typeGuards/string.d.ts +0 -15
  856. package/dist/modules/src/untokenizer/index.d.ts +0 -2
  857. package/dist/modules/src/utils/arity.d.ts +0 -10
  858. package/dist/modules/src/utils/debug/debugTools.d.ts +0 -1
  859. package/dist/modules/src/utils/debug/getCodeMarker.d.ts +0 -2
  860. package/dist/modules/src/utils/debug/getSourceCodeInfo.d.ts +0 -2
  861. package/dist/modules/src/utils/docString/generateDocString.d.ts +0 -4
  862. package/dist/modules/src/utils/getAssertionError.d.ts +0 -3
  863. package/dist/modules/src/utils/index.d.ts +0 -14
  864. package/dist/modules/src/utils/maybePromise.d.ts +0 -54
  865. package/dist/modules/src/utils/symbols.d.ts +0 -3
  866. package/dist/modules/string.esm.js +0 -2
  867. package/dist/modules/string.esm.js.map +0 -1
  868. package/dist/modules/string.js +0 -2
  869. package/dist/modules/string.js.map +0 -1
  870. package/dist/modules/vector.esm.js +0 -2
  871. package/dist/modules/vector.esm.js.map +0 -1
  872. package/dist/modules/vector.js +0 -2
  873. package/dist/modules/vector.js.map +0 -1
  874. package/dist/reference/api.d.ts +0 -73
  875. package/dist/reference/datatype.d.ts +0 -3
  876. package/dist/reference/index.d.ts +0 -195
  877. package/dist/reference/shorthand.d.ts +0 -3
  878. package/dist/src/AutoCompleter/AutoCompleter.d.ts +0 -27
  879. package/dist/src/Cache.d.ts +0 -16
  880. package/dist/src/allModules.d.ts +0 -2
  881. package/dist/src/builtin/bindingNode.d.ts +0 -11
  882. package/dist/src/builtin/core/array.d.ts +0 -2
  883. package/dist/src/builtin/core/assertion.d.ts +0 -2
  884. package/dist/src/builtin/core/bitwise.d.ts +0 -2
  885. package/dist/src/builtin/core/collection.d.ts +0 -2
  886. package/dist/src/builtin/core/functional.d.ts +0 -2
  887. package/dist/src/builtin/core/math.d.ts +0 -2
  888. package/dist/src/builtin/core/meta.d.ts +0 -3
  889. package/dist/src/builtin/core/misc.d.ts +0 -2
  890. package/dist/src/builtin/core/object.d.ts +0 -2
  891. package/dist/src/builtin/core/predicates.d.ts +0 -2
  892. package/dist/src/builtin/core/regexp.d.ts +0 -2
  893. package/dist/src/builtin/core/sequence.d.ts +0 -2
  894. package/dist/src/builtin/core/string.d.ts +0 -2
  895. package/dist/src/builtin/core/vector.d.ts +0 -2
  896. package/dist/src/builtin/index.d.ts +0 -13
  897. package/dist/src/builtin/interface.d.ts +0 -113
  898. package/dist/src/builtin/modules/assertion/docs.d.ts +0 -2
  899. package/dist/src/builtin/modules/assertion/index.d.ts +0 -2
  900. package/dist/src/builtin/modules/bitwise/index.d.ts +0 -2
  901. package/dist/src/builtin/modules/collection/index.d.ts +0 -2
  902. package/dist/src/builtin/modules/convert/index.d.ts +0 -2
  903. package/dist/src/builtin/modules/functional/index.d.ts +0 -2
  904. package/dist/src/builtin/modules/grid/docs.d.ts +0 -2
  905. package/dist/src/builtin/modules/grid/fromArray.d.ts +0 -8
  906. package/dist/src/builtin/modules/grid/index.d.ts +0 -2
  907. package/dist/src/builtin/modules/grid/transpose.d.ts +0 -2
  908. package/dist/src/builtin/modules/interface.d.ts +0 -28
  909. package/dist/src/builtin/modules/linear-algebra/docs.d.ts +0 -2
  910. package/dist/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +0 -1
  911. package/dist/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +0 -2
  912. package/dist/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +0 -8
  913. package/dist/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +0 -4
  914. package/dist/src/builtin/modules/linear-algebra/helpers/dot.d.ts +0 -1
  915. package/dist/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +0 -7
  916. package/dist/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +0 -2
  917. package/dist/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +0 -1
  918. package/dist/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +0 -10
  919. package/dist/src/builtin/modules/linear-algebra/helpers/length.d.ts +0 -1
  920. package/dist/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +0 -1
  921. package/dist/src/builtin/modules/linear-algebra/helpers/scale.d.ts +0 -1
  922. package/dist/src/builtin/modules/linear-algebra/helpers/solve.d.ts +0 -8
  923. package/dist/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +0 -1
  924. package/dist/src/builtin/modules/linear-algebra/index.d.ts +0 -4
  925. package/dist/src/builtin/modules/math/index.d.ts +0 -2
  926. package/dist/src/builtin/modules/matrix/docs.d.ts +0 -2
  927. package/dist/src/builtin/modules/matrix/helpers/adjugate.d.ts +0 -1
  928. package/dist/src/builtin/modules/matrix/helpers/band.d.ts +0 -9
  929. package/dist/src/builtin/modules/matrix/helpers/cofactor.d.ts +0 -1
  930. package/dist/src/builtin/modules/matrix/helpers/determinant.d.ts +0 -6
  931. package/dist/src/builtin/modules/matrix/helpers/diagonal.d.ts +0 -1
  932. package/dist/src/builtin/modules/matrix/helpers/inverse.d.ts +0 -6
  933. package/dist/src/builtin/modules/matrix/helpers/isBanded.d.ts +0 -11
  934. package/dist/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +0 -10
  935. package/dist/src/builtin/modules/matrix/helpers/isIdentity.d.ts +0 -1
  936. package/dist/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +0 -1
  937. package/dist/src/builtin/modules/matrix/helpers/isSquare.d.ts +0 -1
  938. package/dist/src/builtin/modules/matrix/helpers/isSymetric.d.ts +0 -8
  939. package/dist/src/builtin/modules/matrix/helpers/isTriangular.d.ts +0 -13
  940. package/dist/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +0 -7
  941. package/dist/src/builtin/modules/matrix/helpers/minor.d.ts +0 -1
  942. package/dist/src/builtin/modules/matrix/helpers/norm1.d.ts +0 -1
  943. package/dist/src/builtin/modules/matrix/helpers/trace.d.ts +0 -8
  944. package/dist/src/builtin/modules/matrix/index.d.ts +0 -4
  945. package/dist/src/builtin/modules/number-theory/binomialCefficient.d.ts +0 -1
  946. package/dist/src/builtin/modules/number-theory/combinations.d.ts +0 -2
  947. package/dist/src/builtin/modules/number-theory/derangements.d.ts +0 -2
  948. package/dist/src/builtin/modules/number-theory/divisors.d.ts +0 -4
  949. package/dist/src/builtin/modules/number-theory/docs.d.ts +0 -2
  950. package/dist/src/builtin/modules/number-theory/factorial.d.ts +0 -3
  951. package/dist/src/builtin/modules/number-theory/index.d.ts +0 -4
  952. package/dist/src/builtin/modules/number-theory/partitions.d.ts +0 -2
  953. package/dist/src/builtin/modules/number-theory/permutations.d.ts +0 -2
  954. package/dist/src/builtin/modules/number-theory/powerSet.d.ts +0 -2
  955. package/dist/src/builtin/modules/number-theory/primeFactors.d.ts +0 -11
  956. package/dist/src/builtin/modules/number-theory/sequences/abundant.d.ts +0 -2
  957. package/dist/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +0 -2
  958. package/dist/src/builtin/modules/number-theory/sequences/bell.d.ts +0 -1
  959. package/dist/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +0 -2
  960. package/dist/src/builtin/modules/number-theory/sequences/catalan.d.ts +0 -1
  961. package/dist/src/builtin/modules/number-theory/sequences/collatz.d.ts +0 -2
  962. package/dist/src/builtin/modules/number-theory/sequences/composite.d.ts +0 -3
  963. package/dist/src/builtin/modules/number-theory/sequences/deficient.d.ts +0 -2
  964. package/dist/src/builtin/modules/number-theory/sequences/factorial.d.ts +0 -1
  965. package/dist/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +0 -1
  966. package/dist/src/builtin/modules/number-theory/sequences/geometric.d.ts +0 -2
  967. package/dist/src/builtin/modules/number-theory/sequences/golomb.d.ts +0 -2
  968. package/dist/src/builtin/modules/number-theory/sequences/happy.d.ts +0 -2
  969. package/dist/src/builtin/modules/number-theory/sequences/index.d.ts +0 -27
  970. package/dist/src/builtin/modules/number-theory/sequences/juggler.d.ts +0 -2
  971. package/dist/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +0 -2
  972. package/dist/src/builtin/modules/number-theory/sequences/lucas.d.ts +0 -1
  973. package/dist/src/builtin/modules/number-theory/sequences/lucky.d.ts +0 -2
  974. package/dist/src/builtin/modules/number-theory/sequences/mersenne.d.ts +0 -1
  975. package/dist/src/builtin/modules/number-theory/sequences/padovan.d.ts +0 -2
  976. package/dist/src/builtin/modules/number-theory/sequences/partition.d.ts +0 -1
  977. package/dist/src/builtin/modules/number-theory/sequences/pell.d.ts +0 -1
  978. package/dist/src/builtin/modules/number-theory/sequences/perfect.d.ts +0 -1
  979. package/dist/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +0 -2
  980. package/dist/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +0 -10
  981. package/dist/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +0 -2
  982. package/dist/src/builtin/modules/number-theory/sequences/poligonal.d.ts +0 -2
  983. package/dist/src/builtin/modules/number-theory/sequences/prime.d.ts +0 -3
  984. package/dist/src/builtin/modules/number-theory/sequences/recaman.d.ts +0 -9
  985. package/dist/src/builtin/modules/number-theory/sequences/sylvester.d.ts +0 -1
  986. package/dist/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +0 -2
  987. package/dist/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +0 -1
  988. package/dist/src/builtin/modules/sequence/index.d.ts +0 -2
  989. package/dist/src/builtin/modules/string/index.d.ts +0 -2
  990. package/dist/src/builtin/modules/vector/bincount.d.ts +0 -9
  991. package/dist/src/builtin/modules/vector/calcMad.d.ts +0 -1
  992. package/dist/src/builtin/modules/vector/calcMean.d.ts +0 -1
  993. package/dist/src/builtin/modules/vector/calcMedad.d.ts +0 -1
  994. package/dist/src/builtin/modules/vector/calcMedian.d.ts +0 -1
  995. package/dist/src/builtin/modules/vector/calcStdDev.d.ts +0 -2
  996. package/dist/src/builtin/modules/vector/calcVariance.d.ts +0 -2
  997. package/dist/src/builtin/modules/vector/docs.d.ts +0 -2
  998. package/dist/src/builtin/modules/vector/entropy.d.ts +0 -8
  999. package/dist/src/builtin/modules/vector/histogram.d.ts +0 -9
  1000. package/dist/src/builtin/modules/vector/index.d.ts +0 -2
  1001. package/dist/src/builtin/modules/vector/mode.d.ts +0 -6
  1002. package/dist/src/builtin/modules/vector/outliers.d.ts +0 -7
  1003. package/dist/src/builtin/modules/vector/percentile.d.ts +0 -7
  1004. package/dist/src/builtin/modules/vector/quartiles.d.ts +0 -1
  1005. package/dist/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +0 -2
  1006. package/dist/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +0 -2
  1007. package/dist/src/builtin/modules/vector/reductionFunctions/index.d.ts +0 -13
  1008. package/dist/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +0 -2
  1009. package/dist/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +0 -5
  1010. package/dist/src/builtin/modules/vector/reductionFunctions/mad.d.ts +0 -2
  1011. package/dist/src/builtin/modules/vector/reductionFunctions/mean.d.ts +0 -4
  1012. package/dist/src/builtin/modules/vector/reductionFunctions/medad.d.ts +0 -2
  1013. package/dist/src/builtin/modules/vector/reductionFunctions/median.d.ts +0 -2
  1014. package/dist/src/builtin/modules/vector/reductionFunctions/prod.d.ts +0 -2
  1015. package/dist/src/builtin/modules/vector/reductionFunctions/rms.d.ts +0 -2
  1016. package/dist/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +0 -3
  1017. package/dist/src/builtin/modules/vector/reductionFunctions/span.d.ts +0 -2
  1018. package/dist/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +0 -3
  1019. package/dist/src/builtin/modules/vector/reductionFunctions/sum.d.ts +0 -2
  1020. package/dist/src/builtin/modules/vector/reductionFunctions/variance.d.ts +0 -3
  1021. package/dist/src/builtin/normalExpressions/index.d.ts +0 -9
  1022. package/dist/src/builtin/normalExpressions/initCoreDvala.d.ts +0 -1
  1023. package/dist/src/builtin/specialExpressionTypes.d.ts +0 -24
  1024. package/dist/src/builtin/specialExpressions/and.d.ts +0 -6
  1025. package/dist/src/builtin/specialExpressions/array.d.ts +0 -6
  1026. package/dist/src/builtin/specialExpressions/block.d.ts +0 -7
  1027. package/dist/src/builtin/specialExpressions/cond.d.ts +0 -6
  1028. package/dist/src/builtin/specialExpressions/defined.d.ts +0 -5
  1029. package/dist/src/builtin/specialExpressions/effect.d.ts +0 -5
  1030. package/dist/src/builtin/specialExpressions/functions.d.ts +0 -6
  1031. package/dist/src/builtin/specialExpressions/if.d.ts +0 -6
  1032. package/dist/src/builtin/specialExpressions/import.d.ts +0 -6
  1033. package/dist/src/builtin/specialExpressions/let.d.ts +0 -6
  1034. package/dist/src/builtin/specialExpressions/loop.d.ts +0 -6
  1035. package/dist/src/builtin/specialExpressions/loops.d.ts +0 -9
  1036. package/dist/src/builtin/specialExpressions/match.d.ts +0 -7
  1037. package/dist/src/builtin/specialExpressions/object.d.ts +0 -6
  1038. package/dist/src/builtin/specialExpressions/or.d.ts +0 -6
  1039. package/dist/src/builtin/specialExpressions/parallel.d.ts +0 -6
  1040. package/dist/src/builtin/specialExpressions/perform.d.ts +0 -6
  1041. package/dist/src/builtin/specialExpressions/qq.d.ts +0 -6
  1042. package/dist/src/builtin/specialExpressions/race.d.ts +0 -6
  1043. package/dist/src/builtin/specialExpressions/recur.d.ts +0 -5
  1044. package/dist/src/builtin/specialExpressions/unless.d.ts +0 -6
  1045. package/dist/src/builtin/utils.d.ts +0 -6
  1046. package/dist/src/bundler/index.d.ts +0 -9
  1047. package/dist/src/bundler/interface.d.ts +0 -15
  1048. package/dist/src/bundler.d.ts +0 -3
  1049. package/dist/src/constants/constants.d.ts +0 -19
  1050. package/dist/src/createDvala.d.ts +0 -47
  1051. package/dist/src/debug.d.ts +0 -115
  1052. package/dist/src/errors.d.ts +0 -24
  1053. package/dist/src/evaluator/ContextStack.d.ts +0 -70
  1054. package/dist/src/evaluator/contentHash.d.ts +0 -21
  1055. package/dist/src/evaluator/dedupSubTrees.d.ts +0 -37
  1056. package/dist/src/evaluator/effectRef.d.ts +0 -27
  1057. package/dist/src/evaluator/effectTypes.d.ts +0 -199
  1058. package/dist/src/evaluator/frames.d.ts +0 -513
  1059. package/dist/src/evaluator/interface.d.ts +0 -14
  1060. package/dist/src/evaluator/serialization.d.ts +0 -38
  1061. package/dist/src/evaluator/standardEffects.d.ts +0 -50
  1062. package/dist/src/evaluator/step.d.ts +0 -175
  1063. package/dist/src/evaluator/suspension.d.ts +0 -92
  1064. package/dist/src/evaluator/trampoline.d.ts +0 -138
  1065. package/dist/src/full.d.ts +0 -16
  1066. package/dist/src/getUndefinedSymbols/index.d.ts +0 -7
  1067. package/dist/src/index.d.ts +0 -23
  1068. package/dist/src/initReferenceData.d.ts +0 -1
  1069. package/dist/src/interface.d.ts +0 -7
  1070. package/dist/src/modules/assertion.d.ts +0 -2
  1071. package/dist/src/modules/bitwise.d.ts +0 -2
  1072. package/dist/src/modules/collection.d.ts +0 -2
  1073. package/dist/src/modules/convert.d.ts +0 -2
  1074. package/dist/src/modules/functional.d.ts +0 -2
  1075. package/dist/src/modules/grid.d.ts +0 -2
  1076. package/dist/src/modules/linear-algebra.d.ts +0 -2
  1077. package/dist/src/modules/math.d.ts +0 -2
  1078. package/dist/src/modules/matrix.d.ts +0 -2
  1079. package/dist/src/modules/number-theory.d.ts +0 -2
  1080. package/dist/src/modules/sequence.d.ts +0 -2
  1081. package/dist/src/modules/string.d.ts +0 -2
  1082. package/dist/src/modules/vector.d.ts +0 -2
  1083. package/dist/src/parser/ParserContext.d.ts +0 -20
  1084. package/dist/src/parser/getPrecedence.d.ts +0 -3
  1085. package/dist/src/parser/helpers.d.ts +0 -19
  1086. package/dist/src/parser/index.d.ts +0 -5
  1087. package/dist/src/parser/subParsers/parseArray.d.ts +0 -3
  1088. package/dist/src/parser/subParsers/parseBindingTarget.d.ts +0 -8
  1089. package/dist/src/parser/subParsers/parseCond.d.ts +0 -4
  1090. package/dist/src/parser/subParsers/parseDo.d.ts +0 -3
  1091. package/dist/src/parser/subParsers/parseExpression.d.ts +0 -5
  1092. package/dist/src/parser/subParsers/parseForOrDoseq.d.ts +0 -4
  1093. package/dist/src/parser/subParsers/parseFunction.d.ts +0 -4
  1094. package/dist/src/parser/subParsers/parseFunctionCall.d.ts +0 -3
  1095. package/dist/src/parser/subParsers/parseIfOrUnless.d.ts +0 -5
  1096. package/dist/src/parser/subParsers/parseImplicitBlock.d.ts +0 -5
  1097. package/dist/src/parser/subParsers/parseLet.d.ts +0 -4
  1098. package/dist/src/parser/subParsers/parseLoop.d.ts +0 -4
  1099. package/dist/src/parser/subParsers/parseMatch.d.ts +0 -4
  1100. package/dist/src/parser/subParsers/parseNumber.d.ts +0 -3
  1101. package/dist/src/parser/subParsers/parseObject.d.ts +0 -3
  1102. package/dist/src/parser/subParsers/parseOperand.d.ts +0 -3
  1103. package/dist/src/parser/subParsers/parseRegexpShorthand.d.ts +0 -3
  1104. package/dist/src/parser/subParsers/parseReservedSymbol.d.ts +0 -3
  1105. package/dist/src/parser/subParsers/parseString.d.ts +0 -4
  1106. package/dist/src/parser/subParsers/parseSymbol.d.ts +0 -3
  1107. package/dist/src/parser/types.d.ts +0 -128
  1108. package/dist/src/resume.d.ts +0 -41
  1109. package/dist/src/retrigger.d.ts +0 -39
  1110. package/dist/src/symbolPatterns.d.ts +0 -2
  1111. package/dist/src/testFramework/index.d.ts +0 -15
  1112. package/dist/src/tokenizer/minifyTokenStream.d.ts +0 -4
  1113. package/dist/src/tokenizer/operators.d.ts +0 -12
  1114. package/dist/src/tokenizer/reservedNames.d.ts +0 -65
  1115. package/dist/src/tokenizer/token.d.ts +0 -82
  1116. package/dist/src/tokenizer/tokenize.d.ts +0 -7
  1117. package/dist/src/tokenizer/tokenizers.d.ts +0 -13
  1118. package/dist/src/tooling.d.ts +0 -51
  1119. package/dist/src/transformer/index.d.ts +0 -2
  1120. package/dist/src/typeGuards/annotatedCollections.d.ts +0 -16
  1121. package/dist/src/typeGuards/array.d.ts +0 -9
  1122. package/dist/src/typeGuards/astNode.d.ts +0 -19
  1123. package/dist/src/typeGuards/dvala.d.ts +0 -26
  1124. package/dist/src/typeGuards/dvalaFunction.d.ts +0 -9
  1125. package/dist/src/typeGuards/index.d.ts +0 -7
  1126. package/dist/src/typeGuards/number.d.ts +0 -66
  1127. package/dist/src/typeGuards/string.d.ts +0 -15
  1128. package/dist/src/untokenizer/index.d.ts +0 -2
  1129. package/dist/src/utils/arity.d.ts +0 -10
  1130. package/dist/src/utils/debug/debugTools.d.ts +0 -1
  1131. package/dist/src/utils/debug/getCodeMarker.d.ts +0 -2
  1132. package/dist/src/utils/debug/getSourceCodeInfo.d.ts +0 -2
  1133. package/dist/src/utils/docString/generateDocString.d.ts +0 -4
  1134. package/dist/src/utils/getAssertionError.d.ts +0 -3
  1135. package/dist/src/utils/index.d.ts +0 -14
  1136. package/dist/src/utils/maybePromise.d.ts +0 -54
  1137. package/dist/src/utils/symbols.d.ts +0 -3
  1138. package/dist/testFramework.esm.js +0 -2
  1139. package/dist/testFramework.esm.js.map +0 -1
  1140. package/dist/testFramework.js +0 -2
  1141. package/dist/testFramework.js.map +0 -1
@@ -1,6 +0,0 @@
1
- import type { FormatterRule } from '../cli/src/cliFormatterRules';
2
- export type TextFormatter = (text: string) => string;
3
- export declare function createFormatter(rules: FormatterRule[], options?: {
4
- prefix?: string;
5
- suffix?: string;
6
- }): TextFormatter;
@@ -1,2 +0,0 @@
1
- export declare function stringifyValue(value: unknown, html: boolean): string;
2
- export declare function findAllOccurrences(input: string, pattern: RegExp): Set<string>;
@@ -1,2 +0,0 @@
1
- function e(e){if(!e.position||!e.code)return"";const t=e.position.column-1,n=e.code.length-t-1;return`${" ".repeat(Math.max(t,0))}^${" ".repeat(Math.max(n,0))}`}class t extends Error{sourceCodeInfo;shortMessage;constructor(n,r){const s=n instanceof Error?n.message:`${n}`;super(function(t,n){if(!n)return t;const r=`${n.position.line}:${n.position.column}`;return`${t}${n.filePath?`\n${n.filePath}:${r}`:`\nLocation ${r}`}\n${n.code}\n${e(n)}`}(s,r)),this.shortMessage=s,this.sourceCodeInfo=r,Object.setPrototypeOf(this,t.prototype),this.name="DvalaError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const n={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},r=new Set(Object.values(n));const s=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","EffectMatcher","Builtin","SpecialBuiltin","Module"]);function i(e){return null!==e&&"object"==typeof e&&("^^fn^^"in e&&"functionType"in e&&("string"==typeof(t=e.functionType)&&s.has(t)));var t}function o(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(t=e[0])&&r.has(t));var t}function a(e){return i(e)?`<function ${e.name||"λ"}>`:o(e)?`${t=e[0],Object.keys(n).find(e=>n[e]===t)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var t}function u(e,n,r={}){if(!function(e,t={}){return!("number"!=typeof e||Number.isNaN(e)||t.integer&&!Number.isInteger(e)||t.finite&&!Number.isFinite(e)||t.zero&&0!==e||t.nonZero&&0===e||t.positive&&e<=0||t.negative&&e>=0||t.nonPositive&&e>0||t.nonNegative&&e<0||"number"==typeof t.gt&&e<=t.gt||"number"==typeof t.gte&&e<t.gte||"number"==typeof t.lt&&e>=t.lt||"number"==typeof t.lte&&e>t.lte)}(e,r))throw new t(`Expected ${function(e){if(e.zero)return"zero";const t=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),n=e.integer?"integer":"number",r=e.finite?"finite":"",s=function(e){return"number"!=typeof e.gt&&"number"!=typeof e.gte||"number"!=typeof e.lt&&"number"!=typeof e.lte?"number"==typeof e.gt||"number"==typeof e.gte?"number"==typeof e.gt?`n > ${e.gt}`:`n >= ${e.gte}`:"number"==typeof e.lt||"number"==typeof e.lte?"number"==typeof e.lt?`n < ${e.lt}`:`n <= ${e.lte}`:"":`${"number"==typeof e.gt?`${e.gt} < n `:`${e.gte} <= n `}${"number"==typeof e.lt?`< ${e.lt}`:`<= ${e.lte}`}`}(e);return[t,r,n,s].filter(e=>!!e).join(" ")}(r)}, got ${a(e)}.`,function(e,t){return e?.sourceCodeInfo??t}(e,n))}function c(e){return{min:e,max:e}}const m={baseUnit:"rad",description:"angle",units:{deg:Math.PI/180,rad:1,grad:Math.PI/200,turn:2*Math.PI}};function l(e,t){switch(e){case"c":return t;case"f":return 9*t/5+32;case"k":return t+273.15}}function p(e,t){switch(e){case"c":return t;case"f":return 5*(t-32)/9;case"k":return t-273.15}}const f=["c","f","k"],g={angstrom:"ångströms",um:"micrometers",mm:"millimeters",cm:"centimeters",m:"meters",km:"kilometers",in:"inches",ft:"feet",yd:"yards",mi:"miles",nmi:"nautical miles",mg:"milligrams",g:"grams",kg:"kilograms",t:"metric tons",oz:"ounces",lb:"pounds",st:"stones",ml:"milliliters",cl:"centiliters",dl:"deciliters",l:"liters",tsp:"teaspoons",tbsp:"tablespoons","fl-oz":"fluid ounces",cup:"cups",pt:"pints",qt:"quarts",gal:"gallons",ms:"milliseconds",s:"seconds",min:"minutes",h:"hours",day:"days",week:"weeks",mm2:"square millimeters",cm2:"square centimeters",m2:"square meters",km2:"square kilometers",in2:"square inches",ft2:"square feet",yd2:"square yards",acre:"acres",hectare:"hectares","m/s":"meters per second","km/h":"kilometers per hour",mph:"miles per hour",kn:"knots","ft/s":"feet per second",b:"bytes",kb:"kilobytes",mb:"megabytes",gb:"gigabytes",tb:"terabytes",pb:"petabytes",pa:"pascals",kpa:"kilopascals",bar:"bars",atm:"atmospheres",psi:"pounds per square inch",mmhg:"millimeters of mercury",j:"joules",kj:"kilojoules",cal:"calories",kcal:"kilocalories",wh:"watt-hours",kwh:"kilowatt-hours",btu:"British thermal units",w:"watts",kw:"kilowatts",mw:"megawatts",hp:"horsepower",hz:"hertz",khz:"kilohertz",mhz:"megahertz",ghz:"gigahertz",deg:"degrees",rad:"radians",grad:"gradians",turn:"turns",c:"Celsius",f:"Fahrenheit",k:"Kelvin"};function b(e){const t={},n=Object.keys(e.units);for(const r of n)for(const s of n){if(r===s)continue;const i=e.units[r]/e.units[s],o=`${r}->${s}`,a=g[r],m=g[s],l=[`convert.${s}->${r}`,...n.filter(e=>e!==r&&e!==s).map(e=>`convert.${r}->${e}`)];t[o]={evaluate:([e],t)=>(u(e,t),e*i),arity:c(1),docs:{category:"convert",returns:{type:"number"},args:{value:{type:"number",description:`Value in ${a}`}},variants:[{argumentNames:["value"]}],description:`Converts a value from ${a} (\`${r}\`) to ${m} (\`${s}\`).`,seeAlso:l,examples:[`let { ${o} } = import(convert);\n${o}(1)`]}}}return t}const d={...b({baseUnit:"m",description:"length",units:{angstrom:1e-10,um:1e-6,mm:.001,cm:.01,m:1,km:1e3,in:.0254,ft:.3048,yd:.9144,mi:1609.344,nmi:1852}}),...b({baseUnit:"kg",description:"weight",units:{mg:1e-6,g:.001,kg:1,t:1e3,oz:.028349523125,lb:.45359237,st:6.35029318}}),...b({baseUnit:"l",description:"volume",units:{ml:.001,cl:.01,dl:.1,l:1,tsp:.00492892159375,tbsp:.01478676478125,"fl-oz":.0295735295625,cup:.2365882365,pt:.473176473,qt:.946352946,gal:3.785411784}}),...b({baseUnit:"s",description:"time",units:{ms:.001,s:1,min:60,h:3600,day:86400,week:604800}}),...b({baseUnit:"m2",description:"area",units:{mm2:1e-6,cm2:1e-4,m2:1,km2:1e6,in2:64516e-8,ft2:.09290304,yd2:.83612736,acre:4046.8564224,hectare:1e4}}),...b({baseUnit:"m/s",description:"speed",units:{"m/s":1,"km/h":1/3.6,mph:.44704,kn:.514444,"ft/s":.3048}}),...b({baseUnit:"b",description:"data",units:{b:1,kb:1e3,mb:1e6,gb:1e9,tb:1e12,pb:1e15}}),...b({baseUnit:"pa",description:"pressure",units:{pa:1,kpa:1e3,bar:1e5,atm:101325,psi:6894.757293168,mmhg:133.322387415}}),...b({baseUnit:"j",description:"energy",units:{j:1,kj:1e3,cal:4.184,kcal:4184,wh:3600,kwh:36e5,btu:1055.06}}),...b({baseUnit:"w",description:"power",units:{w:1,kw:1e3,mw:1e6,hp:745.7}}),...b({baseUnit:"hz",description:"frequency",units:{hz:1,khz:1e3,mhz:1e6,ghz:1e9}}),...b(m),...function(){const e={};for(const t of f)for(const n of f){if(t===n)continue;const r=`${t}->${n}`,s=g[t],i=g[n],o=[`convert.${n}->${t}`,...f.filter(e=>e!==t&&e!==n).map(e=>`convert.${t}->${e}`)];e[r]={evaluate:([e],r)=>{u(e,r);const s=p(t,e);return l(n,s)},arity:c(1),docs:{category:"convert",returns:{type:"number"},args:{value:{type:"number",description:`Value in ${s}`}},variants:[{argumentNames:["value"]}],description:`Converts a temperature from ${s} (\`${t}\`) to ${i} (\`${n}\`).`,seeAlso:o,examples:[`let { ${r} } = import(convert);\n${r}(100)`]}}}return e}()},h={name:"convert",functions:d,source:"{}",docs:(y=d,Object.fromEntries(Object.entries(y).map(([e,t])=>{if(!t.docs)throw new Error(`Missing docs for function "${e}"`);return[e,t.docs]})))};var y;export{h as convertModule};
2
- //# sourceMappingURL=convert.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.esm.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/debug/debugTools.ts","../../src/utils/symbols.ts","../../src/typeGuards/number.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/utils/arity.ts","../../src/builtin/modules/convert/index.ts","../../src/builtin/modules/convert/convert.dvala","../../src/builtin/modules/interface.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getDvalaErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class DvalaError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getDvalaErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, DvalaError.prototype)\n this.name = 'DvalaError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends DvalaError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends DvalaError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends DvalaError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isDvalaError(error: unknown): error is DvalaError {\n return error instanceof DvalaError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'EffectMatcher',\n 'Builtin',\n 'SpecialBuiltin',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { AstNode, DvalaFunction } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isDvalaFunction(func: unknown): func is DvalaFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is AstNode {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isDvalaFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\nexport const EFFECT_SYMBOL = '^^ef^^'\n","import { DvalaError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\ntype SignOptions =\n | {\n positive?: true\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: true\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: true\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: true\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: true\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: true\n }\n\ntype GtOptions =\n | {\n gt?: number\n gte?: never\n }\n | {\n gt?: never\n gte?: number\n }\n\ntype LtOptions =\n | {\n lt?: number\n lte?: never\n }\n | {\n lt?: never\n lte?: number\n }\n\ntype NumberOptions = {\n integer?: true\n finite?: true\n} & SignOptions &\nGtOptions &\nLtOptions\n\nfunction getRangeString(options: NumberOptions): string {\n const hasUpperAndLowerBound\n = (typeof options.gt === 'number' || typeof options.gte === 'number')\n && (typeof options.lt === 'number' || typeof options.lte === 'number')\n if (hasUpperAndLowerBound) {\n return `${typeof options.gt === 'number' ? `${options.gt} < n ` : `${options.gte} <= n `}${\n typeof options.lt === 'number' ? `< ${options.lt}` : `<= ${options.lte}`\n }`\n }\n else if (typeof options.gt === 'number' || typeof options.gte === 'number') {\n return `${typeof options.gt === 'number' ? `n > ${options.gt}` : `n >= ${options.gte}`}`\n }\n else if (typeof options.lt === 'number' || typeof options.lte === 'number') {\n return `${typeof options.lt === 'number' ? `n < ${options.lt}` : `n <= ${options.lte}`}`\n }\n else { return '' }\n}\n\nfunction getSignString(options: NumberOptions): string {\n return options.positive\n ? 'positive'\n : options.negative\n ? 'negative'\n : options.nonNegative\n ? 'non negative'\n : options.nonPositive\n ? 'non positive'\n : options.nonZero\n ? 'non zero'\n : ''\n}\n\nfunction getNumberTypeName(options: NumberOptions): string {\n if (options.zero)\n return 'zero'\n\n const sign = getSignString(options)\n const numberType = options.integer ? 'integer' : 'number'\n const finite = options.finite ? 'finite' : ''\n const range = getRangeString(options)\n\n return [sign, finite, numberType, range].filter(x => !!x).join(' ')\n}\n\nexport function isNumber(value: unknown, options: NumberOptions = {}): value is number {\n if (typeof value !== 'number')\n return false\n\n if (Number.isNaN(value))\n return false\n\n if (options.integer && !Number.isInteger(value))\n return false\n\n if (options.finite && !Number.isFinite(value))\n return false\n\n if (options.zero && value !== 0)\n return false\n\n if (options.nonZero && value === 0)\n return false\n\n if (options.positive && value <= 0)\n return false\n\n if (options.negative && value >= 0)\n return false\n\n if (options.nonPositive && value > 0)\n return false\n\n if (options.nonNegative && value < 0)\n return false\n\n if (typeof options.gt === 'number' && value <= options.gt)\n return false\n\n if (typeof options.gte === 'number' && value < options.gte)\n return false\n\n if (typeof options.lt === 'number' && value >= options.lt)\n return false\n\n if (typeof options.lte === 'number' && value > options.lte)\n return false\n\n return true\n}\n\nexport function assertNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n options: NumberOptions = {},\n): asserts value is number {\n if (!isNumber(value, options)) {\n throw new DvalaError(\n `Expected ${getNumberTypeName(options)}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asNumber(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: NumberOptions = {},\n): number {\n assertNumber(value, sourceCodeInfo, options)\n return value\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import type { Arity } from '../builtin/interface'\nimport { DvalaError } from '../errors'\nimport type { FunctionLike } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isColl } from '../typeGuards/dvala'\nimport { valueToString } from './debug/debugTools'\n\nexport function arityAccepts(arity: Arity, nbrOfParams: number): boolean {\n const { min, max } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n if (typeof max === 'number' && nbrOfParams > max) {\n return false\n }\n return true\n}\n\nexport function arityAcceptsMin(arity: Arity, nbrOfParams: number): boolean {\n const { min } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n return true\n}\n\nexport function getCommonArityFromFunctions(params: FunctionLike[]): Arity | null {\n return params.reduce((acc: Arity | null, param): Arity | null => {\n if (acc === null) {\n return null\n }\n const arity: Arity = (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n const { min: aMin, max: aMax } = arity\n const { min: bMin, max: bMax } = acc\n const min = typeof aMin === 'number' && typeof bMin === 'number'\n ? Math.max(aMin, bMin)\n : typeof aMin === 'number' ? aMin : typeof bMin === 'number' ? bMin : undefined\n const max = typeof aMax === 'number' && typeof bMax === 'number'\n ? Math.min(aMax, bMax)\n : typeof aMax === 'number' ? aMax : typeof bMax === 'number' ? bMax : undefined\n\n if (typeof min === 'number' && typeof max === 'number' && min > max) {\n return null\n }\n\n return { min, max }\n }, {})\n}\n\nexport function getArityFromFunction(param: FunctionLike): Arity {\n return (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n}\n\nexport function assertNumberOfParams(arity: Arity, length: number, sourceCodeInfo: SourceCodeInfo | undefined): void {\n const { min, max } = arity\n if (typeof min === 'number' && length < min) {\n throw new DvalaError(\n `Wrong number of arguments, expected at least ${min}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n\n if (typeof max === 'number' && length > max) {\n throw new DvalaError(\n `Wrong number of arguments, expected at most ${max}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n}\n\nexport function canBeOperator(count: Arity): boolean {\n if (typeof count.max === 'number' && count.max < 2) {\n return false\n }\n\n if (typeof count.min === 'number' && count.min > 2) {\n return false\n }\n\n return true\n}\n\nexport function toFixedArity(arity: number): Arity {\n return { min: arity, max: arity }\n}\n","import { assertNumber } from '../../../typeGuards/number'\nimport { toFixedArity } from '../../../utils/arity'\nimport type { BuiltinNormalExpressions } from '../../interface'\nimport { moduleDocsFromFunctions } from '../interface'\nimport type { DvalaModule } from '../interface'\nimport convertModuleSource from './convert.dvala'\n\n// --- Conversion factor tables ---\n// Each category maps unit abbreviations to a factor relative to a base unit.\n// To convert from unit A to unit B: value * (factorA / factorB)\n// Temperature is special-cased (non-linear).\n\ninterface UnitCategory {\n baseUnit: string\n units: Record<string, number>\n description: string\n}\n\nconst lengthUnits: UnitCategory = {\n baseUnit: 'm',\n description: 'length',\n units: {\n angstrom: 1e-10,\n um: 0.000001,\n mm: 0.001,\n cm: 0.01,\n m: 1,\n km: 1000,\n in: 0.0254,\n ft: 0.3048,\n yd: 0.9144,\n mi: 1609.344,\n nmi: 1852,\n },\n}\n\nconst weightUnits: UnitCategory = {\n baseUnit: 'kg',\n description: 'weight',\n units: {\n mg: 0.000001,\n g: 0.001,\n kg: 1,\n t: 1000,\n oz: 0.028349523125,\n lb: 0.45359237,\n st: 6.35029318,\n },\n}\n\nconst volumeUnits: UnitCategory = {\n baseUnit: 'l',\n description: 'volume',\n units: {\n 'ml': 0.001,\n 'cl': 0.01,\n 'dl': 0.1,\n 'l': 1,\n 'tsp': 0.00492892159375,\n 'tbsp': 0.01478676478125,\n 'fl-oz': 0.0295735295625,\n 'cup': 0.2365882365,\n 'pt': 0.473176473,\n 'qt': 0.946352946,\n 'gal': 3.785411784,\n },\n}\n\nconst timeUnits: UnitCategory = {\n baseUnit: 's',\n description: 'time',\n units: {\n ms: 0.001,\n s: 1,\n min: 60,\n h: 3600,\n day: 86400,\n week: 604800,\n },\n}\n\nconst areaUnits: UnitCategory = {\n baseUnit: 'm2',\n description: 'area',\n units: {\n mm2: 0.000001,\n cm2: 0.0001,\n m2: 1,\n km2: 1000000,\n in2: 0.00064516,\n ft2: 0.09290304,\n yd2: 0.83612736,\n acre: 4046.8564224,\n hectare: 10000,\n },\n}\n\nconst speedUnits: UnitCategory = {\n baseUnit: 'm/s',\n description: 'speed',\n units: {\n 'm/s': 1,\n 'km/h': 1 / 3.6,\n 'mph': 0.44704,\n 'kn': 0.514444,\n 'ft/s': 0.3048,\n },\n}\n\nconst dataUnits: UnitCategory = {\n baseUnit: 'b',\n description: 'data',\n units: {\n b: 1,\n kb: 1000,\n mb: 1000000,\n gb: 1e9,\n tb: 1e12,\n pb: 1e15,\n },\n}\n\nconst pressureUnits: UnitCategory = {\n baseUnit: 'pa',\n description: 'pressure',\n units: {\n pa: 1,\n kpa: 1000,\n bar: 100000,\n atm: 101325,\n psi: 6894.757293168,\n mmhg: 133.322387415,\n },\n}\n\nconst energyUnits: UnitCategory = {\n baseUnit: 'j',\n description: 'energy',\n units: {\n j: 1,\n kj: 1000,\n cal: 4.184,\n kcal: 4184,\n wh: 3600,\n kwh: 3600000,\n btu: 1055.06,\n },\n}\n\nconst powerUnits: UnitCategory = {\n baseUnit: 'w',\n description: 'power',\n units: {\n w: 1,\n kw: 1000,\n mw: 1000000,\n hp: 745.7,\n },\n}\n\nconst frequencyUnits: UnitCategory = {\n baseUnit: 'hz',\n description: 'frequency',\n units: {\n hz: 1,\n khz: 1000,\n mhz: 1000000,\n ghz: 1000000000,\n },\n}\n\nconst angleUnits: UnitCategory = {\n baseUnit: 'rad',\n description: 'angle',\n units: {\n deg: Math.PI / 180,\n rad: 1,\n grad: Math.PI / 200,\n turn: 2 * Math.PI,\n },\n}\n\n// --- Temperature conversion functions ---\n\nfunction celsiusTo(unit: 'c' | 'f' | 'k', value: number): number {\n switch (unit) {\n case 'c': return value\n case 'f': return value * 9 / 5 + 32\n case 'k': return value + 273.15\n }\n}\n\nfunction toCelsius(unit: 'c' | 'f' | 'k', value: number): number {\n switch (unit) {\n case 'c': return value\n case 'f': return (value - 32) * 5 / 9\n case 'k': return value - 273.15\n }\n}\n\nconst temperatureUnits = ['c', 'f', 'k'] as const\n\nconst unitDescriptions: Record<string, string> = {\n // Length\n 'angstrom': 'ångströms',\n 'um': 'micrometers',\n 'mm': 'millimeters',\n 'cm': 'centimeters',\n 'm': 'meters',\n 'km': 'kilometers',\n 'in': 'inches',\n 'ft': 'feet',\n 'yd': 'yards',\n 'mi': 'miles',\n 'nmi': 'nautical miles',\n // Weight\n 'mg': 'milligrams',\n 'g': 'grams',\n 'kg': 'kilograms',\n 't': 'metric tons',\n 'oz': 'ounces',\n 'lb': 'pounds',\n 'st': 'stones',\n // Volume\n 'ml': 'milliliters',\n 'cl': 'centiliters',\n 'dl': 'deciliters',\n 'l': 'liters',\n 'tsp': 'teaspoons',\n 'tbsp': 'tablespoons',\n 'fl-oz': 'fluid ounces',\n 'cup': 'cups',\n 'pt': 'pints',\n 'qt': 'quarts',\n 'gal': 'gallons',\n // Time\n 'ms': 'milliseconds',\n 's': 'seconds',\n 'min': 'minutes',\n 'h': 'hours',\n 'day': 'days',\n 'week': 'weeks',\n // Area\n 'mm2': 'square millimeters',\n 'cm2': 'square centimeters',\n 'm2': 'square meters',\n 'km2': 'square kilometers',\n 'in2': 'square inches',\n 'ft2': 'square feet',\n 'yd2': 'square yards',\n 'acre': 'acres',\n 'hectare': 'hectares',\n // Speed\n 'm/s': 'meters per second',\n 'km/h': 'kilometers per hour',\n 'mph': 'miles per hour',\n 'kn': 'knots',\n 'ft/s': 'feet per second',\n // Data\n 'b': 'bytes',\n 'kb': 'kilobytes',\n 'mb': 'megabytes',\n 'gb': 'gigabytes',\n 'tb': 'terabytes',\n 'pb': 'petabytes',\n // Pressure\n 'pa': 'pascals',\n 'kpa': 'kilopascals',\n 'bar': 'bars',\n 'atm': 'atmospheres',\n 'psi': 'pounds per square inch',\n 'mmhg': 'millimeters of mercury',\n // Energy\n 'j': 'joules',\n 'kj': 'kilojoules',\n 'cal': 'calories',\n 'kcal': 'kilocalories',\n 'wh': 'watt-hours',\n 'kwh': 'kilowatt-hours',\n 'btu': 'British thermal units',\n // Power\n 'w': 'watts',\n 'kw': 'kilowatts',\n 'mw': 'megawatts',\n 'hp': 'horsepower',\n // Frequency\n 'hz': 'hertz',\n 'khz': 'kilohertz',\n 'mhz': 'megahertz',\n 'ghz': 'gigahertz',\n // Angle\n 'deg': 'degrees',\n 'rad': 'radians',\n 'grad': 'gradians',\n 'turn': 'turns',\n // Temperature\n 'c': 'Celsius',\n 'f': 'Fahrenheit',\n 'k': 'Kelvin',\n}\n\n// --- Generate linear conversion functions ---\n\nfunction generateLinearConversions(category: UnitCategory): BuiltinNormalExpressions {\n const result: BuiltinNormalExpressions = {}\n const unitNames = Object.keys(category.units)\n\n for (const from of unitNames) {\n for (const to of unitNames) {\n if (from === to)\n continue\n\n const fromFactor = category.units[from]!\n const toFactor = category.units[to]!\n const conversionFactor = fromFactor / toFactor\n const fnName = `${from}->${to}`\n const fromDesc = unitDescriptions[from]!\n const toDesc = unitDescriptions[to]!\n\n const seeAlso = [\n `convert.${to}->${from}`,\n ...unitNames\n .filter(u => u !== from && u !== to)\n .map(u => `convert.${from}->${u}`),\n ]\n\n result[fnName] = {\n evaluate: ([value], sourceCodeInfo): number => {\n assertNumber(value, sourceCodeInfo)\n return value * conversionFactor\n },\n arity: toFixedArity(1),\n docs: {\n category: 'convert',\n returns: { type: 'number' },\n args: {\n value: { type: 'number', description: `Value in ${fromDesc}` },\n },\n variants: [{ argumentNames: ['value'] }],\n description: `Converts a value from ${fromDesc} (\\`${from}\\`) to ${toDesc} (\\`${to}\\`).`,\n seeAlso,\n examples: [\n `let { ${fnName} } = import(convert);\n${fnName}(1)`,\n ],\n },\n }\n }\n }\n return result\n}\n\n// --- Generate temperature conversion functions ---\n\nfunction generateTemperatureConversions(): BuiltinNormalExpressions {\n const result: BuiltinNormalExpressions = {}\n\n for (const from of temperatureUnits) {\n for (const to of temperatureUnits) {\n if (from === to)\n continue\n\n const fnName = `${from}->${to}`\n const fromDesc = unitDescriptions[from]!\n const toDesc = unitDescriptions[to]!\n\n const seeAlso = [\n `convert.${to}->${from}`,\n ...temperatureUnits\n .filter(u => u !== from && u !== to)\n .map(u => `convert.${from}->${u}`),\n ]\n\n result[fnName] = {\n evaluate: ([value], sourceCodeInfo): number => {\n assertNumber(value, sourceCodeInfo)\n const celsius = toCelsius(from, value)\n return celsiusTo(to, celsius)\n },\n arity: toFixedArity(1),\n docs: {\n category: 'convert',\n returns: { type: 'number' },\n args: {\n value: { type: 'number', description: `Value in ${fromDesc}` },\n },\n variants: [{ argumentNames: ['value'] }],\n description: `Converts a temperature from ${fromDesc} (\\`${from}\\`) to ${toDesc} (\\`${to}\\`).`,\n seeAlso,\n examples: [\n `let { ${fnName} } = import(convert);\n${fnName}(100)`,\n ],\n },\n }\n }\n }\n return result\n}\n\n// --- Assemble all conversion functions ---\n\nconst convertFunctions: BuiltinNormalExpressions = {\n ...generateLinearConversions(lengthUnits),\n ...generateLinearConversions(weightUnits),\n ...generateLinearConversions(volumeUnits),\n ...generateLinearConversions(timeUnits),\n ...generateLinearConversions(areaUnits),\n ...generateLinearConversions(speedUnits),\n ...generateLinearConversions(dataUnits),\n ...generateLinearConversions(pressureUnits),\n ...generateLinearConversions(energyUnits),\n ...generateLinearConversions(powerUnits),\n ...generateLinearConversions(frequencyUnits),\n ...generateLinearConversions(angleUnits),\n ...generateTemperatureConversions(),\n}\n\nexport const convertModule: DvalaModule = {\n name: 'convert',\n functions: convertFunctions,\n source: convertModuleSource,\n docs: moduleDocsFromFunctions(convertFunctions),\n}\n","{}","import type { BuiltinNormalExpressions, FunctionDocs } from '../../builtin/interface'\n\n/**\n * Represents a Dvala module that can be imported dynamically.\n * Modules contain a collection of functions that are not part of the core bundle.\n */\nexport interface DvalaModule {\n /** The name of the module (e.g., 'grid', 'vec', 'mat') */\n name: string\n /** The functions provided by this module, keyed by their short name (e.g., 'transpose') */\n functions: BuiltinNormalExpressions\n /**\n * Optional Dvala source code that is evaluated at import time.\n * The source must evaluate to an object mapping function names to functions.\n * These are merged with (and may override) the TypeScript `functions`.\n */\n source?: string\n /**\n * Docs for all functions in this module, including any defined in `source`.\n * The reference system uses this record as the sole source of truth for\n * function names and documentation. Not required for user-defined modules.\n */\n docs?: Record<string, FunctionDocs>\n}\n\n/**\n * Derives a docs record from a BuiltinNormalExpressions map.\n * Use this for modules whose docs are co-located inline on each function.\n */\nexport function moduleDocsFromFunctions(functions: BuiltinNormalExpressions): Record<string, FunctionDocs> {\n return Object.fromEntries(\n Object.entries(functions).map(([k, v]) => {\n if (!v.docs)\n throw new Error(`Missing docs for function \"${k}\"`)\n return [k, v.docs]\n }),\n )\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","DvalaError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getDvalaErrorMessage","this","Object","setPrototypeOf","prototype","name","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","isDvalaFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","assertNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","isNumber","sign","getSignString","numberType","range","getRangeString","filter","x","join","getNumberTypeName","anyValue","getSourceCodeInfo","toFixedArity","arity","min","angleUnits","baseUnit","description","units","deg","PI","rad","grad","turn","celsiusTo","unit","toCelsius","temperatureUnits","unitDescriptions","angstrom","um","mm","cm","m","km","in","ft","yd","mi","nmi","mg","g","kg","t","oz","lb","st","ml","cl","dl","l","tsp","tbsp","cup","pt","qt","gal","ms","s","h","day","week","mm2","cm2","m2","km2","in2","ft2","yd2","acre","hectare","mph","kn","b","kb","mb","gb","tb","pb","pa","kpa","bar","atm","psi","mmhg","j","kj","cal","kcal","wh","kwh","btu","w","kw","mw","hp","hz","khz","mhz","ghz","c","f","k","generateLinearConversions","category","result","unitNames","from","to","conversionFactor","fnName","fromDesc","toDesc","seeAlso","u","map","evaluate","docs","returns","args","variants","argumentNames","examples","convertFunctions","celsius","generateTemperatureConversions","convertModule","functions","source","fromEntries","entries","v"],"mappings":"AAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,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AE1BK,EAAU,CACd,WAAWL,MAAOD,OACfhF,EACArB,OAAO4G,GAAKA,IAAMP,GAAQO,IAAMN,GAChCO,IAAID,GAAK,WAAWP,MAASO,MAGlCT,EAAOK,GAAU,CACfM,SAAU,EAAEhJ,GAAQ/C,KAClB0D,EAAaX,EAAO/C,GACpB,MAAMuM,EAAUlG,EAAUiF,EAAMvI,GAChC,OAAOoD,EAAUoF,EAAIgB,IAEvB/G,MAAOD,EAAa,GACpByG,KAAM,CACJb,SAAU,UACVc,QAAS,CAAEtJ,KAAM,UACjBuJ,KAAM,CACJnJ,MAAO,CAAEJ,KAAM,SAAUiD,YAAa,YAAY8F,MAEpDS,SAAU,CAAC,CAAEC,cAAe,CAAC,WAC7BxG,YAAa,+BAA+B8F,QAAeJ,WAAcK,QAAaJ,QACtFK,UACAS,SAAU,CACR,SAASZ,2BACnBA,WAIG,CAEH,OAAOL,CACT,CAiBKoB,IAGQC,EAA6B,CACxChL,KAAM,UACNiL,UAAWJ,EACXK,OCraa,KDsabX,MEzYsCU,EFyYRJ,EExYvBhL,OAAOsL,YACZtL,OAAOuL,QAAQH,GAAWZ,IAAI,EAAEb,EAAG6B,MACjC,IAAKA,EAAEd,KACL,MAAM,IAAIrL,MAAM,8BAA8BsK,MAChD,MAAO,CAACA,EAAG6B,EAAEd,WALb,IAAkCU"}
@@ -1,2 +0,0 @@
1
- "use strict";function e(e){if(!e.position||!e.code)return"";const t=e.position.column-1,n=e.code.length-t-1;return`${" ".repeat(Math.max(t,0))}^${" ".repeat(Math.max(n,0))}`}class t extends Error{sourceCodeInfo;shortMessage;constructor(n,r){const s=n instanceof Error?n.message:`${n}`;super(function(t,n){if(!n)return t;const r=`${n.position.line}:${n.position.column}`;return`${t}${n.filePath?`\n${n.filePath}:${r}`:`\nLocation ${r}`}\n${n.code}\n${e(n)}`}(s,r)),this.shortMessage=s,this.sourceCodeInfo=r,Object.setPrototypeOf(this,t.prototype),this.name="DvalaError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const n={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},r=new Set(Object.values(n));const s=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","EffectMatcher","Builtin","SpecialBuiltin","Module"]);function o(e){return null!==e&&"object"==typeof e&&("^^fn^^"in e&&"functionType"in e&&("string"==typeof(t=e.functionType)&&s.has(t)));var t}function i(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(t=e[0])&&r.has(t));var t}function a(e){return o(e)?`<function ${e.name||"λ"}>`:i(e)?`${t=e[0],Object.keys(n).find(e=>n[e]===t)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var t}function u(e,n,r={}){if(!function(e,t={}){return!("number"!=typeof e||Number.isNaN(e)||t.integer&&!Number.isInteger(e)||t.finite&&!Number.isFinite(e)||t.zero&&0!==e||t.nonZero&&0===e||t.positive&&e<=0||t.negative&&e>=0||t.nonPositive&&e>0||t.nonNegative&&e<0||"number"==typeof t.gt&&e<=t.gt||"number"==typeof t.gte&&e<t.gte||"number"==typeof t.lt&&e>=t.lt||"number"==typeof t.lte&&e>t.lte)}(e,r))throw new t(`Expected ${function(e){if(e.zero)return"zero";const t=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),n=e.integer?"integer":"number",r=e.finite?"finite":"",s=function(e){return"number"!=typeof e.gt&&"number"!=typeof e.gte||"number"!=typeof e.lt&&"number"!=typeof e.lte?"number"==typeof e.gt||"number"==typeof e.gte?"number"==typeof e.gt?`n > ${e.gt}`:`n >= ${e.gte}`:"number"==typeof e.lt||"number"==typeof e.lte?"number"==typeof e.lt?`n < ${e.lt}`:`n <= ${e.lte}`:"":`${"number"==typeof e.gt?`${e.gt} < n `:`${e.gte} <= n `}${"number"==typeof e.lt?`< ${e.lt}`:`<= ${e.lte}`}`}(e);return[t,r,n,s].filter(e=>!!e).join(" ")}(r)}, got ${a(e)}.`,function(e,t){return e?.sourceCodeInfo??t}(e,n))}function c(e){return{min:e,max:e}}const m={baseUnit:"rad",description:"angle",units:{deg:Math.PI/180,rad:1,grad:Math.PI/200,turn:2*Math.PI}};function l(e,t){switch(e){case"c":return t;case"f":return 9*t/5+32;case"k":return t+273.15}}function p(e,t){switch(e){case"c":return t;case"f":return 5*(t-32)/9;case"k":return t-273.15}}const f=["c","f","k"],g={angstrom:"ångströms",um:"micrometers",mm:"millimeters",cm:"centimeters",m:"meters",km:"kilometers",in:"inches",ft:"feet",yd:"yards",mi:"miles",nmi:"nautical miles",mg:"milligrams",g:"grams",kg:"kilograms",t:"metric tons",oz:"ounces",lb:"pounds",st:"stones",ml:"milliliters",cl:"centiliters",dl:"deciliters",l:"liters",tsp:"teaspoons",tbsp:"tablespoons","fl-oz":"fluid ounces",cup:"cups",pt:"pints",qt:"quarts",gal:"gallons",ms:"milliseconds",s:"seconds",min:"minutes",h:"hours",day:"days",week:"weeks",mm2:"square millimeters",cm2:"square centimeters",m2:"square meters",km2:"square kilometers",in2:"square inches",ft2:"square feet",yd2:"square yards",acre:"acres",hectare:"hectares","m/s":"meters per second","km/h":"kilometers per hour",mph:"miles per hour",kn:"knots","ft/s":"feet per second",b:"bytes",kb:"kilobytes",mb:"megabytes",gb:"gigabytes",tb:"terabytes",pb:"petabytes",pa:"pascals",kpa:"kilopascals",bar:"bars",atm:"atmospheres",psi:"pounds per square inch",mmhg:"millimeters of mercury",j:"joules",kj:"kilojoules",cal:"calories",kcal:"kilocalories",wh:"watt-hours",kwh:"kilowatt-hours",btu:"British thermal units",w:"watts",kw:"kilowatts",mw:"megawatts",hp:"horsepower",hz:"hertz",khz:"kilohertz",mhz:"megahertz",ghz:"gigahertz",deg:"degrees",rad:"radians",grad:"gradians",turn:"turns",c:"Celsius",f:"Fahrenheit",k:"Kelvin"};function b(e){const t={},n=Object.keys(e.units);for(const r of n)for(const s of n){if(r===s)continue;const o=e.units[r]/e.units[s],i=`${r}->${s}`,a=g[r],m=g[s],l=[`convert.${s}->${r}`,...n.filter(e=>e!==r&&e!==s).map(e=>`convert.${r}->${e}`)];t[i]={evaluate:([e],t)=>(u(e,t),e*o),arity:c(1),docs:{category:"convert",returns:{type:"number"},args:{value:{type:"number",description:`Value in ${a}`}},variants:[{argumentNames:["value"]}],description:`Converts a value from ${a} (\`${r}\`) to ${m} (\`${s}\`).`,seeAlso:l,examples:[`let { ${i} } = import(convert);\n${i}(1)`]}}}return t}const d={...b({baseUnit:"m",description:"length",units:{angstrom:1e-10,um:1e-6,mm:.001,cm:.01,m:1,km:1e3,in:.0254,ft:.3048,yd:.9144,mi:1609.344,nmi:1852}}),...b({baseUnit:"kg",description:"weight",units:{mg:1e-6,g:.001,kg:1,t:1e3,oz:.028349523125,lb:.45359237,st:6.35029318}}),...b({baseUnit:"l",description:"volume",units:{ml:.001,cl:.01,dl:.1,l:1,tsp:.00492892159375,tbsp:.01478676478125,"fl-oz":.0295735295625,cup:.2365882365,pt:.473176473,qt:.946352946,gal:3.785411784}}),...b({baseUnit:"s",description:"time",units:{ms:.001,s:1,min:60,h:3600,day:86400,week:604800}}),...b({baseUnit:"m2",description:"area",units:{mm2:1e-6,cm2:1e-4,m2:1,km2:1e6,in2:64516e-8,ft2:.09290304,yd2:.83612736,acre:4046.8564224,hectare:1e4}}),...b({baseUnit:"m/s",description:"speed",units:{"m/s":1,"km/h":1/3.6,mph:.44704,kn:.514444,"ft/s":.3048}}),...b({baseUnit:"b",description:"data",units:{b:1,kb:1e3,mb:1e6,gb:1e9,tb:1e12,pb:1e15}}),...b({baseUnit:"pa",description:"pressure",units:{pa:1,kpa:1e3,bar:1e5,atm:101325,psi:6894.757293168,mmhg:133.322387415}}),...b({baseUnit:"j",description:"energy",units:{j:1,kj:1e3,cal:4.184,kcal:4184,wh:3600,kwh:36e5,btu:1055.06}}),...b({baseUnit:"w",description:"power",units:{w:1,kw:1e3,mw:1e6,hp:745.7}}),...b({baseUnit:"hz",description:"frequency",units:{hz:1,khz:1e3,mhz:1e6,ghz:1e9}}),...b(m),...function(){const e={};for(const t of f)for(const n of f){if(t===n)continue;const r=`${t}->${n}`,s=g[t],o=g[n],i=[`convert.${n}->${t}`,...f.filter(e=>e!==t&&e!==n).map(e=>`convert.${t}->${e}`)];e[r]={evaluate:([e],r)=>{u(e,r);const s=p(t,e);return l(n,s)},arity:c(1),docs:{category:"convert",returns:{type:"number"},args:{value:{type:"number",description:`Value in ${s}`}},variants:[{argumentNames:["value"]}],description:`Converts a temperature from ${s} (\`${t}\`) to ${o} (\`${n}\`).`,seeAlso:i,examples:[`let { ${r} } = import(convert);\n${r}(100)`]}}}return e}()},h={name:"convert",functions:d,source:"{}",docs:(y=d,Object.fromEntries(Object.entries(y).map(([e,t])=>{if(!t.docs)throw new Error(`Missing docs for function "${e}"`);return[e,t.docs]})))};var y;exports.convertModule=h;
2
- //# sourceMappingURL=convert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/debug/debugTools.ts","../../src/utils/symbols.ts","../../src/typeGuards/number.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/utils/arity.ts","../../src/builtin/modules/convert/index.ts","../../src/builtin/modules/convert/convert.dvala","../../src/builtin/modules/interface.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getDvalaErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class DvalaError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getDvalaErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, DvalaError.prototype)\n this.name = 'DvalaError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends DvalaError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends DvalaError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends DvalaError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isDvalaError(error: unknown): error is DvalaError {\n return error instanceof DvalaError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'EffectMatcher',\n 'Builtin',\n 'SpecialBuiltin',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { AstNode, DvalaFunction } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isDvalaFunction(func: unknown): func is DvalaFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is AstNode {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isDvalaFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\nexport const EFFECT_SYMBOL = '^^ef^^'\n","import { DvalaError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\ntype SignOptions =\n | {\n positive?: true\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: true\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: true\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: true\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: true\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: true\n }\n\ntype GtOptions =\n | {\n gt?: number\n gte?: never\n }\n | {\n gt?: never\n gte?: number\n }\n\ntype LtOptions =\n | {\n lt?: number\n lte?: never\n }\n | {\n lt?: never\n lte?: number\n }\n\ntype NumberOptions = {\n integer?: true\n finite?: true\n} & SignOptions &\nGtOptions &\nLtOptions\n\nfunction getRangeString(options: NumberOptions): string {\n const hasUpperAndLowerBound\n = (typeof options.gt === 'number' || typeof options.gte === 'number')\n && (typeof options.lt === 'number' || typeof options.lte === 'number')\n if (hasUpperAndLowerBound) {\n return `${typeof options.gt === 'number' ? `${options.gt} < n ` : `${options.gte} <= n `}${\n typeof options.lt === 'number' ? `< ${options.lt}` : `<= ${options.lte}`\n }`\n }\n else if (typeof options.gt === 'number' || typeof options.gte === 'number') {\n return `${typeof options.gt === 'number' ? `n > ${options.gt}` : `n >= ${options.gte}`}`\n }\n else if (typeof options.lt === 'number' || typeof options.lte === 'number') {\n return `${typeof options.lt === 'number' ? `n < ${options.lt}` : `n <= ${options.lte}`}`\n }\n else { return '' }\n}\n\nfunction getSignString(options: NumberOptions): string {\n return options.positive\n ? 'positive'\n : options.negative\n ? 'negative'\n : options.nonNegative\n ? 'non negative'\n : options.nonPositive\n ? 'non positive'\n : options.nonZero\n ? 'non zero'\n : ''\n}\n\nfunction getNumberTypeName(options: NumberOptions): string {\n if (options.zero)\n return 'zero'\n\n const sign = getSignString(options)\n const numberType = options.integer ? 'integer' : 'number'\n const finite = options.finite ? 'finite' : ''\n const range = getRangeString(options)\n\n return [sign, finite, numberType, range].filter(x => !!x).join(' ')\n}\n\nexport function isNumber(value: unknown, options: NumberOptions = {}): value is number {\n if (typeof value !== 'number')\n return false\n\n if (Number.isNaN(value))\n return false\n\n if (options.integer && !Number.isInteger(value))\n return false\n\n if (options.finite && !Number.isFinite(value))\n return false\n\n if (options.zero && value !== 0)\n return false\n\n if (options.nonZero && value === 0)\n return false\n\n if (options.positive && value <= 0)\n return false\n\n if (options.negative && value >= 0)\n return false\n\n if (options.nonPositive && value > 0)\n return false\n\n if (options.nonNegative && value < 0)\n return false\n\n if (typeof options.gt === 'number' && value <= options.gt)\n return false\n\n if (typeof options.gte === 'number' && value < options.gte)\n return false\n\n if (typeof options.lt === 'number' && value >= options.lt)\n return false\n\n if (typeof options.lte === 'number' && value > options.lte)\n return false\n\n return true\n}\n\nexport function assertNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n options: NumberOptions = {},\n): asserts value is number {\n if (!isNumber(value, options)) {\n throw new DvalaError(\n `Expected ${getNumberTypeName(options)}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asNumber(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: NumberOptions = {},\n): number {\n assertNumber(value, sourceCodeInfo, options)\n return value\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import type { Arity } from '../builtin/interface'\nimport { DvalaError } from '../errors'\nimport type { FunctionLike } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isColl } from '../typeGuards/dvala'\nimport { valueToString } from './debug/debugTools'\n\nexport function arityAccepts(arity: Arity, nbrOfParams: number): boolean {\n const { min, max } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n if (typeof max === 'number' && nbrOfParams > max) {\n return false\n }\n return true\n}\n\nexport function arityAcceptsMin(arity: Arity, nbrOfParams: number): boolean {\n const { min } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n return true\n}\n\nexport function getCommonArityFromFunctions(params: FunctionLike[]): Arity | null {\n return params.reduce((acc: Arity | null, param): Arity | null => {\n if (acc === null) {\n return null\n }\n const arity: Arity = (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n const { min: aMin, max: aMax } = arity\n const { min: bMin, max: bMax } = acc\n const min = typeof aMin === 'number' && typeof bMin === 'number'\n ? Math.max(aMin, bMin)\n : typeof aMin === 'number' ? aMin : typeof bMin === 'number' ? bMin : undefined\n const max = typeof aMax === 'number' && typeof bMax === 'number'\n ? Math.min(aMax, bMax)\n : typeof aMax === 'number' ? aMax : typeof bMax === 'number' ? bMax : undefined\n\n if (typeof min === 'number' && typeof max === 'number' && min > max) {\n return null\n }\n\n return { min, max }\n }, {})\n}\n\nexport function getArityFromFunction(param: FunctionLike): Arity {\n return (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n}\n\nexport function assertNumberOfParams(arity: Arity, length: number, sourceCodeInfo: SourceCodeInfo | undefined): void {\n const { min, max } = arity\n if (typeof min === 'number' && length < min) {\n throw new DvalaError(\n `Wrong number of arguments, expected at least ${min}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n\n if (typeof max === 'number' && length > max) {\n throw new DvalaError(\n `Wrong number of arguments, expected at most ${max}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n}\n\nexport function canBeOperator(count: Arity): boolean {\n if (typeof count.max === 'number' && count.max < 2) {\n return false\n }\n\n if (typeof count.min === 'number' && count.min > 2) {\n return false\n }\n\n return true\n}\n\nexport function toFixedArity(arity: number): Arity {\n return { min: arity, max: arity }\n}\n","import { assertNumber } from '../../../typeGuards/number'\nimport { toFixedArity } from '../../../utils/arity'\nimport type { BuiltinNormalExpressions } from '../../interface'\nimport { moduleDocsFromFunctions } from '../interface'\nimport type { DvalaModule } from '../interface'\nimport convertModuleSource from './convert.dvala'\n\n// --- Conversion factor tables ---\n// Each category maps unit abbreviations to a factor relative to a base unit.\n// To convert from unit A to unit B: value * (factorA / factorB)\n// Temperature is special-cased (non-linear).\n\ninterface UnitCategory {\n baseUnit: string\n units: Record<string, number>\n description: string\n}\n\nconst lengthUnits: UnitCategory = {\n baseUnit: 'm',\n description: 'length',\n units: {\n angstrom: 1e-10,\n um: 0.000001,\n mm: 0.001,\n cm: 0.01,\n m: 1,\n km: 1000,\n in: 0.0254,\n ft: 0.3048,\n yd: 0.9144,\n mi: 1609.344,\n nmi: 1852,\n },\n}\n\nconst weightUnits: UnitCategory = {\n baseUnit: 'kg',\n description: 'weight',\n units: {\n mg: 0.000001,\n g: 0.001,\n kg: 1,\n t: 1000,\n oz: 0.028349523125,\n lb: 0.45359237,\n st: 6.35029318,\n },\n}\n\nconst volumeUnits: UnitCategory = {\n baseUnit: 'l',\n description: 'volume',\n units: {\n 'ml': 0.001,\n 'cl': 0.01,\n 'dl': 0.1,\n 'l': 1,\n 'tsp': 0.00492892159375,\n 'tbsp': 0.01478676478125,\n 'fl-oz': 0.0295735295625,\n 'cup': 0.2365882365,\n 'pt': 0.473176473,\n 'qt': 0.946352946,\n 'gal': 3.785411784,\n },\n}\n\nconst timeUnits: UnitCategory = {\n baseUnit: 's',\n description: 'time',\n units: {\n ms: 0.001,\n s: 1,\n min: 60,\n h: 3600,\n day: 86400,\n week: 604800,\n },\n}\n\nconst areaUnits: UnitCategory = {\n baseUnit: 'm2',\n description: 'area',\n units: {\n mm2: 0.000001,\n cm2: 0.0001,\n m2: 1,\n km2: 1000000,\n in2: 0.00064516,\n ft2: 0.09290304,\n yd2: 0.83612736,\n acre: 4046.8564224,\n hectare: 10000,\n },\n}\n\nconst speedUnits: UnitCategory = {\n baseUnit: 'm/s',\n description: 'speed',\n units: {\n 'm/s': 1,\n 'km/h': 1 / 3.6,\n 'mph': 0.44704,\n 'kn': 0.514444,\n 'ft/s': 0.3048,\n },\n}\n\nconst dataUnits: UnitCategory = {\n baseUnit: 'b',\n description: 'data',\n units: {\n b: 1,\n kb: 1000,\n mb: 1000000,\n gb: 1e9,\n tb: 1e12,\n pb: 1e15,\n },\n}\n\nconst pressureUnits: UnitCategory = {\n baseUnit: 'pa',\n description: 'pressure',\n units: {\n pa: 1,\n kpa: 1000,\n bar: 100000,\n atm: 101325,\n psi: 6894.757293168,\n mmhg: 133.322387415,\n },\n}\n\nconst energyUnits: UnitCategory = {\n baseUnit: 'j',\n description: 'energy',\n units: {\n j: 1,\n kj: 1000,\n cal: 4.184,\n kcal: 4184,\n wh: 3600,\n kwh: 3600000,\n btu: 1055.06,\n },\n}\n\nconst powerUnits: UnitCategory = {\n baseUnit: 'w',\n description: 'power',\n units: {\n w: 1,\n kw: 1000,\n mw: 1000000,\n hp: 745.7,\n },\n}\n\nconst frequencyUnits: UnitCategory = {\n baseUnit: 'hz',\n description: 'frequency',\n units: {\n hz: 1,\n khz: 1000,\n mhz: 1000000,\n ghz: 1000000000,\n },\n}\n\nconst angleUnits: UnitCategory = {\n baseUnit: 'rad',\n description: 'angle',\n units: {\n deg: Math.PI / 180,\n rad: 1,\n grad: Math.PI / 200,\n turn: 2 * Math.PI,\n },\n}\n\n// --- Temperature conversion functions ---\n\nfunction celsiusTo(unit: 'c' | 'f' | 'k', value: number): number {\n switch (unit) {\n case 'c': return value\n case 'f': return value * 9 / 5 + 32\n case 'k': return value + 273.15\n }\n}\n\nfunction toCelsius(unit: 'c' | 'f' | 'k', value: number): number {\n switch (unit) {\n case 'c': return value\n case 'f': return (value - 32) * 5 / 9\n case 'k': return value - 273.15\n }\n}\n\nconst temperatureUnits = ['c', 'f', 'k'] as const\n\nconst unitDescriptions: Record<string, string> = {\n // Length\n 'angstrom': 'ångströms',\n 'um': 'micrometers',\n 'mm': 'millimeters',\n 'cm': 'centimeters',\n 'm': 'meters',\n 'km': 'kilometers',\n 'in': 'inches',\n 'ft': 'feet',\n 'yd': 'yards',\n 'mi': 'miles',\n 'nmi': 'nautical miles',\n // Weight\n 'mg': 'milligrams',\n 'g': 'grams',\n 'kg': 'kilograms',\n 't': 'metric tons',\n 'oz': 'ounces',\n 'lb': 'pounds',\n 'st': 'stones',\n // Volume\n 'ml': 'milliliters',\n 'cl': 'centiliters',\n 'dl': 'deciliters',\n 'l': 'liters',\n 'tsp': 'teaspoons',\n 'tbsp': 'tablespoons',\n 'fl-oz': 'fluid ounces',\n 'cup': 'cups',\n 'pt': 'pints',\n 'qt': 'quarts',\n 'gal': 'gallons',\n // Time\n 'ms': 'milliseconds',\n 's': 'seconds',\n 'min': 'minutes',\n 'h': 'hours',\n 'day': 'days',\n 'week': 'weeks',\n // Area\n 'mm2': 'square millimeters',\n 'cm2': 'square centimeters',\n 'm2': 'square meters',\n 'km2': 'square kilometers',\n 'in2': 'square inches',\n 'ft2': 'square feet',\n 'yd2': 'square yards',\n 'acre': 'acres',\n 'hectare': 'hectares',\n // Speed\n 'm/s': 'meters per second',\n 'km/h': 'kilometers per hour',\n 'mph': 'miles per hour',\n 'kn': 'knots',\n 'ft/s': 'feet per second',\n // Data\n 'b': 'bytes',\n 'kb': 'kilobytes',\n 'mb': 'megabytes',\n 'gb': 'gigabytes',\n 'tb': 'terabytes',\n 'pb': 'petabytes',\n // Pressure\n 'pa': 'pascals',\n 'kpa': 'kilopascals',\n 'bar': 'bars',\n 'atm': 'atmospheres',\n 'psi': 'pounds per square inch',\n 'mmhg': 'millimeters of mercury',\n // Energy\n 'j': 'joules',\n 'kj': 'kilojoules',\n 'cal': 'calories',\n 'kcal': 'kilocalories',\n 'wh': 'watt-hours',\n 'kwh': 'kilowatt-hours',\n 'btu': 'British thermal units',\n // Power\n 'w': 'watts',\n 'kw': 'kilowatts',\n 'mw': 'megawatts',\n 'hp': 'horsepower',\n // Frequency\n 'hz': 'hertz',\n 'khz': 'kilohertz',\n 'mhz': 'megahertz',\n 'ghz': 'gigahertz',\n // Angle\n 'deg': 'degrees',\n 'rad': 'radians',\n 'grad': 'gradians',\n 'turn': 'turns',\n // Temperature\n 'c': 'Celsius',\n 'f': 'Fahrenheit',\n 'k': 'Kelvin',\n}\n\n// --- Generate linear conversion functions ---\n\nfunction generateLinearConversions(category: UnitCategory): BuiltinNormalExpressions {\n const result: BuiltinNormalExpressions = {}\n const unitNames = Object.keys(category.units)\n\n for (const from of unitNames) {\n for (const to of unitNames) {\n if (from === to)\n continue\n\n const fromFactor = category.units[from]!\n const toFactor = category.units[to]!\n const conversionFactor = fromFactor / toFactor\n const fnName = `${from}->${to}`\n const fromDesc = unitDescriptions[from]!\n const toDesc = unitDescriptions[to]!\n\n const seeAlso = [\n `convert.${to}->${from}`,\n ...unitNames\n .filter(u => u !== from && u !== to)\n .map(u => `convert.${from}->${u}`),\n ]\n\n result[fnName] = {\n evaluate: ([value], sourceCodeInfo): number => {\n assertNumber(value, sourceCodeInfo)\n return value * conversionFactor\n },\n arity: toFixedArity(1),\n docs: {\n category: 'convert',\n returns: { type: 'number' },\n args: {\n value: { type: 'number', description: `Value in ${fromDesc}` },\n },\n variants: [{ argumentNames: ['value'] }],\n description: `Converts a value from ${fromDesc} (\\`${from}\\`) to ${toDesc} (\\`${to}\\`).`,\n seeAlso,\n examples: [\n `let { ${fnName} } = import(convert);\n${fnName}(1)`,\n ],\n },\n }\n }\n }\n return result\n}\n\n// --- Generate temperature conversion functions ---\n\nfunction generateTemperatureConversions(): BuiltinNormalExpressions {\n const result: BuiltinNormalExpressions = {}\n\n for (const from of temperatureUnits) {\n for (const to of temperatureUnits) {\n if (from === to)\n continue\n\n const fnName = `${from}->${to}`\n const fromDesc = unitDescriptions[from]!\n const toDesc = unitDescriptions[to]!\n\n const seeAlso = [\n `convert.${to}->${from}`,\n ...temperatureUnits\n .filter(u => u !== from && u !== to)\n .map(u => `convert.${from}->${u}`),\n ]\n\n result[fnName] = {\n evaluate: ([value], sourceCodeInfo): number => {\n assertNumber(value, sourceCodeInfo)\n const celsius = toCelsius(from, value)\n return celsiusTo(to, celsius)\n },\n arity: toFixedArity(1),\n docs: {\n category: 'convert',\n returns: { type: 'number' },\n args: {\n value: { type: 'number', description: `Value in ${fromDesc}` },\n },\n variants: [{ argumentNames: ['value'] }],\n description: `Converts a temperature from ${fromDesc} (\\`${from}\\`) to ${toDesc} (\\`${to}\\`).`,\n seeAlso,\n examples: [\n `let { ${fnName} } = import(convert);\n${fnName}(100)`,\n ],\n },\n }\n }\n }\n return result\n}\n\n// --- Assemble all conversion functions ---\n\nconst convertFunctions: BuiltinNormalExpressions = {\n ...generateLinearConversions(lengthUnits),\n ...generateLinearConversions(weightUnits),\n ...generateLinearConversions(volumeUnits),\n ...generateLinearConversions(timeUnits),\n ...generateLinearConversions(areaUnits),\n ...generateLinearConversions(speedUnits),\n ...generateLinearConversions(dataUnits),\n ...generateLinearConversions(pressureUnits),\n ...generateLinearConversions(energyUnits),\n ...generateLinearConversions(powerUnits),\n ...generateLinearConversions(frequencyUnits),\n ...generateLinearConversions(angleUnits),\n ...generateTemperatureConversions(),\n}\n\nexport const convertModule: DvalaModule = {\n name: 'convert',\n functions: convertFunctions,\n source: convertModuleSource,\n docs: moduleDocsFromFunctions(convertFunctions),\n}\n","{}","import type { BuiltinNormalExpressions, FunctionDocs } from '../../builtin/interface'\n\n/**\n * Represents a Dvala module that can be imported dynamically.\n * Modules contain a collection of functions that are not part of the core bundle.\n */\nexport interface DvalaModule {\n /** The name of the module (e.g., 'grid', 'vec', 'mat') */\n name: string\n /** The functions provided by this module, keyed by their short name (e.g., 'transpose') */\n functions: BuiltinNormalExpressions\n /**\n * Optional Dvala source code that is evaluated at import time.\n * The source must evaluate to an object mapping function names to functions.\n * These are merged with (and may override) the TypeScript `functions`.\n */\n source?: string\n /**\n * Docs for all functions in this module, including any defined in `source`.\n * The reference system uses this record as the sole source of truth for\n * function names and documentation. Not required for user-defined modules.\n */\n docs?: Record<string, FunctionDocs>\n}\n\n/**\n * Derives a docs record from a BuiltinNormalExpressions map.\n * Use this for modules whose docs are co-located inline on each function.\n */\nexport function moduleDocsFromFunctions(functions: BuiltinNormalExpressions): Record<string, FunctionDocs> {\n return Object.fromEntries(\n Object.entries(functions).map(([k, v]) => {\n if (!v.docs)\n throw new Error(`Missing docs for function \"${k}\"`)\n return [k, v.docs]\n }),\n )\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","DvalaError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getDvalaErrorMessage","this","Object","setPrototypeOf","prototype","name","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","isDvalaFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","assertNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","isNumber","sign","getSignString","numberType","range","getRangeString","filter","x","join","getNumberTypeName","anyValue","getSourceCodeInfo","toFixedArity","arity","min","angleUnits","baseUnit","description","units","deg","PI","rad","grad","turn","celsiusTo","unit","toCelsius","temperatureUnits","unitDescriptions","angstrom","um","mm","cm","m","km","in","ft","yd","mi","nmi","mg","g","kg","t","oz","lb","st","ml","cl","dl","l","tsp","tbsp","cup","pt","qt","gal","ms","s","h","day","week","mm2","cm2","m2","km2","in2","ft2","yd2","acre","hectare","mph","kn","b","kb","mb","gb","tb","pb","pa","kpa","bar","atm","psi","mmhg","j","kj","cal","kcal","wh","kwh","btu","w","kw","mw","hp","hz","khz","mhz","ghz","c","f","k","generateLinearConversions","category","result","unitNames","from","to","conversionFactor","fnName","fromDesc","toDesc","seeAlso","u","map","evaluate","docs","returns","args","variants","argumentNames","examples","convertFunctions","celsius","generateTemperatureConversions","convertModule","functions","source","fromEntries","entries","v"],"mappings":"aAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,UAAmBC,MACdX,eACAY,aAChB,WAAAC,CAAYC,EAAcd,GACxB,MAAMe,EAAUD,aAAeH,MAC3BG,EAAIC,QACJ,GAAGD,IAEPE,MA/BJ,SAA8BD,EAAiBf,GAC7C,IAAKA,EACH,OAAOe,EAET,MAAME,EAAW,GAAGjB,EAAeC,SAASiB,QAAQlB,EAAeC,SAASG,SAM5E,MAAO,GAAGW,IALWf,EAAemB,SAChC,KAAKnB,EAAemB,YAAYF,IAChC,cAAcA,QACIj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SAAU,UACVc,QAAS,CAAEtJ,KAAM,UACjBuJ,KAAM,CACJnJ,MAAO,CAAEJ,KAAM,SAAUiD,YAAa,YAAY8F,MAEpDS,SAAU,CAAC,CAAEC,cAAe,CAAC,WAC7BxG,YAAa,+BAA+B8F,QAAeJ,WAAcK,QAAaJ,QACtFK,UACAS,SAAU,CACR,SAASZ,2BACnBA,WAIG,CAEH,OAAOL,CACT,CAiBKoB,IAGQC,EAA6B,CACxChL,KAAM,UACNiL,UAAWJ,EACXK,OCraa,KDsabX,MEzYsCU,EFyYRJ,EExYvBhL,OAAOsL,YACZtL,OAAOuL,QAAQH,GAAWZ,IAAI,EAAEb,EAAG6B,MACjC,IAAKA,EAAEd,KACL,MAAM,IAAIrL,MAAM,8BAA8BsK,MAChD,MAAO,CAACA,EAAG6B,EAAEd,WALb,IAAkCU"}
@@ -1,2 +0,0 @@
1
- function n(n){if(!n.position||!n.code)return"";const e=n.position.column-1,t=n.code.length-e-1;return`${" ".repeat(Math.max(e,0))}^${" ".repeat(Math.max(t,0))}`}class e extends Error{sourceCodeInfo;shortMessage;constructor(t,r){const o=t instanceof Error?t.message:`${t}`;super(function(e,t){if(!t)return e;const r=`${t.position.line}:${t.position.column}`;return`${e}${t.filePath?`\n${t.filePath}:${r}`:`\nLocation ${r}`}\n${t.code}\n${n(t)}`}(o,r)),this.shortMessage=o,this.sourceCodeInfo=r,Object.setPrototypeOf(this,e.prototype),this.name="DvalaError"}getCodeMarker(){return this.sourceCodeInfo&&n(this.sourceCodeInfo)}}const t={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},r=new Set(Object.values(t));const o=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","EffectMatcher","Builtin","SpecialBuiltin","Module"]);const u="^^fn^^",a="^^re^^",i="^^ef^^";function s(n){return null!==n&&"object"==typeof n&&(u in n&&"functionType"in n&&("string"==typeof(e=n.functionType)&&o.has(e)));var e}function l(n){return!(!Array.isArray(n)||n.length<2)&&("number"==typeof(e=n[0])&&r.has(e));var e}function c(n){return s(n)?`<function ${n.name||"λ"}>`:l(n)?`${e=n[0],Object.keys(t).find(n=>t[n]===e)}-node`:null===n?"null":"object"==typeof n&&n instanceof RegExp?`${n}`:"object"==typeof n&&n instanceof Error?n.toString():JSON.stringify(n);var e}function f(n){return null!==n&&"object"==typeof n&&!!n[u]}function m(n){return!(null===n||"object"!=typeof n||Array.isArray(n)||n instanceof RegExp||f(n)||(e=n,null!==e&&"object"==typeof e&&e[a])||function(n){return null!==n&&"object"==typeof n&&!!n[i]}(n));var e}function p(n){return function(n){return Array.isArray(n)||"string"==typeof n}(n)||m(n)}function y(n,e){return d(n,e),n}function d(n,t){if(!function(n){return"number"==typeof n||!!p(n)||!!f(n)}(n))throw function(n,t,r){return new e(`Expected ${n}, got ${c(t)}.`,function(n,e){return n?.sourceCodeInfo??e}(t,r))}("FunctionLike",n,t)}function g(n){return"number"==typeof n||p(n)?h(1):n.arity}function h(n){return{min:n,max:n}}const b={juxt:{evaluate:(n,t)=>{n.forEach(n=>d(n,t));const r=function(n){return n.reduce((n,e)=>{if(null===n)return null;const t="number"==typeof e||p(e)?h(1):e.arity,{min:r,max:o}=t,{min:u,max:a}=n,i="number"==typeof r&&"number"==typeof u?Math.max(r,u):"number"==typeof r?r:"number"==typeof u?u:void 0,s="number"==typeof o&&"number"==typeof a?Math.min(o,a):"number"==typeof o?o:"number"==typeof a?a:void 0;return"number"==typeof i&&"number"==typeof s&&i>s?null:{min:i,max:s}},{})}(n);if(null===r)throw new e("All functions must accept the same number of arguments",t);return{[u]:!0,sourceCodeInfo:t,functionType:"Juxt",params:n,arity:r}},arity:{min:1},docs:{category:"functional",returns:{type:"function"},args:{a:{type:"function"},b:{type:"function"},fun:{type:"function"},fns:{type:"function",rest:!0}},variants:[{argumentNames:["fun"]},{argumentNames:["fun","fns"]}],description:"Takes one or many function and returns a function that is the juxtaposition of those functions.\nThe returned function takes a variable number of args,\nand returns a vector containing the result of applying each function to the args (left-to-right).",seeAlso:["comp"],examples:["let { juxt } = import(functional);\njuxt(+, *, min, max)(\n 3,\n 4,\n 6,\n)",'let { juxt } = import(functional);\njuxt("a", "b")(\n {\n a: 1,\n b: 2,\n c: 3,\n d: 4\n }\n)',"let { juxt } = import(functional);\njuxt(+, *, min, max) apply range(1, 11)"]}},complement:{evaluate:([n],e)=>{const t=y(n,e);return{[u]:!0,sourceCodeInfo:e,functionType:"Complement",function:t,arity:g(t)}},arity:h(1),docs:{category:"functional",returns:{type:"function"},args:{fun:{type:"function"}},variants:[{argumentNames:["fun"]}],description:"Takes a function $fun and returns a new function that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value.",seeAlso:["comp","functional.every-pred","functional.some-pred"],examples:["let { complement } = import(functional);\ncomplement(>)(1, 3)","let { complement } = import(functional);\ncomplement(<)(1, 3)","let { complement } = import(functional);\ncomplement(+)(1, 3)","let { complement } = import(functional);\ncomplement(+)(0, 0)"]}},"every-pred":{evaluate:(n,e)=>({[u]:!0,sourceCodeInfo:e,functionType:"EveryPred",params:n,arity:{min:1,max:1}}),arity:{min:1},docs:{category:"functional",returns:{type:"function"},args:{fun:{type:"function"},fns:{type:"function",rest:!0}},variants:[{argumentNames:["fun"]},{argumentNames:["fun","fns"]}],description:"\nTakes a number of predicates and returns a function that returns `true` if all predicates\nreturn a truthy value against all of its arguments, else it returns `false`.",seeAlso:["functional.some-pred","functional.complement","collection.every?"],examples:['let { every-pred } = import(functional);\nevery-pred(string?, -> count($) > 3)(\n "Albert",\n "Mojir"\n)','let { every-pred } = import(functional);\n(string? every-pred -> count($) > 3)(\n "Albert",\n "M"\n)'],hideOperatorForm:!0}},"some-pred":{evaluate:(n,e)=>({[u]:!0,sourceCodeInfo:e,functionType:"SomePred",params:n,arity:{min:1,max:1}}),arity:{min:1},docs:{category:"functional",returns:{type:"function"},args:{fun:{type:"function"},fns:{type:"function",rest:!0}},variants:[{argumentNames:["fun"]},{argumentNames:["fun","fns"]}],description:"Takes a number of `predicates` and returns a function that returns `true` if at least one of the `predicates` return a truthy `true` value against at least one of its arguments, else it returns `false`.",seeAlso:["functional.every-pred","functional.complement","collection.any?"],examples:['let { some-pred } = import(functional);\nsome-pred(string?, -> count($) > 3)("Albert", "Mojir")','let { some-pred } = import(functional);\nsome-pred(string?, -> count($) > 3)("a", "M")','let { some-pred } = import(functional);\nsome-pred(string?, -> count($) > 3)("a", [1, 2, 3])',"let { some-pred } = import(functional);\nsome-pred(string?, -> count($) > 3)([1, 2, 3], [2])"],hideOperatorForm:!0}},fnull:{evaluate:([n,...e],t)=>{const r=y(n,t);return{[u]:!0,sourceCodeInfo:t,functionType:"Fnull",function:r,params:e,arity:g(r)}},arity:{min:2},docs:{category:"functional",returns:{type:"function"},args:{a:{type:"function"},b:{type:"any"},fun:{type:"function"},arg:{type:"any"},args:{type:"any",rest:!0}},variants:[{argumentNames:["fun","arg"]},{argumentNames:["fun","arg","args"]}],description:"Takes a function $fun, and returns a function that calls $fun, replacing a null argument to the corresponding argument.",seeAlso:["identity","constantly"],examples:["let { fnull } = import(functional);\nfnull(inc, 0)(1)","let { fnull } = import(functional);\nfnull(inc, 0)(null)","let { fnull } = import(functional);\n(inc fnull 0)(null)","let { fnull } = import(functional);\nfnull(+, 1, 2)(null, 0)","let { fnull } = import(functional);\nfnull(+, 1, 2)(0, null)","let { fnull } = import(functional);\nfnull(+, 1, 2)(null, null)","let { fnull } = import(functional);\nfnull(+, 1, 2)(null, null, 3, 4)"]}}},v={name:"functional",functions:b,source:"{}",docs:(x=b,Object.fromEntries(Object.entries(x).map(([n,e])=>{if(!e.docs)throw new Error(`Missing docs for function "${n}"`);return[n,e.docs]})))};var x;export{v as functionalUtilsModule};
2
- //# sourceMappingURL=functional.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"functional.esm.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/symbols.ts","../../src/utils/debug/debugTools.ts","../../src/typeGuards/dvalaFunction.ts","../../src/typeGuards/dvala.ts","../../src/utils/getAssertionError.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/utils/arity.ts","../../src/builtin/modules/functional/index.ts","../../src/builtin/modules/functional/functional.dvala","../../src/builtin/modules/interface.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getDvalaErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class DvalaError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getDvalaErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, DvalaError.prototype)\n this.name = 'DvalaError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends DvalaError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends DvalaError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends DvalaError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isDvalaError(error: unknown): error is DvalaError {\n return error instanceof DvalaError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'EffectMatcher',\n 'Builtin',\n 'SpecialBuiltin',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\nexport const EFFECT_SYMBOL = '^^ef^^'\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { AstNode, DvalaFunction } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isDvalaFunction(func: unknown): func is DvalaFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is AstNode {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isDvalaFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","import type { DvalaFunction, NormalBuiltinFunction, UserDefinedFunction } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { FUNCTION_SYMBOL } from '../utils/symbols'\nimport { isUnknownRecord } from '.'\n\nexport function isDvalaFunction(value: unknown): value is DvalaFunction {\n if (value === null || typeof value !== 'object')\n return false\n\n return !!(value as DvalaFunction)[FUNCTION_SYMBOL]\n}\nexport function asDvalaFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): DvalaFunction {\n assertDvalaFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertDvalaFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is DvalaFunction {\n if (!isDvalaFunction(value))\n throw getAssertionError('DvalaFunction', value, sourceCodeInfo)\n}\n\nexport function isUserDefinedFunction(value: unknown): value is UserDefinedFunction {\n return isDvalaFunction(value) && value.functionType === 'UserDefined'\n}\nexport function asUserDefinedFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): UserDefinedFunction {\n assertUserDefinedFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertUserDefinedFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is UserDefinedFunction {\n if (!isUserDefinedFunction(value))\n throw getAssertionError('UserDefinedFunction', value, sourceCodeInfo)\n}\n\nexport function isBuiltinFunction(value: unknown): value is NormalBuiltinFunction {\n return isUnknownRecord(value) && value.functionType === 'Builtin'\n}\n","import type { Any, Coll, Obj, Seq } from '../interface'\nimport type { EffectRef, FunctionLike, RegularExpression } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { EFFECT_SYMBOL, REGEXP_SYMBOL } from '../utils/symbols'\nimport { isDvalaFunction } from './dvalaFunction'\n\nexport function isAny(value: unknown): value is Any {\n // TODO weak test\n return value !== undefined\n}\nexport function asAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): Any {\n assertAny(value, sourceCodeInfo)\n return value\n}\nexport function assertAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Any {\n if (!isAny(value))\n throw getAssertionError('not undefined', value, sourceCodeInfo)\n}\n\nexport function isSeq(value: unknown): value is Seq {\n return Array.isArray(value) || typeof value === 'string'\n}\nexport function asSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): Seq {\n assertSeq(value, sourceCodeInfo)\n return value\n}\nexport function assertSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Seq {\n if (!isSeq(value))\n throw getAssertionError('string or array', value, sourceCodeInfo)\n}\n\nexport function isObj(value: unknown): value is Obj {\n return !(\n value === null\n || typeof value !== 'object'\n || Array.isArray(value)\n || value instanceof RegExp\n || isDvalaFunction(value)\n || isRegularExpression(value)\n || isEffect(value)\n )\n}\nexport function asObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): Obj {\n assertObj(value, sourceCodeInfo)\n return value\n}\nexport function assertObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Obj {\n if (!isObj(value))\n throw getAssertionError('object', value, sourceCodeInfo)\n}\n\nexport function isColl(value: unknown): value is Coll {\n return isSeq(value) || isObj(value)\n}\nexport function asColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): Coll {\n assertColl(value, sourceCodeInfo)\n return value\n}\nexport function assertColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Coll {\n if (!isColl(value))\n throw getAssertionError('string, array or object', value, sourceCodeInfo)\n}\n\nexport function isRegularExpression(regexp: unknown): regexp is RegularExpression {\n if (regexp === null || typeof regexp !== 'object')\n return false\n\n return !!(regexp as RegularExpression)[REGEXP_SYMBOL]\n}\nexport function asRegularExpression(value: unknown, sourceCodeInfo?: SourceCodeInfo): RegularExpression {\n assertRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is RegularExpression {\n if (!isRegularExpression(value))\n throw getAssertionError('RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isStringOrRegularExpression(value: unknown): value is string | RegularExpression {\n return isRegularExpression(value) || typeof value === 'string'\n}\nexport function asStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): string | RegularExpression {\n assertStringOrRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | RegularExpression {\n if (!isStringOrRegularExpression(value))\n throw getAssertionError('string or RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isEffect(value: unknown): value is EffectRef {\n if (value === null || typeof value !== 'object')\n return false\n\n return !!(value as EffectRef)[EFFECT_SYMBOL]\n}\nexport function asEffect(value: unknown, sourceCodeInfo?: SourceCodeInfo): EffectRef {\n assertEffect(value, sourceCodeInfo)\n return value\n}\nexport function assertEffect(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is EffectRef {\n if (!isEffect(value))\n throw getAssertionError('Effect', value, sourceCodeInfo)\n}\n\nfunction isFunctionLike(value: unknown): value is FunctionLike {\n if (typeof value === 'number')\n return true\n if (isColl(value))\n return true\n if (isDvalaFunction(value))\n return true\n\n return false\n}\nexport function asFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): FunctionLike {\n assertFunctionLike(value, sourceCodeInfo)\n return value\n}\nexport function assertFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is FunctionLike {\n if (!isFunctionLike(value))\n throw getAssertionError('FunctionLike', value, sourceCodeInfo)\n}\n","import { DvalaError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from './debug/debugTools'\nimport { getSourceCodeInfo } from './debug/getSourceCodeInfo'\n\nexport function getAssertionError(typeName: string, value: unknown, sourceCodeInfo?: SourceCodeInfo): DvalaError {\n return new DvalaError(`Expected ${typeName}, got ${valueToString(value)}.`, getSourceCodeInfo(value, sourceCodeInfo))\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import type { Arity } from '../builtin/interface'\nimport { DvalaError } from '../errors'\nimport type { FunctionLike } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isColl } from '../typeGuards/dvala'\nimport { valueToString } from './debug/debugTools'\n\nexport function arityAccepts(arity: Arity, nbrOfParams: number): boolean {\n const { min, max } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n if (typeof max === 'number' && nbrOfParams > max) {\n return false\n }\n return true\n}\n\nexport function arityAcceptsMin(arity: Arity, nbrOfParams: number): boolean {\n const { min } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n return true\n}\n\nexport function getCommonArityFromFunctions(params: FunctionLike[]): Arity | null {\n return params.reduce((acc: Arity | null, param): Arity | null => {\n if (acc === null) {\n return null\n }\n const arity: Arity = (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n const { min: aMin, max: aMax } = arity\n const { min: bMin, max: bMax } = acc\n const min = typeof aMin === 'number' && typeof bMin === 'number'\n ? Math.max(aMin, bMin)\n : typeof aMin === 'number' ? aMin : typeof bMin === 'number' ? bMin : undefined\n const max = typeof aMax === 'number' && typeof bMax === 'number'\n ? Math.min(aMax, bMax)\n : typeof aMax === 'number' ? aMax : typeof bMax === 'number' ? bMax : undefined\n\n if (typeof min === 'number' && typeof max === 'number' && min > max) {\n return null\n }\n\n return { min, max }\n }, {})\n}\n\nexport function getArityFromFunction(param: FunctionLike): Arity {\n return (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n}\n\nexport function assertNumberOfParams(arity: Arity, length: number, sourceCodeInfo: SourceCodeInfo | undefined): void {\n const { min, max } = arity\n if (typeof min === 'number' && length < min) {\n throw new DvalaError(\n `Wrong number of arguments, expected at least ${min}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n\n if (typeof max === 'number' && length > max) {\n throw new DvalaError(\n `Wrong number of arguments, expected at most ${max}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n}\n\nexport function canBeOperator(count: Arity): boolean {\n if (typeof count.max === 'number' && count.max < 2) {\n return false\n }\n\n if (typeof count.min === 'number' && count.min > 2) {\n return false\n }\n\n return true\n}\n\nexport function toFixedArity(arity: number): Arity {\n return { min: arity, max: arity }\n}\n","import type { Arr } from '../../../interface'\nimport type {\n ComplementFunction,\n EveryPredFunction,\n FNullFunction,\n FunctionLike,\n JuxtFunction,\n SomePredFunction,\n} from '../../../parser/types'\nimport { getArityFromFunction, getCommonArityFromFunctions, toFixedArity } from '../../../utils/arity'\nimport { FUNCTION_SYMBOL } from '../../../utils/symbols'\nimport type { BuiltinNormalExpressions } from '../../interface'\nimport { asFunctionLike, assertFunctionLike } from '../../../typeGuards/dvala'\nimport { DvalaError } from '../../../errors'\nimport { moduleDocsFromFunctions } from '../interface'\nimport type { DvalaModule } from '../interface'\nimport functionalModuleSource from './functional.dvala'\n\nconst functionalUtilsNormalExpression: BuiltinNormalExpressions = {\n 'juxt': {\n evaluate: (params, sourceCodeInfo): JuxtFunction => {\n params.forEach(param => assertFunctionLike(param, sourceCodeInfo))\n const arity = getCommonArityFromFunctions(params as FunctionLike[])\n if (arity === null) {\n throw new DvalaError('All functions must accept the same number of arguments', sourceCodeInfo)\n }\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'Juxt',\n params,\n arity,\n }\n },\n arity: { min: 1 },\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: {\n a: { type: 'function' },\n b: { type: 'function' },\n fun: { type: 'function' },\n fns: { type: 'function', rest: true },\n },\n variants: [\n { argumentNames: ['fun'] },\n { argumentNames: ['fun', 'fns'] },\n ],\n description: `Takes one or many function and returns a function that is the juxtaposition of those functions.\nThe returned function takes a variable number of args,\nand returns a vector containing the result of applying each function to the args (left-to-right).`,\n seeAlso: ['comp'],\n examples: [\n `let { juxt } = import(functional);\njuxt(+, *, min, max)(\n 3,\n 4,\n 6,\n)`,\n `let { juxt } = import(functional);\njuxt(\"a\", \"b\")(\n {\n a: 1,\n b: 2,\n c: 3,\n d: 4\n }\n)`,\n `let { juxt } = import(functional);\njuxt(+, *, min, max) apply range(1, 11)`,\n ],\n },\n },\n\n 'complement': {\n evaluate: ([fn], sourceCodeInfo): ComplementFunction => {\n const fun = asFunctionLike(fn, sourceCodeInfo)\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'Complement',\n function: fun,\n arity: getArityFromFunction(fun),\n }\n },\n arity: toFixedArity(1),\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: { fun: { type: 'function' } },\n variants: [{ argumentNames: ['fun'] }],\n description: 'Takes a function $fun and returns a new function that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value.',\n seeAlso: ['comp', 'functional.every-pred', 'functional.some-pred'],\n examples: [\n 'let { complement } = import(functional);\\ncomplement(>)(1, 3)',\n 'let { complement } = import(functional);\\ncomplement(<)(1, 3)',\n 'let { complement } = import(functional);\\ncomplement(+)(1, 3)',\n 'let { complement } = import(functional);\\ncomplement(+)(0, 0)',\n ],\n },\n },\n\n 'every-pred': {\n evaluate: (params, sourceCodeInfo): EveryPredFunction => {\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'EveryPred',\n params,\n arity: { min: 1, max: 1 },\n }\n },\n arity: { min: 1 },\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: {\n fun: { type: 'function' },\n fns: { type: 'function', rest: true },\n },\n variants: [\n { argumentNames: ['fun'] },\n { argumentNames: ['fun', 'fns'] },\n ],\n description: `\nTakes a number of predicates and returns a function that returns \\`true\\` if all predicates\nreturn a truthy value against all of its arguments, else it returns \\`false\\`.`,\n seeAlso: ['functional.some-pred', 'functional.complement', 'collection.every?'],\n examples: [\n `let { every-pred } = import(functional);\nevery-pred(string?, -> count($) > 3)(\n \"Albert\",\n \"Mojir\"\n)`,\n `let { every-pred } = import(functional);\n(string? every-pred -> count($) > 3)(\n \"Albert\",\n \"M\"\n)`,\n ],\n hideOperatorForm: true,\n },\n },\n\n 'some-pred': {\n evaluate: (params, sourceCodeInfo): SomePredFunction => {\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'SomePred',\n params,\n arity: { min: 1, max: 1 },\n }\n },\n arity: { min: 1 },\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: {\n fun: { type: 'function' },\n fns: { type: 'function', rest: true },\n },\n variants: [\n { argumentNames: ['fun'] },\n { argumentNames: ['fun', 'fns'] },\n ],\n description: 'Takes a number of `predicates` and returns a function that returns `true` if at least one of the `predicates` return a truthy `true` value against at least one of its arguments, else it returns `false`.',\n seeAlso: ['functional.every-pred', 'functional.complement', 'collection.any?'],\n examples: [\n 'let { some-pred } = import(functional);\\nsome-pred(string?, -> count($) > 3)(\"Albert\", \"Mojir\")',\n 'let { some-pred } = import(functional);\\nsome-pred(string?, -> count($) > 3)(\"a\", \"M\")',\n 'let { some-pred } = import(functional);\\nsome-pred(string?, -> count($) > 3)(\"a\", [1, 2, 3])',\n 'let { some-pred } = import(functional);\\nsome-pred(string?, -> count($) > 3)([1, 2, 3], [2])',\n ],\n hideOperatorForm: true,\n },\n },\n\n 'fnull': {\n evaluate: ([fn, ...params]: Arr, sourceCodeInfo): FNullFunction => {\n const fun = asFunctionLike(fn, sourceCodeInfo)\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'Fnull',\n function: fun,\n params,\n arity: getArityFromFunction(fun),\n }\n },\n arity: { min: 2 },\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: {\n a: { type: 'function' },\n b: { type: 'any' },\n fun: { type: 'function' },\n arg: { type: 'any' },\n args: { type: 'any', rest: true },\n },\n variants: [\n { argumentNames: ['fun', 'arg'] },\n { argumentNames: ['fun', 'arg', 'args'] },\n ],\n description: 'Takes a function $fun, and returns a function that calls $fun, replacing a null argument to the corresponding argument.',\n seeAlso: ['identity', 'constantly'],\n examples: [\n 'let { fnull } = import(functional);\\nfnull(inc, 0)(1)',\n 'let { fnull } = import(functional);\\nfnull(inc, 0)(null)',\n 'let { fnull } = import(functional);\\n(inc fnull 0)(null)',\n 'let { fnull } = import(functional);\\nfnull(+, 1, 2)(null, 0)',\n 'let { fnull } = import(functional);\\nfnull(+, 1, 2)(0, null)',\n 'let { fnull } = import(functional);\\nfnull(+, 1, 2)(null, null)',\n 'let { fnull } = import(functional);\\nfnull(+, 1, 2)(null, null, 3, 4)',\n ],\n },\n },\n}\n\nexport const functionalUtilsModule: DvalaModule = {\n name: 'functional',\n functions: functionalUtilsNormalExpression,\n source: functionalModuleSource,\n docs: moduleDocsFromFunctions(functionalUtilsNormalExpression),\n}\n","{}","import type { BuiltinNormalExpressions, FunctionDocs } from '../../builtin/interface'\n\n/**\n * Represents a Dvala module that can be imported dynamically.\n * Modules contain a collection of functions that are not part of the core bundle.\n */\nexport interface DvalaModule {\n /** The name of the module (e.g., 'grid', 'vec', 'mat') */\n name: string\n /** The functions provided by this module, keyed by their short name (e.g., 'transpose') */\n functions: BuiltinNormalExpressions\n /**\n * Optional Dvala source code that is evaluated at import time.\n * The source must evaluate to an object mapping function names to functions.\n * These are merged with (and may override) the TypeScript `functions`.\n */\n source?: string\n /**\n * Docs for all functions in this module, including any defined in `source`.\n * The reference system uses this record as the sole source of truth for\n * function names and documentation. Not required for user-defined modules.\n */\n docs?: Record<string, FunctionDocs>\n}\n\n/**\n * Derives a docs record from a BuiltinNormalExpressions map.\n * Use this for modules whose docs are co-located inline on each function.\n */\nexport function moduleDocsFromFunctions(functions: BuiltinNormalExpressions): Record<string, FunctionDocs> {\n return Object.fromEntries(\n Object.entries(functions).map(([k, v]) => {\n if (!v.docs)\n throw new Error(`Missing docs for function \"${k}\"`)\n return [k, v.docs]\n }),\n )\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","DvalaError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getDvalaErrorMessage","this","Object","setPrototypeOf","prototype","name","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","FUNCTION_SYMBOL","REGEXP_SYMBOL","EFFECT_SYMBOL","isDvalaFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","isObj","regexp","isEffect","isColl","isSeq","asFunctionLike","assertFunctionLike","isFunctionLike","typeName","anyValue","getSourceCodeInfo","getAssertionError","getArityFromFunction","param","toFixedArity","arity","min","functionalUtilsNormalExpression","juxt","evaluate","params","forEach","reduce","acc","aMin","aMax","bMin","bMax","undefined","getCommonArityFromFunctions","docs","category","returns","args","a","b","fun","fns","rest","variants","argumentNames","description","seeAlso","examples","complement","fn","function","hideOperatorForm","fnull","arg","functionalUtilsModule","functions","source","fromEntries","entries","map","k","v"],"mappings":"AAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,UAAmBC,MACdX,eACAY,aAChB,WAAAC,CAAYC,EAAcd,GACxB,MAAMe,EAAUD,aAAeH,MAC3BG,EAAIC,QACJ,GAAGD,IAEPE,MA/BJ,SAA8BD,EAAiBf,GAC7C,IAAKA,EACH,OAAOe,EAET,MAAME,EAAW,GAAGjB,EAAeC,SAASiB,QAAQlB,EAAeC,SAASG,SAM5E,MAAO,GAAGW,IALWf,EAAemB,SAChC,KAAKnB,EAAemB,YAAYF,IAChC,cAAcA,QACIjB,EAAeE,SACbH,EAAcC,IAExC,CAoBUoB,CAAqBL,EAASf,IACpCqB,KAAKT,aAAeG,EACpBM,KAAKrB,eAAiBA,EACtBsB,OAAOC,eAAeF,KAAMX,EAAWc,WACvCH,KAAKI,KAAO,YACb,CAEM,aAAA1B,GACL,OAAO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,KAAM,CACJC,SAAU,aACVC,QAAS,CAAE/C,KAAM,YACjBgD,KAAM,CACJC,EAAG,CAAEjD,KAAM,YACXkD,EAAG,CAAElD,KAAM,OACXmD,IAAK,CAAEnD,KAAM,YACbgE,IAAK,CAAEhE,KAAM,OACbgD,KAAM,CAAEhD,KAAM,MAAOqD,MAAM,IAE7BC,SAAU,CACR,CAAEC,cAAe,CAAC,MAAO,QACzB,CAAEA,cAAe,CAAC,MAAO,MAAO,UAElCC,YAAa,0HACbC,QAAS,CAAC,WAAY,cACtBC,SAAU,CACR,wDACA,2DACA,2DACA,+DACA,+DACA,kEACA,4EAMKO,EAAqC,CAChDtF,KAAM,aACNuF,UAAWlC,EACXmC,OC/Na,KDgObtB,MEnMsCqB,EFmMRlC,EElMvBxD,OAAO4F,YACZ5F,OAAO6F,QAAQH,GAAWI,IAAI,EAAEC,EAAGC,MACjC,IAAKA,EAAE3B,KACL,MAAM,IAAIhF,MAAM,8BAA8B0G,MAChD,MAAO,CAACA,EAAGC,EAAE3B,WALb,IAAkCqB"}
@@ -1,2 +0,0 @@
1
- "use strict";function n(n){if(!n.position||!n.code)return"";const t=n.position.column-1,e=n.code.length-t-1;return`${" ".repeat(Math.max(t,0))}^${" ".repeat(Math.max(e,0))}`}class t extends Error{sourceCodeInfo;shortMessage;constructor(e,r){const o=e instanceof Error?e.message:`${e}`;super(function(t,e){if(!e)return t;const r=`${e.position.line}:${e.position.column}`;return`${t}${e.filePath?`\n${e.filePath}:${r}`:`\nLocation ${r}`}\n${e.code}\n${n(e)}`}(o,r)),this.shortMessage=o,this.sourceCodeInfo=r,Object.setPrototypeOf(this,t.prototype),this.name="DvalaError"}getCodeMarker(){return this.sourceCodeInfo&&n(this.sourceCodeInfo)}}const e={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},r=new Set(Object.values(e));const o=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","EffectMatcher","Builtin","SpecialBuiltin","Module"]);const u="^^fn^^",a="^^re^^",i="^^ef^^";function s(n){return null!==n&&"object"==typeof n&&(u in n&&"functionType"in n&&("string"==typeof(t=n.functionType)&&o.has(t)));var t}function l(n){return!(!Array.isArray(n)||n.length<2)&&("number"==typeof(t=n[0])&&r.has(t));var t}function c(n){return s(n)?`<function ${n.name||"λ"}>`:l(n)?`${t=n[0],Object.keys(e).find(n=>e[n]===t)}-node`:null===n?"null":"object"==typeof n&&n instanceof RegExp?`${n}`:"object"==typeof n&&n instanceof Error?n.toString():JSON.stringify(n);var t}function f(n){return null!==n&&"object"==typeof n&&!!n[u]}function m(n){return!(null===n||"object"!=typeof n||Array.isArray(n)||n instanceof RegExp||f(n)||(t=n,null!==t&&"object"==typeof t&&t[a])||function(n){return null!==n&&"object"==typeof n&&!!n[i]}(n));var t}function p(n){return function(n){return Array.isArray(n)||"string"==typeof n}(n)||m(n)}function y(n,t){return d(n,t),n}function d(n,e){if(!function(n){return"number"==typeof n||!!p(n)||!!f(n)}(n))throw function(n,e,r){return new t(`Expected ${n}, got ${c(e)}.`,function(n,t){return n?.sourceCodeInfo??t}(e,r))}("FunctionLike",n,e)}function g(n){return"number"==typeof n||p(n)?h(1):n.arity}function h(n){return{min:n,max:n}}const b={juxt:{evaluate:(n,e)=>{n.forEach(n=>d(n,e));const r=function(n){return n.reduce((n,t)=>{if(null===n)return null;const e="number"==typeof t||p(t)?h(1):t.arity,{min:r,max:o}=e,{min:u,max:a}=n,i="number"==typeof r&&"number"==typeof u?Math.max(r,u):"number"==typeof r?r:"number"==typeof u?u:void 0,s="number"==typeof o&&"number"==typeof a?Math.min(o,a):"number"==typeof o?o:"number"==typeof a?a:void 0;return"number"==typeof i&&"number"==typeof s&&i>s?null:{min:i,max:s}},{})}(n);if(null===r)throw new t("All functions must accept the same number of arguments",e);return{[u]:!0,sourceCodeInfo:e,functionType:"Juxt",params:n,arity:r}},arity:{min:1},docs:{category:"functional",returns:{type:"function"},args:{a:{type:"function"},b:{type:"function"},fun:{type:"function"},fns:{type:"function",rest:!0}},variants:[{argumentNames:["fun"]},{argumentNames:["fun","fns"]}],description:"Takes one or many function and returns a function that is the juxtaposition of those functions.\nThe returned function takes a variable number of args,\nand returns a vector containing the result of applying each function to the args (left-to-right).",seeAlso:["comp"],examples:["let { juxt } = import(functional);\njuxt(+, *, min, max)(\n 3,\n 4,\n 6,\n)",'let { juxt } = import(functional);\njuxt("a", "b")(\n {\n a: 1,\n b: 2,\n c: 3,\n d: 4\n }\n)',"let { juxt } = import(functional);\njuxt(+, *, min, max) apply range(1, 11)"]}},complement:{evaluate:([n],t)=>{const e=y(n,t);return{[u]:!0,sourceCodeInfo:t,functionType:"Complement",function:e,arity:g(e)}},arity:h(1),docs:{category:"functional",returns:{type:"function"},args:{fun:{type:"function"}},variants:[{argumentNames:["fun"]}],description:"Takes a function $fun and returns a new function that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value.",seeAlso:["comp","functional.every-pred","functional.some-pred"],examples:["let { complement } = import(functional);\ncomplement(>)(1, 3)","let { complement } = import(functional);\ncomplement(<)(1, 3)","let { complement } = import(functional);\ncomplement(+)(1, 3)","let { complement } = import(functional);\ncomplement(+)(0, 0)"]}},"every-pred":{evaluate:(n,t)=>({[u]:!0,sourceCodeInfo:t,functionType:"EveryPred",params:n,arity:{min:1,max:1}}),arity:{min:1},docs:{category:"functional",returns:{type:"function"},args:{fun:{type:"function"},fns:{type:"function",rest:!0}},variants:[{argumentNames:["fun"]},{argumentNames:["fun","fns"]}],description:"\nTakes a number of predicates and returns a function that returns `true` if all predicates\nreturn a truthy value against all of its arguments, else it returns `false`.",seeAlso:["functional.some-pred","functional.complement","collection.every?"],examples:['let { every-pred } = import(functional);\nevery-pred(string?, -> count($) > 3)(\n "Albert",\n "Mojir"\n)','let { every-pred } = import(functional);\n(string? every-pred -> count($) > 3)(\n "Albert",\n "M"\n)'],hideOperatorForm:!0}},"some-pred":{evaluate:(n,t)=>({[u]:!0,sourceCodeInfo:t,functionType:"SomePred",params:n,arity:{min:1,max:1}}),arity:{min:1},docs:{category:"functional",returns:{type:"function"},args:{fun:{type:"function"},fns:{type:"function",rest:!0}},variants:[{argumentNames:["fun"]},{argumentNames:["fun","fns"]}],description:"Takes a number of `predicates` and returns a function that returns `true` if at least one of the `predicates` return a truthy `true` value against at least one of its arguments, else it returns `false`.",seeAlso:["functional.every-pred","functional.complement","collection.any?"],examples:['let { some-pred } = import(functional);\nsome-pred(string?, -> count($) > 3)("Albert", "Mojir")','let { some-pred } = import(functional);\nsome-pred(string?, -> count($) > 3)("a", "M")','let { some-pred } = import(functional);\nsome-pred(string?, -> count($) > 3)("a", [1, 2, 3])',"let { some-pred } = import(functional);\nsome-pred(string?, -> count($) > 3)([1, 2, 3], [2])"],hideOperatorForm:!0}},fnull:{evaluate:([n,...t],e)=>{const r=y(n,e);return{[u]:!0,sourceCodeInfo:e,functionType:"Fnull",function:r,params:t,arity:g(r)}},arity:{min:2},docs:{category:"functional",returns:{type:"function"},args:{a:{type:"function"},b:{type:"any"},fun:{type:"function"},arg:{type:"any"},args:{type:"any",rest:!0}},variants:[{argumentNames:["fun","arg"]},{argumentNames:["fun","arg","args"]}],description:"Takes a function $fun, and returns a function that calls $fun, replacing a null argument to the corresponding argument.",seeAlso:["identity","constantly"],examples:["let { fnull } = import(functional);\nfnull(inc, 0)(1)","let { fnull } = import(functional);\nfnull(inc, 0)(null)","let { fnull } = import(functional);\n(inc fnull 0)(null)","let { fnull } = import(functional);\nfnull(+, 1, 2)(null, 0)","let { fnull } = import(functional);\nfnull(+, 1, 2)(0, null)","let { fnull } = import(functional);\nfnull(+, 1, 2)(null, null)","let { fnull } = import(functional);\nfnull(+, 1, 2)(null, null, 3, 4)"]}}},v={name:"functional",functions:b,source:"{}",docs:(x=b,Object.fromEntries(Object.entries(x).map(([n,t])=>{if(!t.docs)throw new Error(`Missing docs for function "${n}"`);return[n,t.docs]})))};var x;exports.functionalUtilsModule=v;
2
- //# sourceMappingURL=functional.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"functional.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/symbols.ts","../../src/utils/debug/debugTools.ts","../../src/typeGuards/dvalaFunction.ts","../../src/typeGuards/dvala.ts","../../src/utils/getAssertionError.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/utils/arity.ts","../../src/builtin/modules/functional/index.ts","../../src/builtin/modules/functional/functional.dvala","../../src/builtin/modules/interface.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getDvalaErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class DvalaError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getDvalaErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, DvalaError.prototype)\n this.name = 'DvalaError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends DvalaError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends DvalaError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends DvalaError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isDvalaError(error: unknown): error is DvalaError {\n return error instanceof DvalaError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'EffectMatcher',\n 'Builtin',\n 'SpecialBuiltin',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\nexport const EFFECT_SYMBOL = '^^ef^^'\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { AstNode, DvalaFunction } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isDvalaFunction(func: unknown): func is DvalaFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is AstNode {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isDvalaFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","import type { DvalaFunction, NormalBuiltinFunction, UserDefinedFunction } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { FUNCTION_SYMBOL } from '../utils/symbols'\nimport { isUnknownRecord } from '.'\n\nexport function isDvalaFunction(value: unknown): value is DvalaFunction {\n if (value === null || typeof value !== 'object')\n return false\n\n return !!(value as DvalaFunction)[FUNCTION_SYMBOL]\n}\nexport function asDvalaFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): DvalaFunction {\n assertDvalaFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertDvalaFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is DvalaFunction {\n if (!isDvalaFunction(value))\n throw getAssertionError('DvalaFunction', value, sourceCodeInfo)\n}\n\nexport function isUserDefinedFunction(value: unknown): value is UserDefinedFunction {\n return isDvalaFunction(value) && value.functionType === 'UserDefined'\n}\nexport function asUserDefinedFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): UserDefinedFunction {\n assertUserDefinedFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertUserDefinedFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is UserDefinedFunction {\n if (!isUserDefinedFunction(value))\n throw getAssertionError('UserDefinedFunction', value, sourceCodeInfo)\n}\n\nexport function isBuiltinFunction(value: unknown): value is NormalBuiltinFunction {\n return isUnknownRecord(value) && value.functionType === 'Builtin'\n}\n","import type { Any, Coll, Obj, Seq } from '../interface'\nimport type { EffectRef, FunctionLike, RegularExpression } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { EFFECT_SYMBOL, REGEXP_SYMBOL } from '../utils/symbols'\nimport { isDvalaFunction } from './dvalaFunction'\n\nexport function isAny(value: unknown): value is Any {\n // TODO weak test\n return value !== undefined\n}\nexport function asAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): Any {\n assertAny(value, sourceCodeInfo)\n return value\n}\nexport function assertAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Any {\n if (!isAny(value))\n throw getAssertionError('not undefined', value, sourceCodeInfo)\n}\n\nexport function isSeq(value: unknown): value is Seq {\n return Array.isArray(value) || typeof value === 'string'\n}\nexport function asSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): Seq {\n assertSeq(value, sourceCodeInfo)\n return value\n}\nexport function assertSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Seq {\n if (!isSeq(value))\n throw getAssertionError('string or array', value, sourceCodeInfo)\n}\n\nexport function isObj(value: unknown): value is Obj {\n return !(\n value === null\n || typeof value !== 'object'\n || Array.isArray(value)\n || value instanceof RegExp\n || isDvalaFunction(value)\n || isRegularExpression(value)\n || isEffect(value)\n )\n}\nexport function asObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): Obj {\n assertObj(value, sourceCodeInfo)\n return value\n}\nexport function assertObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Obj {\n if (!isObj(value))\n throw getAssertionError('object', value, sourceCodeInfo)\n}\n\nexport function isColl(value: unknown): value is Coll {\n return isSeq(value) || isObj(value)\n}\nexport function asColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): Coll {\n assertColl(value, sourceCodeInfo)\n return value\n}\nexport function assertColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Coll {\n if (!isColl(value))\n throw getAssertionError('string, array or object', value, sourceCodeInfo)\n}\n\nexport function isRegularExpression(regexp: unknown): regexp is RegularExpression {\n if (regexp === null || typeof regexp !== 'object')\n return false\n\n return !!(regexp as RegularExpression)[REGEXP_SYMBOL]\n}\nexport function asRegularExpression(value: unknown, sourceCodeInfo?: SourceCodeInfo): RegularExpression {\n assertRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is RegularExpression {\n if (!isRegularExpression(value))\n throw getAssertionError('RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isStringOrRegularExpression(value: unknown): value is string | RegularExpression {\n return isRegularExpression(value) || typeof value === 'string'\n}\nexport function asStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): string | RegularExpression {\n assertStringOrRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | RegularExpression {\n if (!isStringOrRegularExpression(value))\n throw getAssertionError('string or RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isEffect(value: unknown): value is EffectRef {\n if (value === null || typeof value !== 'object')\n return false\n\n return !!(value as EffectRef)[EFFECT_SYMBOL]\n}\nexport function asEffect(value: unknown, sourceCodeInfo?: SourceCodeInfo): EffectRef {\n assertEffect(value, sourceCodeInfo)\n return value\n}\nexport function assertEffect(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is EffectRef {\n if (!isEffect(value))\n throw getAssertionError('Effect', value, sourceCodeInfo)\n}\n\nfunction isFunctionLike(value: unknown): value is FunctionLike {\n if (typeof value === 'number')\n return true\n if (isColl(value))\n return true\n if (isDvalaFunction(value))\n return true\n\n return false\n}\nexport function asFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): FunctionLike {\n assertFunctionLike(value, sourceCodeInfo)\n return value\n}\nexport function assertFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is FunctionLike {\n if (!isFunctionLike(value))\n throw getAssertionError('FunctionLike', value, sourceCodeInfo)\n}\n","import { DvalaError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from './debug/debugTools'\nimport { getSourceCodeInfo } from './debug/getSourceCodeInfo'\n\nexport function getAssertionError(typeName: string, value: unknown, sourceCodeInfo?: SourceCodeInfo): DvalaError {\n return new DvalaError(`Expected ${typeName}, got ${valueToString(value)}.`, getSourceCodeInfo(value, sourceCodeInfo))\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import type { Arity } from '../builtin/interface'\nimport { DvalaError } from '../errors'\nimport type { FunctionLike } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isColl } from '../typeGuards/dvala'\nimport { valueToString } from './debug/debugTools'\n\nexport function arityAccepts(arity: Arity, nbrOfParams: number): boolean {\n const { min, max } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n if (typeof max === 'number' && nbrOfParams > max) {\n return false\n }\n return true\n}\n\nexport function arityAcceptsMin(arity: Arity, nbrOfParams: number): boolean {\n const { min } = arity\n if (typeof min === 'number' && nbrOfParams < min) {\n return false\n }\n return true\n}\n\nexport function getCommonArityFromFunctions(params: FunctionLike[]): Arity | null {\n return params.reduce((acc: Arity | null, param): Arity | null => {\n if (acc === null) {\n return null\n }\n const arity: Arity = (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n const { min: aMin, max: aMax } = arity\n const { min: bMin, max: bMax } = acc\n const min = typeof aMin === 'number' && typeof bMin === 'number'\n ? Math.max(aMin, bMin)\n : typeof aMin === 'number' ? aMin : typeof bMin === 'number' ? bMin : undefined\n const max = typeof aMax === 'number' && typeof bMax === 'number'\n ? Math.min(aMax, bMax)\n : typeof aMax === 'number' ? aMax : typeof bMax === 'number' ? bMax : undefined\n\n if (typeof min === 'number' && typeof max === 'number' && min > max) {\n return null\n }\n\n return { min, max }\n }, {})\n}\n\nexport function getArityFromFunction(param: FunctionLike): Arity {\n return (typeof param === 'number' || isColl(param)) ? toFixedArity(1) : param.arity\n}\n\nexport function assertNumberOfParams(arity: Arity, length: number, sourceCodeInfo: SourceCodeInfo | undefined): void {\n const { min, max } = arity\n if (typeof min === 'number' && length < min) {\n throw new DvalaError(\n `Wrong number of arguments, expected at least ${min}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n\n if (typeof max === 'number' && length > max) {\n throw new DvalaError(\n `Wrong number of arguments, expected at most ${max}, got ${valueToString(length)}.`,\n sourceCodeInfo,\n )\n }\n}\n\nexport function canBeOperator(count: Arity): boolean {\n if (typeof count.max === 'number' && count.max < 2) {\n return false\n }\n\n if (typeof count.min === 'number' && count.min > 2) {\n return false\n }\n\n return true\n}\n\nexport function toFixedArity(arity: number): Arity {\n return { min: arity, max: arity }\n}\n","import type { Arr } from '../../../interface'\nimport type {\n ComplementFunction,\n EveryPredFunction,\n FNullFunction,\n FunctionLike,\n JuxtFunction,\n SomePredFunction,\n} from '../../../parser/types'\nimport { getArityFromFunction, getCommonArityFromFunctions, toFixedArity } from '../../../utils/arity'\nimport { FUNCTION_SYMBOL } from '../../../utils/symbols'\nimport type { BuiltinNormalExpressions } from '../../interface'\nimport { asFunctionLike, assertFunctionLike } from '../../../typeGuards/dvala'\nimport { DvalaError } from '../../../errors'\nimport { moduleDocsFromFunctions } from '../interface'\nimport type { DvalaModule } from '../interface'\nimport functionalModuleSource from './functional.dvala'\n\nconst functionalUtilsNormalExpression: BuiltinNormalExpressions = {\n 'juxt': {\n evaluate: (params, sourceCodeInfo): JuxtFunction => {\n params.forEach(param => assertFunctionLike(param, sourceCodeInfo))\n const arity = getCommonArityFromFunctions(params as FunctionLike[])\n if (arity === null) {\n throw new DvalaError('All functions must accept the same number of arguments', sourceCodeInfo)\n }\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'Juxt',\n params,\n arity,\n }\n },\n arity: { min: 1 },\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: {\n a: { type: 'function' },\n b: { type: 'function' },\n fun: { type: 'function' },\n fns: { type: 'function', rest: true },\n },\n variants: [\n { argumentNames: ['fun'] },\n { argumentNames: ['fun', 'fns'] },\n ],\n description: `Takes one or many function and returns a function that is the juxtaposition of those functions.\nThe returned function takes a variable number of args,\nand returns a vector containing the result of applying each function to the args (left-to-right).`,\n seeAlso: ['comp'],\n examples: [\n `let { juxt } = import(functional);\njuxt(+, *, min, max)(\n 3,\n 4,\n 6,\n)`,\n `let { juxt } = import(functional);\njuxt(\"a\", \"b\")(\n {\n a: 1,\n b: 2,\n c: 3,\n d: 4\n }\n)`,\n `let { juxt } = import(functional);\njuxt(+, *, min, max) apply range(1, 11)`,\n ],\n },\n },\n\n 'complement': {\n evaluate: ([fn], sourceCodeInfo): ComplementFunction => {\n const fun = asFunctionLike(fn, sourceCodeInfo)\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'Complement',\n function: fun,\n arity: getArityFromFunction(fun),\n }\n },\n arity: toFixedArity(1),\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: { fun: { type: 'function' } },\n variants: [{ argumentNames: ['fun'] }],\n description: 'Takes a function $fun and returns a new function that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value.',\n seeAlso: ['comp', 'functional.every-pred', 'functional.some-pred'],\n examples: [\n 'let { complement } = import(functional);\\ncomplement(>)(1, 3)',\n 'let { complement } = import(functional);\\ncomplement(<)(1, 3)',\n 'let { complement } = import(functional);\\ncomplement(+)(1, 3)',\n 'let { complement } = import(functional);\\ncomplement(+)(0, 0)',\n ],\n },\n },\n\n 'every-pred': {\n evaluate: (params, sourceCodeInfo): EveryPredFunction => {\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'EveryPred',\n params,\n arity: { min: 1, max: 1 },\n }\n },\n arity: { min: 1 },\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: {\n fun: { type: 'function' },\n fns: { type: 'function', rest: true },\n },\n variants: [\n { argumentNames: ['fun'] },\n { argumentNames: ['fun', 'fns'] },\n ],\n description: `\nTakes a number of predicates and returns a function that returns \\`true\\` if all predicates\nreturn a truthy value against all of its arguments, else it returns \\`false\\`.`,\n seeAlso: ['functional.some-pred', 'functional.complement', 'collection.every?'],\n examples: [\n `let { every-pred } = import(functional);\nevery-pred(string?, -> count($) > 3)(\n \"Albert\",\n \"Mojir\"\n)`,\n `let { every-pred } = import(functional);\n(string? every-pred -> count($) > 3)(\n \"Albert\",\n \"M\"\n)`,\n ],\n hideOperatorForm: true,\n },\n },\n\n 'some-pred': {\n evaluate: (params, sourceCodeInfo): SomePredFunction => {\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'SomePred',\n params,\n arity: { min: 1, max: 1 },\n }\n },\n arity: { min: 1 },\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: {\n fun: { type: 'function' },\n fns: { type: 'function', rest: true },\n },\n variants: [\n { argumentNames: ['fun'] },\n { argumentNames: ['fun', 'fns'] },\n ],\n description: 'Takes a number of `predicates` and returns a function that returns `true` if at least one of the `predicates` return a truthy `true` value against at least one of its arguments, else it returns `false`.',\n seeAlso: ['functional.every-pred', 'functional.complement', 'collection.any?'],\n examples: [\n 'let { some-pred } = import(functional);\\nsome-pred(string?, -> count($) > 3)(\"Albert\", \"Mojir\")',\n 'let { some-pred } = import(functional);\\nsome-pred(string?, -> count($) > 3)(\"a\", \"M\")',\n 'let { some-pred } = import(functional);\\nsome-pred(string?, -> count($) > 3)(\"a\", [1, 2, 3])',\n 'let { some-pred } = import(functional);\\nsome-pred(string?, -> count($) > 3)([1, 2, 3], [2])',\n ],\n hideOperatorForm: true,\n },\n },\n\n 'fnull': {\n evaluate: ([fn, ...params]: Arr, sourceCodeInfo): FNullFunction => {\n const fun = asFunctionLike(fn, sourceCodeInfo)\n return {\n [FUNCTION_SYMBOL]: true,\n sourceCodeInfo,\n functionType: 'Fnull',\n function: fun,\n params,\n arity: getArityFromFunction(fun),\n }\n },\n arity: { min: 2 },\n docs: {\n category: 'functional',\n returns: { type: 'function' },\n args: {\n a: { type: 'function' },\n b: { type: 'any' },\n fun: { type: 'function' },\n arg: { type: 'any' },\n args: { type: 'any', rest: true },\n },\n variants: [\n { argumentNames: ['fun', 'arg'] },\n { argumentNames: ['fun', 'arg', 'args'] },\n ],\n description: 'Takes a function $fun, and returns a function that calls $fun, replacing a null argument to the corresponding argument.',\n seeAlso: ['identity', 'constantly'],\n examples: [\n 'let { fnull } = import(functional);\\nfnull(inc, 0)(1)',\n 'let { fnull } = import(functional);\\nfnull(inc, 0)(null)',\n 'let { fnull } = import(functional);\\n(inc fnull 0)(null)',\n 'let { fnull } = import(functional);\\nfnull(+, 1, 2)(null, 0)',\n 'let { fnull } = import(functional);\\nfnull(+, 1, 2)(0, null)',\n 'let { fnull } = import(functional);\\nfnull(+, 1, 2)(null, null)',\n 'let { fnull } = import(functional);\\nfnull(+, 1, 2)(null, null, 3, 4)',\n ],\n },\n },\n}\n\nexport const functionalUtilsModule: DvalaModule = {\n name: 'functional',\n functions: functionalUtilsNormalExpression,\n source: functionalModuleSource,\n docs: moduleDocsFromFunctions(functionalUtilsNormalExpression),\n}\n","{}","import type { BuiltinNormalExpressions, FunctionDocs } from '../../builtin/interface'\n\n/**\n * Represents a Dvala module that can be imported dynamically.\n * Modules contain a collection of functions that are not part of the core bundle.\n */\nexport interface DvalaModule {\n /** The name of the module (e.g., 'grid', 'vec', 'mat') */\n name: string\n /** The functions provided by this module, keyed by their short name (e.g., 'transpose') */\n functions: BuiltinNormalExpressions\n /**\n * Optional Dvala source code that is evaluated at import time.\n * The source must evaluate to an object mapping function names to functions.\n * These are merged with (and may override) the TypeScript `functions`.\n */\n source?: string\n /**\n * Docs for all functions in this module, including any defined in `source`.\n * The reference system uses this record as the sole source of truth for\n * function names and documentation. Not required for user-defined modules.\n */\n docs?: Record<string, FunctionDocs>\n}\n\n/**\n * Derives a docs record from a BuiltinNormalExpressions map.\n * Use this for modules whose docs are co-located inline on each function.\n */\nexport function moduleDocsFromFunctions(functions: BuiltinNormalExpressions): Record<string, FunctionDocs> {\n return Object.fromEntries(\n Object.entries(functions).map(([k, v]) => {\n if (!v.docs)\n throw new Error(`Missing docs for function \"${k}\"`)\n return [k, v.docs]\n }),\n )\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","DvalaError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getDvalaErrorMessage","this","Object","setPrototypeOf","prototype","name","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","FUNCTION_SYMBOL","REGEXP_SYMBOL","EFFECT_SYMBOL","isDvalaFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","isObj","regexp","isEffect","isColl","isSeq","asFunctionLike","assertFunctionLike","isFunctionLike","typeName","anyValue","getSourceCodeInfo","getAssertionError","getArityFromFunction","param","toFixedArity","arity","min","functionalUtilsNormalExpression","juxt","evaluate","params","forEach","reduce","acc","aMin","aMax","bMin","bMax","undefined","getCommonArityFromFunctions","docs","category","returns","args","a","b","fun","fns","rest","variants","argumentNames","description","seeAlso","examples","complement","fn","function","hideOperatorForm","fnull","arg","functionalUtilsModule","functions","source","fromEntries","entries","map","k","v"],"mappings":"aAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,UAAmBC,MACdX,eACAY,aAChB,WAAAC,CAAYC,EAAcd,GACxB,MAAMe,EAAUD,aAAeH,MAC3BG,EAAIC,QACJ,GAAGD,IAEPE,MA/BJ,SAA8BD,EAAiBf,GAC7C,IAAKA,EACH,OAAOe,EAET,MAAME,EAAW,GAAGjB,EAAeC,SAASiB,QAAQlB,EAAeC,SAASG,SAM5E,MAAO,GAAGW,IALWf,EAAemB,SAChC,KAAKnB,EAAemB,YAAYF,IAChC,cAAcA,QACIjB,EAAeE,SACbH,EAAcC,IAExC,CAoBUoB,CAAqBL,EAASf,IACpC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