@mojir/dvala 0.0.10 → 0.0.13

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 +33091 -36955
  2. package/package.json +191 -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,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import type { ReadLine, ReadLineOptions } from 'node:readline';
3
- type Options = Required<Pick<ReadLineOptions, 'completer' | 'historySize' | 'prompt'>>;
4
- export declare function createReadlineInterface(options: Options): ReadLine;
5
- export {};
@@ -1,2 +0,0 @@
1
- import type { DvalaModule } from '../../../../../src/builtin/modules/interface';
2
- export declare function getFsModule(): DvalaModule;
@@ -1,3 +0,0 @@
1
- import type { DvalaModule } from '../../../../../src/builtin/modules/interface';
2
- export declare function sys_cwd(): string;
3
- export declare function getProcModule(): DvalaModule;
@@ -1,2 +0,0 @@
1
- import type { DvalaModule } from '../../../../src/builtin/modules/interface';
2
- export declare function getCliModules(): DvalaModule[];
@@ -1,2 +0,0 @@
1
- function e(e){if(!e.position||!e.code)return"";const n=e.position.column-1,t=e.code.length-n-1;return`${" ".repeat(Math.max(n,0))}^${" ".repeat(Math.max(t,0))}`}class n extends Error{sourceCodeInfo;shortMessage;constructor(t,o){const c=t instanceof Error?t.message:`${t}`;super(function(n,t){if(!t)return n;const o=`${t.position.line}:${t.position.column}`;return`${n}${t.filePath?`\n${t.filePath}:${o}`:`\nLocation ${o}`}\n${t.code}\n${e(t)}`}(c,o)),this.shortMessage=c,this.sourceCodeInfo=o,Object.setPrototypeOf(this,n.prototype),this.name="DvalaError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const t={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},o=new Set(Object.values(t));const c=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","EffectMatcher","Builtin","SpecialBuiltin","Module"]);const l="^^fn^^",i="^^re^^",r="^^ef^^";function a(e){return null!==e&&"object"==typeof e&&(l in e&&"functionType"in e&&("string"==typeof(n=e.functionType)&&c.has(n)));var n}function u(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(n=e[0])&&o.has(n));var n}function s(e){return a(e)?`<function ${e.name||"λ"}>`:u(e)?`${n=e[0],Object.keys(t).find(e=>t[e]===n)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var n}function d(e,n){return e?.sourceCodeInfo??n}function p(e,t,o){return new n(`Expected ${e}, got ${s(t)}.`,d(t,o))}function f(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof RegExp||function(e){return null!==e&&"object"==typeof e&&!!e[l]}(e)||(n=e,null!==n&&"object"==typeof n&&n[i])||function(e){return null!==e&&"object"==typeof e&&!!e[r]}(e));var n}function m(e){return function(e){return Array.isArray(e)||"string"==typeof e}(e)||f(e)}function h(e,n){return y(e,n),e}function y(e,n){if(!m(e))throw p("string, array or object",e,n)}function g(e,n={}){return"number"==typeof e&&(!Number.isNaN(e)&&(!(n.integer&&!Number.isInteger(e))&&(!(n.finite&&!Number.isFinite(e))&&((!n.zero||0===e)&&((!n.nonZero||0!==e)&&(!(n.positive&&e<=0)&&(!(n.negative&&e>=0)&&(!(n.nonPositive&&e>0)&&(!(n.nonNegative&&e<0)&&(!("number"==typeof n.gt&&e<=n.gt)&&(!("number"==typeof n.gte&&e<n.gte)&&(!("number"==typeof n.lt&&e>=n.lt)&&!("number"==typeof n.lte&&e>n.lte)))))))))))))}function v(e,t,o={}){if(!g(e,o))throw new n(`Expected ${function(e){if(e.zero)return"zero";const n=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),t=e.integer?"integer":"number",o=e.finite?"finite":"",c=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[n,o,t,c].filter(e=>!!e).join(" ")}(o)}, got ${s(e)}.`,d(e,t))}function b(e,n,t={}){if(!function(e,n={}){return!("string"!=typeof e||n.nonEmpty&&0===e.length||n.char&&1!==e.length)}(e,t))throw p(""+(t.nonEmpty?"non empty string":t.char?"character":"string"),e,n)}function x(e,n){return k(e,n),e}function k(e,n){if(!function(e){return"string"==typeof e||"number"==typeof e}(e))throw p("string or number",e,n)}function $(e,n){return!!m(e)&&("string"==typeof e||Array.isArray(e)?!!g(n,{integer:!0})&&(n>=0&&n<e.length):!!Object.getOwnPropertyDescriptor(e,n))}function w(e){return e??null}function A(e){return f(e)?Object.entries(e).reduce((e,n)=>{const[t,o]=n;return e[t]=A(o),e},{}):Array.isArray(e)?e.map(e=>A(e)):e}function E(e){return A(e)}function j(e,n){if(!Array.isArray(e))throw p("array",e,n)}function N(e){return{min:e,max:e}}function T(e,n){if(f(e)){if("string"==typeof n&&$(e,n))return w(e[n])}else if(g(n,{nonNegative:!0,integer:!0})&&n>=0&&n<e.length)return w(e[n])}function D(e,n,t,o){if(y(e,o),Array.isArray(e)||"string"==typeof e){if(v(n,o,{integer:!0}),v(n,o,{gte:0}),v(n,o,{lte:e.length}),"string"==typeof e)return b(t,o,{char:!0}),`${e.slice(0,n)}${t}${e.slice(n+1)}`;const c=[...e];return c[n]=t,c}b(n,o);const c={...e};return c[n]=t,c}function R(e,n,t){const o=E(e);return{coll:o,innerCollMeta:n.slice(0,n.length-1).reduce((e,n)=>{const o=e.coll;let c;return Array.isArray(o)?(v(n,t),c=h(o[n],t)):(!function(e,n){if(!f(e))throw p("object",e,n)}(o,t),b(n,t),$(e.coll,n)||(o[n]={}),c=h(o[n],t)),{coll:c,parent:o}},{coll:o,parent:{}})}}const C={"get-in":{evaluate:(e,n)=>{let t=w(e[0]);const o=e[1]??[],c=w(e[2]);j(o,n);for(const e of o){if(k(e,n),!m(t))return c;{const n=T(t,e);if(void 0===n)return c;t=n}}return t},arity:{min:2,max:3},docs:{category:"collection",returns:{type:"any"},args:{a:{type:"collection"},b:{type:"array"},"not-found":{type:"any"}},variants:[{argumentNames:["a","b"]},{argumentNames:["a","b","not-found"]}],description:"Returns the value in a nested collection, where $b is an array of keys. Returns $not-found if the key is not present. If $not-found is not set, `null` is returned.",seeAlso:["get","collection.assoc-in","collection.update-in"],examples:['\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: "Kalle" }, 6]],\n [1, 1, "a", 0]\n)','\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: "Kalle" }, 6]],\n [1, 1, "b", 0]\n)','\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: "Kalle" }, 6]],\n [1, 1, "b", 0],\n "Lisa"\n)']}},"assoc-in":{evaluate:([e,n,t],o)=>{if(y(e,o),j(n,o),function(e,n){if(!function(e){return void 0!==e}(e))throw p("not undefined",e,n)}(t,o),1===n.length)return k(n[0],o),D(e,n[0],t,o);const{coll:c,innerCollMeta:l}=R(e,n,o),i=x(n[n.length-1],o),r=x(n[n.length-2],o);return Array.isArray(l.parent)?(v(r,o),l.parent[r]=D(l.coll,i,t,o)):(b(r,o),l.parent[r]=D(l.coll,i,t,o)),c},arity:N(3),docs:{category:"collection",returns:{type:"collection"},args:{coll:{type:"collection"},ks:{type:["number","string"],array:!0},value:{type:"any"}},variants:[{argumentNames:["coll","ks","value"]}],description:"\nAssociates a value in the nested collection $coll, where $ks is an array of keys and $value is the new value.\n\nIf any levels do not exist, objects will be created - and the corresponding keys must be of type string.",seeAlso:["assoc","collection.get-in","collection.update-in"],examples:['\nlet cu = import(collection);\ncu.assoc-in(\n {},\n ["a", "b", "c"],\n "Albert"\n)','\nlet cu = import(collection);\ncu.assoc-in(\n [1, 2, [1, 2, 3]],\n [2, 1],\n "Albert"\n)','\nlet cu = import(collection);\ncu.assoc-in(\n [1, 2, { name: "albert" }],\n [2, "name", 0],\n "A"\n)']}},update:{evaluate:()=>{throw new Error("update: Dvala implementation should be used instead")},arity:{min:3},docs:{category:"collection",returns:{type:"collection"},args:{coll:{type:"collection"},key:{type:["string","number"]},fun:{type:"function"},"fun-args":{type:"any",rest:!0}},variants:[{argumentNames:["coll","key","fun"]},{argumentNames:["coll","key","fun","fun-args"]}],description:"\nUpdates a value in the $coll collection, where $key is a key. $fun is a function\nthat will take the old value and any supplied $fun-args and\nreturn the new value.\nIf the key does not exist, `null` is passed as the old value.",seeAlso:["collection.update-in","assoc"],examples:['\nlet cu = import(collection);\nlet x = { a: 1, b: 2 };\ncu.update(x, "a", inc)','\nlet cu = import(collection);\nlet x = { a: 1, b: 2 };\ncu.update(\n x,\n "c",\n val -> null?(val) ? 0 : inc(val)\n)']}},"update-in":{evaluate:()=>{throw new Error("update-in: Dvala implementation should be used instead")},arity:{min:3},docs:{category:"collection",returns:{type:"collection"},args:{coll:{type:"collection"},ks:{type:"array"},fun:{type:"function"},"fun-args":{type:"any",rest:!0}},variants:[{argumentNames:["coll","ks","fun"]},{argumentNames:["coll","ks","fun","fun-args"]}],description:"Updates a value in the $coll collection, where $ks is an array of\nkeys and $fun is a function that will take the old value and\nany supplied $fun-args and return the new value. If any levels do not exist,\nobjects will be created - and the corresponding keys must be of type string.",seeAlso:["collection.update","collection.assoc-in","collection.get-in"],examples:['\nlet cu = import(collection);\ncu.update-in(\n { a: [1, 2, 3] },\n ["a", 1],\n -> null?($) ? 0 : inc($)\n)','\nlet cu = import(collection);\ncu.update-in(\n { a: { foo: "bar"} },\n ["a", "foo"],\n -> null?($) ? "?" : "!"\n)','\nlet cu = import(collection);\ncu.update-in(\n { a: { foo: "bar"} },\n ["a", "baz"],\n -> null?($) ? "?" : "!"\n)','\nlet cu = import(collection);\ncu.update-in(\n { a: [1, 2, 3] },\n ["a", 1],\n *,\n 10,\n 10,\n 10,\n)']}},filteri:{evaluate:()=>{throw new Error("filteri: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"collection"},args:{a:{type:"collection"},b:{type:"function",description:"The function to call for each element in the collection. The function should take two arguments: the element itself and the index."}},variants:[{argumentNames:["a","b"]}],description:"Creates a new collection with all elements that pass the test implemented by $b. The function is called for each element in the collection, and it should take two arguments: the element itself and the index.",seeAlso:["filter","collection.mapi"],examples:["let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> i % 2 == 0)","let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> x % 2 == 0)","let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> x + i > 3)"]}},mapi:{evaluate:()=>{throw new Error("mapi: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"collection"},args:{a:{type:"collection"},b:{type:"function",description:"The function to call for each element in the collection. The function should take two arguments: the element itself and the index."}},variants:[{argumentNames:["a","b"]}],description:"Creates a new collection populated with the results of calling $b on every element in $a. The function is called for each element in the collection, and it should take two arguments: the element itself and the index.",seeAlso:["map","collection.filteri"],examples:["let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x + i)","let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x * i)","let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x - i)","let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x / i)","let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x % inc(i))"]}},reducei:{evaluate:()=>{throw new Error("reducei: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any"},args:{coll:{type:"collection"},fun:{type:"function",description:"The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index."},initial:{type:"any",description:"The initial value to use as the accumulator."}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Runs $fun function on each element of the $coll, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.",seeAlso:["reduce","collection.reducei-right","collection.reductionsi"],examples:["let cu = import(collection); cu.reducei([1, 2, 3], (acc, x, i) -> acc + x + i, 0)",'let cu = import(collection); cu.reducei("Albert", (acc, x, i) -> acc ++ x ++ i, "")','let cu = import(collection); cu.reducei({ a: 1, b: 2 }, -> $1 ++ $3, "")']}},"reduce-right":{evaluate:()=>{throw new Error("reduce-right: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any"},args:{fun:{type:"function"},coll:{type:"collection"},initial:{type:"any"}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Runs $fun function on each element of the $coll (starting from the last item), passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value.",seeAlso:["reduce","collection.reducei-right"],examples:['let cu = import(collection); cu.reduce-right(["A", "B", "C"], str, "")',"let cu = import(collection); cu.reduce-right({ a: 1, b: 2 }, +, 0)"]}},"reducei-right":{evaluate:()=>{throw new Error("reducei-right: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any"},args:{coll:{type:"collection"},fun:{type:"function",description:"The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index."},initial:{type:"any",description:"The initial value to use as the accumulator."}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Runs $fun function on each element of the $coll (starting from the last item), passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.",seeAlso:["collection.reducei","collection.reduce-right"],examples:["let cu = import(collection); cu.reducei-right([1, 2, 3], (acc, x, i) -> acc + x + i, 0)",'let cu = import(collection); cu.reducei-right("Albert", (acc, x, i) -> acc ++ x ++ i, "")','let cu = import(collection); cu.reducei-right({ a: 1, b: 2 }, -> $1 ++ $3, "")']}},reductions:{evaluate:()=>{throw new Error("reductions: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any",array:!0},args:{fun:{type:"function"},coll:{type:"collection"},initial:{type:"any"}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Returns an array of the intermediate values of the reduction (see `reduce`) of $coll by $fun.",seeAlso:["reduce","collection.reductionsi"],examples:["let cu = import(collection); cu.reductions([1, 2, 3], +, 0)","let cu = import(collection); cu.reductions([1, 2, 3], +, 10)","let cu = import(collection); cu.reductions([], +, 0)","let cu = import(collection); cu.reductions({ a: 1, b: 2 }, +, 0)","\nlet cu = import(collection);\ncu.reductions(\n [1, 2, 3, 4, 5, 6, 7, 8, 9],\n (result, value) -> result + (even?(value) ? value : 0),\n 0\n)"]}},reductionsi:{evaluate:()=>{throw new Error("reductionsi: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any",array:!0},args:{coll:{type:"collection"},fun:{type:"function",description:"The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index."},initial:{type:"any",description:"The initial value to use as the accumulator."}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Returns an array of the intermediate values of the reduction (see `reduce`) of $coll by $fun. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.",seeAlso:["collection.reductions","collection.reducei"],examples:["let cu = import(collection); cu.reductionsi([1, 2, 3], (acc, x, i) -> acc + x + i, 0)",'let cu = import(collection); cu.reductionsi("Albert", (acc, x, i) -> acc ++ x ++ i, "")','let cu = import(collection); cu.reductionsi({ a: 1, b: 2 }, -> $1 ++ $3, "")']}},"not-empty":{evaluate:([e],n)=>null===e?null:(y(e,n),"string"==typeof e||Array.isArray(e)?e.length>0?e:null:Object.keys(e).length>0?e:null),arity:N(1),docs:{category:"collection",returns:{type:"any"},args:{coll:{type:["collection","null"]}},variants:[{argumentNames:["coll"]}],description:"Returns `null` if $coll is empty or `null`, otherwise $coll.",seeAlso:["empty?","not-empty?"],examples:["let cu = import(collection); cu.not-empty([])","let cu = import(collection); cu.not-empty([1, 2, 3])","let cu = import(collection); cu.not-empty({})","let cu = import(collection); cu.not-empty({ a: 2 })",'let cu = import(collection); cu.not-empty("")','let cu = import(collection); cu.not-empty("Albert")',"let cu = import(collection); cu.not-empty(null)"]}},"every?":{evaluate:()=>{throw new Error("every?: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"boolean"},args:{a:{type:"collection"},b:{type:"function"}},variants:[{argumentNames:["a","b"]}],description:"Returns `true` if all entries in $a pass the test implemented by $b, otherwise returns `false`.",seeAlso:["collection.any?","collection.not-every?","collection.not-any?","functional.every-pred","grid.cell-every?"],examples:["let cu = import(collection); cu.every?([1, 2, 3], number?)","let cu = import(collection); cu.every?([1, 2, 3], even?)",'\nlet cu = import(collection);\ncu.every?(\n ["Albert", "Mojir", 160, [1, 2]],\n string?,\n)',"\nlet cu = import(collection);\ncu.every?(\n [50, 100, 150, 200],\n -> $ > 10,\n)","let cu = import(collection); cu.every?([], number?)",'let cu = import(collection); cu.every?("", number?)',"let cu = import(collection); cu.every?({}, number?)","\nlet cu = import(collection);\ncu.every?(\n { a: 2, b: 4},\n -> even?(second($))\n)","\nlet cu = import(collection);\ncu.every?(\n { a: 2, b: 3 },\n -> even?(second($))\n)"]}},"any?":{evaluate:()=>{throw new Error("any?: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"boolean"},args:{a:{type:"collection"},b:{type:"function"}},variants:[{argumentNames:["a","b"]}],description:"Returns `true` if any element in $a pass the test implemented by $b, otherwise returns `false`.",seeAlso:["collection.every?","collection.not-any?","collection.not-every?","functional.some-pred","some","grid.some?"],examples:['\nlet cu = import(collection);\ncu.any?(\n ["Albert", "Mojir", 160, [1, 2]],\n string?\n)',"\nlet cu = import(collection);\ncu.any?(\n [50, 100, 150, 200],\n x -> x > 10\n)","let cu = import(collection); cu.any?([], number?)",'let cu = import(collection); cu.any?("", number?)',"let cu = import(collection); cu.any?({}, number?)","\nlet cu = import(collection);\ncu.any?(\n { a: 2, b: 3 },\n -> even?(second($))\n)","\nlet cu = import(collection);\ncu.any?(\n { a: 1, b: 3 },\n -> even?(second($))\n)"]}},"not-any?":{evaluate:()=>{throw new Error("not-any?: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"boolean"},args:{a:{type:"collection"},b:{type:"function"}},variants:[{argumentNames:["a","b"]}],description:"Returns `false` if any element in $a pass the test implemented by $b, otherwise returns `true`.",seeAlso:["collection.any?","collection.every?","collection.not-every?"],examples:['\nlet cu = import(collection);\ncu.not-any?(\n ["Albert", "Mojir", 160, [1, 2]],\n string?\n)',"\nlet cu = import(collection);\ncu.not-any?(\n [50, 100, 150, 200],\n x -> x > 10\n)","let cu = import(collection); cu.not-any?([], number?)",'let cu = import(collection); cu.not-any?("", number?)',"let cu = import(collection); cu.not-any?({}, number?)","\nlet cu = import(collection);\ncu.not-any?(\n { a: 2, b: 3 },\n -> even?(second($))\n)","\nlet cu = import(collection);\ncu.not-any?(\n { a: 1, b: 3 },\n -> even?(second($))\n)"]}},"not-every?":{evaluate:()=>{throw new Error("not-every?: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"boolean"},args:{a:{type:"collection"},b:{type:"function"}},variants:[{argumentNames:["a","b"]}],description:"Returns `true` if at least one element in $a does not pass the test implemented by $b, otherwise returns `false`.",seeAlso:["collection.every?","collection.any?","collection.not-any?"],examples:['\nlet cu = import(collection);\ncu.not-every?(\n ["Albert", "Mojir", 160, [1, 2]],\n string?\n)',"\nlet cu = import(collection);\ncu.not-every?(\n [50, 100, 150, 200],\n x -> x > 10\n)","let cu = import(collection); cu.not-every?([], number?)",'let cu = import(collection); cu.not-every?("", number?)',"let cu = import(collection); cu.not-every?({}, number?)","\nlet cu = import(collection);\ncu.not-every?(\n { a: 2, b: 4 },\n -> even?(second($))\n)","\nlet cu = import(collection);\ncu.not-every?(\n { a: 2, b: 3 },\n -> even?(second($))\n)"]}}},M={name:"collection",functions:C,source:'{\n update: (coll, key, fn, ...extra-params) ->\n assoc(coll, key, apply(fn, [get(coll, key), ...extra-params])),\n\n update-in: (coll, ks, fn, ...extra-params) -> do\n let k = first(ks);\n if count(ks) == 1 then\n assoc(coll, k, apply(fn, [get(coll, k), ...extra-params]))\n else\n let inner = get(coll, k);\n let inner-coll = null?(inner) ? {} : inner;\n assoc(coll, k, apply(self, [inner-coll, slice(ks, 1), fn, ...extra-params]))\n end\n end,\n\n filteri: (coll, fn) -> do\n cond\n case array?(coll) then\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> if fn(first(pair), second(pair)) then [...acc, first(pair)] else acc end,\n []\n )\n\n case string?(coll) then\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> if fn(first(pair), second(pair)) then ++(acc, first(pair)) else acc end,\n ""\n )\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) ->\n if fn(coll(k), k) then assoc(acc, k, coll(k)) else acc end,\n {}\n )\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n mapi: (coll, fn) -> do\n cond\n case array?(coll) then\n for (i in range(count(coll))) -> fn(nth(coll, i), i)\n\n case string?(coll) then\n reduce(\n for (i in range(count(coll))) -> fn(nth(coll, i), i),\n (acc, ch) -> ++(acc, ch),\n ""\n )\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) ->\n assoc(acc, k, fn(coll(k), k)),\n {}\n )\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n reducei: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n loop (acc = initial, i = 0) -> do\n if i >= count(coll) then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i + 1)\n end\n end\n\n case array?(coll) then\n loop (acc = initial, i = 0) -> do\n if i >= count(coll) then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i + 1)\n end\n end\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) -> fn(acc, coll(k), k), initial)\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n reduce-right: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n reduce(reverse(coll), fn, initial)\n\n case array?(coll) then\n reduce(reverse(coll), fn, initial)\n\n case object?(coll) then\n reduce(reverse(keys(coll)), (acc, k) -> fn(acc, coll(k)), initial)\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n reducei-right: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n let len = count(coll);\n loop (acc = initial, i = len - 1) -> do\n if i < 0 then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i - 1)\n end\n end\n\n case array?(coll) then\n let len = count(coll);\n loop (acc = initial, i = len - 1) -> do\n if i < 0 then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i - 1)\n end\n end\n\n case object?(coll) then\n reduce(reverse(keys(coll)), (acc, k) -> fn(acc, coll(k), k), initial)\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n reductions: (coll, fn, initial) -> do\n let items = cond\n case string?(coll) then\n if count(coll) == 0 then [] else for (i in range(count(coll))) -> nth(coll, i) end\n\n case array?(coll) then coll\n\n case object?(coll) then\n for (k in keys(coll)) -> coll(k)\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end;\n if count(items) == 0 then\n [initial]\n else\n reduce(items, (acc, elem) -> do\n let prev = last(acc);\n [...acc, fn(prev, elem)]\n end, [initial])\n end\n end,\n\n reductionsi: (coll, fn, initial) -> do\n cond\n case string?(coll) then do\n if count(coll) == 0 then\n [initial]\n else\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> do\n let prev = last(acc);\n [...acc, fn(prev, first(pair), second(pair))]\n end,\n [initial]\n )\n end\n end\n\n case array?(coll) then do\n if count(coll) == 0 then\n [initial]\n else\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> do\n let prev = last(acc);\n [...acc, fn(prev, first(pair), second(pair))]\n end,\n [initial]\n )\n end\n end\n\n case object?(coll) then do\n let ks = keys(coll);\n if count(ks) == 0 then\n [initial]\n else\n reduce(ks, (acc, k) -> do\n let prev = last(acc);\n [...acc, fn(prev, coll(k), k)]\n end, [initial])\n end\n end\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n "every?": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), "Expected collection")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then true\n case not(fn(nth(items, i))) then false\n case true then recur(i + 1)\n end\n end,\n\n "any?": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), "Expected collection")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then false\n case fn(nth(items, i)) then true\n case true then recur(i + 1)\n end\n end,\n\n "not-any?": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), "Expected collection")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then true\n case fn(nth(items, i)) then false\n case true then recur(i + 1)\n end\n end,\n\n "not-every?": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), "Expected collection")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then false\n case not(fn(nth(items, i))) then true\n case true then recur(i + 1)\n end\n end\n}',docs:(S=C,Object.fromEntries(Object.entries(S).map(([e,n])=>{if(!n.docs)throw new Error(`Missing docs for function "${e}"`);return[e,n.docs]})))};var S;export{M as collectionUtilsModule};
2
- //# sourceMappingURL=collection.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collection.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/utils/debug/getSourceCodeInfo.ts","../../src/utils/getAssertionError.ts","../../src/typeGuards/dvala.ts","../../src/typeGuards/dvalaFunction.ts","../../src/typeGuards/number.ts","../../src/typeGuards/string.ts","../../src/utils/index.ts","../../src/typeGuards/array.ts","../../src/utils/arity.ts","../../src/builtin/modules/collection/index.ts","../../src/builtin/modules/collection/collection.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 { 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 { 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 { 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 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 { 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'\nimport { getAssertionError } from '../utils/getAssertionError'\n\ntype StringAssertionOptions =\n | {\n nonEmpty?: true\n char?: never\n }\n | {\n nonEmpty?: never\n char?: true\n }\n\nexport function isString(value: unknown, options: StringAssertionOptions = {}): value is string {\n if (typeof value !== 'string')\n return false\n\n if (options.nonEmpty && value.length === 0)\n return false\n\n if (options.char && value.length !== 1)\n return false\n\n return true\n}\n\nexport function assertString(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: StringAssertionOptions = {},\n): asserts value is string {\n if (!isString(value, options)) {\n throw getAssertionError(\n `${options.nonEmpty ? 'non empty string' : options.char ? 'character' : 'string'}`,\n value,\n sourceCodeInfo,\n )\n }\n}\n\nexport function asString(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: StringAssertionOptions = {},\n): string {\n assertString(value, sourceCodeInfo, options)\n return value\n}\n\nexport function isStringOrNumber(value: unknown): value is string | number {\n return typeof value === 'string' || typeof value === 'number'\n}\nexport function asStringOrNumber(value: unknown, sourceCodeInfo?: SourceCodeInfo): string | number {\n assertStringOrNumber(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | number {\n if (!isStringOrNumber(value))\n throw getAssertionError('string or number', value, sourceCodeInfo)\n}\n","import type { Any, Coll, Obj } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { asAny, isColl, isObj, isRegularExpression } from '../typeGuards/dvala'\nimport { isNumber } from '../typeGuards/number'\nimport { asString, assertStringOrNumber } from '../typeGuards/string'\nimport { isUnknownRecord } from '../typeGuards'\nimport { DvalaError } from '../errors'\n\nexport function collHasKey(coll: unknown, key: string | number): boolean {\n if (!isColl(coll))\n return false\n\n if (typeof coll === 'string' || Array.isArray(coll)) {\n if (!isNumber(key, { integer: true }))\n return false\n\n return key >= 0 && key < coll.length\n }\n return !!Object.getOwnPropertyDescriptor(coll, key)\n}\n\nexport function compare<T extends string | number>(a: T, b: T, sourceCodeInfo: SourceCodeInfo | undefined): number {\n assertStringOrNumber(a, sourceCodeInfo)\n assertStringOrNumber(b, sourceCodeInfo)\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a < b ? -1 : a > b ? 1 : 0\n }\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.sign((a) - (b))\n }\n throw new DvalaError(`Cannot compare values of different types: ${typeof a} and ${typeof b}`, sourceCodeInfo)\n}\n\nexport function deepEqual(a: unknown, b: unknown, sourceCodeInfo?: SourceCodeInfo): boolean {\n if (a === b)\n return true\n\n if (typeof a === 'number' && typeof b === 'number')\n return approxEqual(a, b)\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false\n\n for (let i = 0; i < a.length; i += 1) {\n if (!deepEqual(asAny(a[i], sourceCodeInfo), asAny(b[i], sourceCodeInfo), sourceCodeInfo))\n return false\n }\n return true\n }\n if (isRegularExpression(a) && isRegularExpression(b))\n return a.s === b.s && a.f === b.f\n\n if (isUnknownRecord(a) && isUnknownRecord(b)) {\n const aKeys = Object.keys(a)\n const bKeys = Object.keys(b)\n if (aKeys.length !== bKeys.length)\n return false\n\n for (let i = 0; i < aKeys.length; i += 1) {\n const key = asString(aKeys[i], sourceCodeInfo)\n if (!deepEqual(a[key], b[key], sourceCodeInfo))\n return false\n }\n return true\n }\n return false\n}\n\nexport function toNonNegativeInteger(num: number): number {\n return Math.max(0, Math.ceil(num))\n}\n\nexport function toAny(value: unknown): Any {\n return (value ?? null) as Any\n}\n\nfunction clone<T>(value: T): T {\n if (isObj(value)) {\n return Object.entries(value).reduce((result: Obj, entry) => {\n const [key, val] = entry\n result[key] = clone(val)\n return result\n }, {}) as T\n }\n if (Array.isArray(value))\n // eslint-disable-next-line ts/no-unsafe-return\n return value.map(item => clone(item)) as unknown as T\n\n return value\n}\n\nexport function cloneColl<T extends Coll>(value: T): T {\n return clone(value)\n}\n\nexport function joinSets<T>(...results: Set<T>[]): Set<T> {\n const result = new Set<T>()\n for (const symbols of results)\n symbols.forEach(symbol => result.add(symbol))\n\n return result\n}\n\nexport function addToSet<T>(target: Set<T>, source: Set<T>): void {\n source.forEach(symbol => target.add(symbol))\n}\n\nexport const EPSILON = 1e-10\n\nexport function approxEqual(a: number, b: number, epsilon: number = EPSILON): boolean {\n if (a === b) {\n return true\n }\n\n const diff = Math.abs(a - b)\n\n if (a === 0 || b === 0 || diff < epsilon) {\n // Use absolute error for values near zero\n return diff < epsilon\n }\n const absA = Math.abs(a)\n const absB = Math.abs(b)\n\n // Use relative error for larger values\n return diff / (absA + absB) < epsilon\n}\n\nexport function approxZero(value: number): boolean {\n return Math.abs(value) < EPSILON\n}\n\nexport function smartTrim(str: string, minIndent = 0): string {\n const lines = str.split('\\n')\n while (lines[0]?.match(/^\\s*$/)) {\n lines.shift() // Remove leading empty lines\n }\n while (lines[lines.length - 1]?.match(/^\\s*$/)) {\n lines.pop() // Remove trailing empty lines\n }\n const indent = lines.reduce((acc, line) => {\n if (line.match(/^\\s*$/))\n return acc // Skip empty lines\n const lineIndent = line.match(/^\\s*/)![0].length\n return Math.min(acc, lineIndent)\n }, Infinity)\n return lines.map(line => ' '.repeat(minIndent) + line.slice(indent)).join('\\n').trimEnd()\n}\n","import type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\n\n// isArray not needed, use Array.isArary\nexport function asArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): unknown[] {\n assertArray(value, sourceCodeInfo)\n return value\n}\nexport function assertArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is unknown[] {\n if (!Array.isArray(value))\n throw getAssertionError('array', value, sourceCodeInfo)\n}\n\nexport function isStringArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every(v => typeof v === 'string')\n}\nexport function asStringArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): string[] {\n assertStringArray(value, sourceCodeInfo)\n return value\n}\nexport function assertStringArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is string[] {\n if (!isStringArray(value))\n throw getAssertionError('array of strings', value, sourceCodeInfo)\n}\n\nexport function isCharArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every(v => typeof v === 'string' && v.length === 1)\n}\nexport function asCharArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): string[] {\n assertCharArray(value, sourceCodeInfo)\n return value\n}\nexport function assertCharArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is string[] {\n if (!isCharArray(value))\n throw getAssertionError('array of strings', value, 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 { Any, Arr, Coll, Obj } from '../../../interface'\nimport type { SourceCodeInfo } from '../../../tokenizer/token'\nimport { cloneColl, collHasKey, toAny } from '../../../utils'\nimport { asColl, assertAny, assertColl, assertObj, isColl, isObj } from '../../../typeGuards/dvala'\nimport type { BuiltinNormalExpressions } from '../../interface'\nimport { assertArray } from '../../../typeGuards/array'\nimport { assertNumber, isNumber } from '../../../typeGuards/number'\nimport { asStringOrNumber, assertString, assertStringOrNumber } from '../../../typeGuards/string'\nimport { toFixedArity } from '../../../utils/arity'\nimport { moduleDocsFromFunctions } from '../interface'\nimport type { DvalaModule } from '../interface'\nimport collectionModuleSource from './collection.dvala'\n\n// --- Private helper: get value from collection by key ---\nfunction get(coll: Coll, key: string | number): Any | undefined {\n if (isObj(coll)) {\n if (typeof key === 'string' && collHasKey(coll, key))\n return toAny(coll[key])\n }\n else {\n if (isNumber(key, { nonNegative: true, integer: true }) && key >= 0 && key < coll.length)\n return toAny(coll[key])\n }\n return undefined\n}\n\n// --- Private helper: assoc value into collection ---\nfunction assoc(coll: Coll, key: string | number, value: Any, sourceCodeInfo?: SourceCodeInfo) {\n assertColl(coll, sourceCodeInfo)\n if (Array.isArray(coll) || typeof coll === 'string') {\n assertNumber(key, sourceCodeInfo, { integer: true })\n assertNumber(key, sourceCodeInfo, { gte: 0 })\n assertNumber(key, sourceCodeInfo, { lte: coll.length })\n if (typeof coll === 'string') {\n assertString(value, sourceCodeInfo, { char: true })\n return `${coll.slice(0, key)}${value}${coll.slice(key + 1)}`\n }\n const copy = [...coll]\n copy[key] = value\n return copy\n }\n assertString(key, sourceCodeInfo)\n const copy = { ...coll }\n copy[key] = value\n return copy\n}\n\ninterface CollMeta {\n coll: Coll\n parent: Obj | Arr\n}\n\n// --- Private helper: clone and get meta for nested operations ---\nfunction cloneAndGetMeta(\n originalColl: Coll,\n keys: Arr,\n sourceCodeInfo?: SourceCodeInfo,\n): { coll: Coll, innerCollMeta: CollMeta } {\n const coll = cloneColl(originalColl)\n\n const butLastKeys = keys.slice(0, keys.length - 1)\n\n const innerCollMeta = butLastKeys.reduce(\n (result: CollMeta, key) => {\n const resultColl = result.coll\n\n let newResultColl: Coll\n if (Array.isArray(resultColl)) {\n assertNumber(key, sourceCodeInfo)\n newResultColl = asColl(resultColl[key], sourceCodeInfo)\n }\n else {\n assertObj(resultColl, sourceCodeInfo)\n assertString(key, sourceCodeInfo)\n if (!collHasKey(result.coll, key))\n (resultColl)[key] = {}\n\n newResultColl = asColl(resultColl[key], sourceCodeInfo)\n }\n\n return { coll: newResultColl, parent: resultColl }\n },\n { coll, parent: {} },\n )\n return { coll, innerCollMeta }\n}\n\nconst collectionUtilsFunctions: BuiltinNormalExpressions = {\n 'get-in': {\n evaluate: (params, sourceCodeInfo): Any => {\n let coll = toAny(params[0])\n const keys = params[1] ?? [] // null behaves as empty array\n const defaultValue = toAny(params[2])\n assertArray(keys, sourceCodeInfo)\n for (const key of keys) {\n assertStringOrNumber(key, sourceCodeInfo)\n if (isColl(coll)) {\n const nextValue = get(coll, key)\n if (nextValue !== undefined)\n coll = nextValue\n else\n return defaultValue\n }\n else {\n return defaultValue\n }\n }\n return coll\n },\n arity: { min: 2, max: 3 },\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n 'a': { type: 'collection' },\n 'b': { type: 'array' },\n 'not-found': { type: 'any' },\n },\n variants: [\n { argumentNames: ['a', 'b'] },\n { argumentNames: ['a', 'b', 'not-found'] },\n ],\n description: 'Returns the value in a nested collection, where $b is an array of keys. Returns $not-found if the key is not present. If $not-found is not set, `null` is returned.',\n seeAlso: ['get', 'collection.assoc-in', 'collection.update-in'],\n examples: [\n `\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: \"Kalle\" }, 6]],\n [1, 1, \"a\", 0]\n)`,\n `\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: \"Kalle\" }, 6]],\n [1, 1, \"b\", 0]\n)`,\n `\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: \"Kalle\" }, 6]],\n [1, 1, \"b\", 0],\n \"Lisa\"\n)`,\n ],\n },\n },\n 'assoc-in': {\n evaluate: ([originalColl, keys, value], sourceCodeInfo): Coll => {\n assertColl(originalColl, sourceCodeInfo)\n assertArray(keys, sourceCodeInfo)\n assertAny(value, sourceCodeInfo)\n\n if (keys.length === 1) {\n assertStringOrNumber(keys[0], sourceCodeInfo)\n return assoc(originalColl, keys[0], value, sourceCodeInfo)\n }\n\n const { coll, innerCollMeta } = cloneAndGetMeta(originalColl, keys, sourceCodeInfo)\n\n const lastKey = asStringOrNumber(keys[keys.length - 1], sourceCodeInfo)\n const parentKey = asStringOrNumber(keys[keys.length - 2], sourceCodeInfo)\n\n if (Array.isArray(innerCollMeta.parent)) {\n assertNumber(parentKey, sourceCodeInfo)\n innerCollMeta.parent[parentKey] = assoc(innerCollMeta.coll, lastKey, value, sourceCodeInfo)\n }\n else {\n assertString(parentKey, sourceCodeInfo)\n innerCollMeta.parent[parentKey] = assoc(innerCollMeta.coll, lastKey, value, sourceCodeInfo)\n }\n\n return coll\n },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n coll: { type: 'collection' },\n ks: { type: ['number', 'string'], array: true },\n value: { type: 'any' },\n },\n variants: [{ argumentNames: ['coll', 'ks', 'value'] }],\n description: `\nAssociates a value in the nested collection $coll, where $ks is an array of keys and $value is the new value.\n\nIf any levels do not exist, objects will be created - and the corresponding keys must be of type string.`,\n seeAlso: ['assoc', 'collection.get-in', 'collection.update-in'],\n examples: [\n `\nlet cu = import(collection);\ncu.assoc-in(\n {},\n [\"a\", \"b\", \"c\"],\n \"Albert\"\n)`,\n `\nlet cu = import(collection);\ncu.assoc-in(\n [1, 2, [1, 2, 3]],\n [2, 1],\n \"Albert\"\n)`,\n `\nlet cu = import(collection);\ncu.assoc-in(\n [1, 2, { name: \"albert\" }],\n [2, \"name\", 0],\n \"A\"\n)`,\n ],\n },\n },\n 'update': {\n evaluate: () => { throw new Error('update: Dvala implementation should be used instead') },\n arity: { min: 3 },\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n 'coll': { type: 'collection' },\n 'key': { type: ['string', 'number'] },\n 'fun': { type: 'function' },\n 'fun-args': { type: 'any', rest: true },\n },\n variants: [\n { argumentNames: ['coll', 'key', 'fun'] },\n { argumentNames: ['coll', 'key', 'fun', 'fun-args'] },\n ],\n description: `\nUpdates a value in the $coll collection, where $key is a key. $fun is a function\nthat will take the old value and any supplied $fun-args and\nreturn the new value.\nIf the key does not exist, \\`null\\` is passed as the old value.`,\n seeAlso: ['collection.update-in', 'assoc'],\n examples: [\n `\nlet cu = import(collection);\nlet x = { a: 1, b: 2 };\ncu.update(x, \"a\", inc)`,\n `\nlet cu = import(collection);\nlet x = { a: 1, b: 2 };\ncu.update(\n x,\n \"c\",\n val -> null?(val) ? 0 : inc(val)\n)`,\n ],\n },\n },\n 'update-in': {\n evaluate: () => { throw new Error('update-in: Dvala implementation should be used instead') },\n arity: { min: 3 },\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n 'coll': { type: 'collection' },\n 'ks': { type: 'array' },\n 'fun': { type: 'function' },\n 'fun-args': { type: 'any', rest: true },\n },\n variants: [\n { argumentNames: ['coll', 'ks', 'fun'] },\n { argumentNames: ['coll', 'ks', 'fun', 'fun-args'] },\n ],\n description: `Updates a value in the $coll collection, where $ks is an array of\nkeys and $fun is a function that will take the old value and\nany supplied $fun-args and return the new value. If any levels do not exist,\nobjects will be created - and the corresponding keys must be of type string.`,\n seeAlso: ['collection.update', 'collection.assoc-in', 'collection.get-in'],\n examples: [\n `\nlet cu = import(collection);\ncu.update-in(\n { a: [1, 2, 3] },\n [\"a\", 1],\n -> null?($) ? 0 : inc($)\n)`,\n `\nlet cu = import(collection);\ncu.update-in(\n { a: { foo: \"bar\"} },\n [\"a\", \"foo\"],\n -> null?($) ? \"?\" : \"!\"\n)`,\n `\nlet cu = import(collection);\ncu.update-in(\n { a: { foo: \"bar\"} },\n [\"a\", \"baz\"],\n -> null?($) ? \"?\" : \"!\"\n)`,\n `\nlet cu = import(collection);\ncu.update-in(\n { a: [1, 2, 3] },\n [\"a\", 1],\n *,\n 10,\n 10,\n 10,\n)`,\n ],\n },\n },\n 'filteri': {\n evaluate: () => { throw new Error('filteri: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n a: { type: 'collection' },\n b: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take two arguments: the element itself and the index.',\n },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Creates a new collection with all elements that pass the test implemented by $b. The function is called for each element in the collection, and it should take two arguments: the element itself and the index.',\n seeAlso: ['filter', 'collection.mapi'],\n examples: [\n 'let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> i % 2 == 0)',\n 'let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> x % 2 == 0)',\n 'let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> x + i > 3)',\n ],\n },\n },\n 'mapi': {\n evaluate: () => { throw new Error('mapi: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n a: { type: 'collection' },\n b: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take two arguments: the element itself and the index.',\n },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Creates a new collection populated with the results of calling $b on every element in $a. The function is called for each element in the collection, and it should take two arguments: the element itself and the index.',\n seeAlso: ['map', 'collection.filteri'],\n examples: [\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x + i)',\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x * i)',\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x - i)',\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x / i)',\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x % inc(i))',\n ],\n },\n },\n 'reducei': {\n evaluate: () => { throw new Error('reducei: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n coll: { type: 'collection' },\n fun: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index.',\n },\n initial: {\n type: 'any',\n description: 'The initial value to use as the accumulator.',\n },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Runs $fun function on each element of the $coll, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.',\n seeAlso: ['reduce', 'collection.reducei-right', 'collection.reductionsi'],\n examples: [\n 'let cu = import(collection); cu.reducei([1, 2, 3], (acc, x, i) -> acc + x + i, 0)',\n 'let cu = import(collection); cu.reducei(\"Albert\", (acc, x, i) -> acc ++ x ++ i, \"\")',\n 'let cu = import(collection); cu.reducei({ a: 1, b: 2 }, -> $1 ++ $3, \"\")',\n ],\n },\n },\n 'reduce-right': {\n evaluate: () => { throw new Error('reduce-right: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n fun: { type: 'function' },\n coll: { type: 'collection' },\n initial: { type: 'any' },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Runs $fun function on each element of the $coll (starting from the last item), passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value.',\n seeAlso: ['reduce', 'collection.reducei-right'],\n examples: [\n 'let cu = import(collection); cu.reduce-right([\"A\", \"B\", \"C\"], str, \"\")',\n 'let cu = import(collection); cu.reduce-right({ a: 1, b: 2 }, +, 0)',\n ],\n },\n },\n 'reducei-right': {\n evaluate: () => { throw new Error('reducei-right: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n coll: { type: 'collection' },\n fun: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index.',\n },\n initial: {\n type: 'any',\n description: 'The initial value to use as the accumulator.',\n },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Runs $fun function on each element of the $coll (starting from the last item), passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.',\n seeAlso: ['collection.reducei', 'collection.reduce-right'],\n examples: [\n 'let cu = import(collection); cu.reducei-right([1, 2, 3], (acc, x, i) -> acc + x + i, 0)',\n 'let cu = import(collection); cu.reducei-right(\"Albert\", (acc, x, i) -> acc ++ x ++ i, \"\")',\n 'let cu = import(collection); cu.reducei-right({ a: 1, b: 2 }, -> $1 ++ $3, \"\")',\n ],\n },\n },\n 'reductions': {\n evaluate: () => { throw new Error('reductions: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any', array: true },\n args: {\n fun: { type: 'function' },\n coll: { type: 'collection' },\n initial: { type: 'any' },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Returns an array of the intermediate values of the reduction (see `reduce`) of $coll by $fun.',\n seeAlso: ['reduce', 'collection.reductionsi'],\n examples: [\n 'let cu = import(collection); cu.reductions([1, 2, 3], +, 0)',\n 'let cu = import(collection); cu.reductions([1, 2, 3], +, 10)',\n 'let cu = import(collection); cu.reductions([], +, 0)',\n 'let cu = import(collection); cu.reductions({ a: 1, b: 2 }, +, 0)',\n `\nlet cu = import(collection);\ncu.reductions(\n [1, 2, 3, 4, 5, 6, 7, 8, 9],\n (result, value) -> result + (even?(value) ? value : 0),\n 0\n)`,\n ],\n },\n },\n 'reductionsi': {\n evaluate: () => { throw new Error('reductionsi: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any', array: true },\n args: {\n coll: { type: 'collection' },\n fun: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index.',\n },\n initial: {\n type: 'any',\n description: 'The initial value to use as the accumulator.',\n },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Returns an array of the intermediate values of the reduction (see `reduce`) of $coll by $fun. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.',\n seeAlso: ['collection.reductions', 'collection.reducei'],\n examples: [\n 'let cu = import(collection); cu.reductionsi([1, 2, 3], (acc, x, i) -> acc + x + i, 0)',\n 'let cu = import(collection); cu.reductionsi(\"Albert\", (acc, x, i) -> acc ++ x ++ i, \"\")',\n 'let cu = import(collection); cu.reductionsi({ a: 1, b: 2 }, -> $1 ++ $3, \"\")',\n ],\n },\n },\n 'not-empty': {\n evaluate: ([coll], sourceCodeInfo): Coll | null => {\n if (coll === null)\n return null\n\n assertColl(coll, sourceCodeInfo)\n if (typeof coll === 'string')\n return coll.length > 0 ? coll : null\n\n if (Array.isArray(coll))\n return coll.length > 0 ? coll : null\n\n return Object.keys(coll).length > 0 ? coll : null\n },\n arity: toFixedArity(1),\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n coll: { type: ['collection', 'null'] },\n },\n variants: [{ argumentNames: ['coll'] }],\n description: 'Returns `null` if $coll is empty or `null`, otherwise $coll.',\n seeAlso: ['empty?', 'not-empty?'],\n examples: [\n 'let cu = import(collection); cu.not-empty([])',\n 'let cu = import(collection); cu.not-empty([1, 2, 3])',\n 'let cu = import(collection); cu.not-empty({})',\n 'let cu = import(collection); cu.not-empty({ a: 2 })',\n 'let cu = import(collection); cu.not-empty(\"\")',\n 'let cu = import(collection); cu.not-empty(\"Albert\")',\n 'let cu = import(collection); cu.not-empty(null)',\n ],\n },\n },\n 'every?': {\n evaluate: () => { throw new Error('every?: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'boolean' },\n args: {\n a: { type: 'collection' },\n b: { type: 'function' },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Returns `true` if all entries in $a pass the test implemented by $b, otherwise returns `false`.',\n seeAlso: ['collection.any?', 'collection.not-every?', 'collection.not-any?', 'functional.every-pred', 'grid.cell-every?'],\n examples: [\n 'let cu = import(collection); cu.every?([1, 2, 3], number?)',\n 'let cu = import(collection); cu.every?([1, 2, 3], even?)',\n `\nlet cu = import(collection);\ncu.every?(\n [\"Albert\", \"Mojir\", 160, [1, 2]],\n string?,\n)`,\n `\nlet cu = import(collection);\ncu.every?(\n [50, 100, 150, 200],\n -> $ > 10,\n)`,\n 'let cu = import(collection); cu.every?([], number?)',\n 'let cu = import(collection); cu.every?(\"\", number?)',\n 'let cu = import(collection); cu.every?({}, number?)',\n `\nlet cu = import(collection);\ncu.every?(\n { a: 2, b: 4},\n -> even?(second($))\n)`,\n `\nlet cu = import(collection);\ncu.every?(\n { a: 2, b: 3 },\n -> even?(second($))\n)`,\n ],\n },\n },\n 'any?': {\n evaluate: () => { throw new Error('any?: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'boolean' },\n args: {\n a: { type: 'collection' },\n b: { type: 'function' },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Returns `true` if any element in $a pass the test implemented by $b, otherwise returns `false`.',\n seeAlso: ['collection.every?', 'collection.not-any?', 'collection.not-every?', 'functional.some-pred', 'some', 'grid.some?'],\n examples: [\n `\nlet cu = import(collection);\ncu.any?(\n [\"Albert\", \"Mojir\", 160, [1, 2]],\n string?\n)`,\n `\nlet cu = import(collection);\ncu.any?(\n [50, 100, 150, 200],\n x -> x > 10\n)`,\n 'let cu = import(collection); cu.any?([], number?)',\n 'let cu = import(collection); cu.any?(\"\", number?)',\n 'let cu = import(collection); cu.any?({}, number?)',\n `\nlet cu = import(collection);\ncu.any?(\n { a: 2, b: 3 },\n -> even?(second($))\n)`,\n `\nlet cu = import(collection);\ncu.any?(\n { a: 1, b: 3 },\n -> even?(second($))\n)`,\n ],\n },\n },\n 'not-any?': {\n evaluate: () => { throw new Error('not-any?: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'boolean' },\n args: {\n a: { type: 'collection' },\n b: { type: 'function' },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Returns `false` if any element in $a pass the test implemented by $b, otherwise returns `true`.',\n seeAlso: ['collection.any?', 'collection.every?', 'collection.not-every?'],\n examples: [\n `\nlet cu = import(collection);\ncu.not-any?(\n [\"Albert\", \"Mojir\", 160, [1, 2]],\n string?\n)`,\n `\nlet cu = import(collection);\ncu.not-any?(\n [50, 100, 150, 200],\n x -> x > 10\n)`,\n 'let cu = import(collection); cu.not-any?([], number?)',\n 'let cu = import(collection); cu.not-any?(\"\", number?)',\n 'let cu = import(collection); cu.not-any?({}, number?)',\n `\nlet cu = import(collection);\ncu.not-any?(\n { a: 2, b: 3 },\n -> even?(second($))\n)`,\n `\nlet cu = import(collection);\ncu.not-any?(\n { a: 1, b: 3 },\n -> even?(second($))\n)`,\n ],\n },\n },\n 'not-every?': {\n evaluate: () => { throw new Error('not-every?: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'boolean' },\n args: {\n a: { type: 'collection' },\n b: { type: 'function' },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Returns `true` if at least one element in $a does not pass the test implemented by $b, otherwise returns `false`.',\n seeAlso: ['collection.every?', 'collection.any?', 'collection.not-any?'],\n examples: [\n `\nlet cu = import(collection);\ncu.not-every?(\n [\"Albert\", \"Mojir\", 160, [1, 2]],\n string?\n)`,\n `\nlet cu = import(collection);\ncu.not-every?(\n [50, 100, 150, 200],\n x -> x > 10\n)`,\n 'let cu = import(collection); cu.not-every?([], number?)',\n 'let cu = import(collection); cu.not-every?(\"\", number?)',\n 'let cu = import(collection); cu.not-every?({}, number?)',\n `\nlet cu = import(collection);\ncu.not-every?(\n { a: 2, b: 4 },\n -> even?(second($))\n)`,\n `\nlet cu = import(collection);\ncu.not-every?(\n { a: 2, b: 3 },\n -> even?(second($))\n)`,\n ],\n },\n },\n}\n\nexport const collectionUtilsModule: DvalaModule = {\n name: 'collection',\n functions: collectionUtilsFunctions,\n source: collectionModuleSource,\n docs: moduleDocsFromFunctions(collectionUtilsFunctions),\n}\n","{\n update: (coll, key, fn, ...extra-params) ->\n assoc(coll, key, apply(fn, [get(coll, key), ...extra-params])),\n\n update-in: (coll, ks, fn, ...extra-params) -> do\n let k = first(ks);\n if count(ks) == 1 then\n assoc(coll, k, apply(fn, [get(coll, k), ...extra-params]))\n else\n let inner = get(coll, k);\n let inner-coll = null?(inner) ? {} : inner;\n assoc(coll, k, apply(self, [inner-coll, slice(ks, 1), fn, ...extra-params]))\n end\n end,\n\n filteri: (coll, fn) -> do\n cond\n case array?(coll) then\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> if fn(first(pair), second(pair)) then [...acc, first(pair)] else acc end,\n []\n )\n\n case string?(coll) then\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> if fn(first(pair), second(pair)) then ++(acc, first(pair)) else acc end,\n \"\"\n )\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) ->\n if fn(coll(k), k) then assoc(acc, k, coll(k)) else acc end,\n {}\n )\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n mapi: (coll, fn) -> do\n cond\n case array?(coll) then\n for (i in range(count(coll))) -> fn(nth(coll, i), i)\n\n case string?(coll) then\n reduce(\n for (i in range(count(coll))) -> fn(nth(coll, i), i),\n (acc, ch) -> ++(acc, ch),\n \"\"\n )\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) ->\n assoc(acc, k, fn(coll(k), k)),\n {}\n )\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n reducei: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n loop (acc = initial, i = 0) -> do\n if i >= count(coll) then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i + 1)\n end\n end\n\n case array?(coll) then\n loop (acc = initial, i = 0) -> do\n if i >= count(coll) then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i + 1)\n end\n end\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) -> fn(acc, coll(k), k), initial)\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n reduce-right: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n reduce(reverse(coll), fn, initial)\n\n case array?(coll) then\n reduce(reverse(coll), fn, initial)\n\n case object?(coll) then\n reduce(reverse(keys(coll)), (acc, k) -> fn(acc, coll(k)), initial)\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n reducei-right: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n let len = count(coll);\n loop (acc = initial, i = len - 1) -> do\n if i < 0 then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i - 1)\n end\n end\n\n case array?(coll) then\n let len = count(coll);\n loop (acc = initial, i = len - 1) -> do\n if i < 0 then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i - 1)\n end\n end\n\n case object?(coll) then\n reduce(reverse(keys(coll)), (acc, k) -> fn(acc, coll(k), k), initial)\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n reductions: (coll, fn, initial) -> do\n let items = cond\n case string?(coll) then\n if count(coll) == 0 then [] else for (i in range(count(coll))) -> nth(coll, i) end\n\n case array?(coll) then coll\n\n case object?(coll) then\n for (k in keys(coll)) -> coll(k)\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end;\n if count(items) == 0 then\n [initial]\n else\n reduce(items, (acc, elem) -> do\n let prev = last(acc);\n [...acc, fn(prev, elem)]\n end, [initial])\n end\n end,\n\n reductionsi: (coll, fn, initial) -> do\n cond\n case string?(coll) then do\n if count(coll) == 0 then\n [initial]\n else\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> do\n let prev = last(acc);\n [...acc, fn(prev, first(pair), second(pair))]\n end,\n [initial]\n )\n end\n end\n\n case array?(coll) then do\n if count(coll) == 0 then\n [initial]\n else\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> do\n let prev = last(acc);\n [...acc, fn(prev, first(pair), second(pair))]\n end,\n [initial]\n )\n end\n end\n\n case object?(coll) then do\n let ks = keys(coll);\n if count(ks) == 0 then\n [initial]\n else\n reduce(ks, (acc, k) -> do\n let prev = last(acc);\n [...acc, fn(prev, coll(k), k)]\n end, [initial])\n end\n end\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n \"every?\": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), \"Expected collection\")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then true\n case not(fn(nth(items, i))) then false\n case true then recur(i + 1)\n end\n end,\n\n \"any?\": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), \"Expected collection\")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then false\n case fn(nth(items, i)) then true\n case true then recur(i + 1)\n end\n end,\n\n \"not-any?\": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), \"Expected collection\")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then true\n case fn(nth(items, i)) then false\n case true then recur(i + 1)\n end\n end,\n\n \"not-every?\": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), \"Expected collection\")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then false\n case not(fn(nth(items, i))) then true\n case true then recur(i + 1)\n end\n end\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","getSourceCodeInfo","anyValue","getAssertionError","typeName","isObj","regexp","isEffect","isColl","isSeq","asColl","assertColl","isNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","assertNumber","sign","getSignString","numberType","range","getRangeString","filter","x","join","getNumberTypeName","assertString","nonEmpty","char","isString","asStringOrNumber","assertStringOrNumber","isStringOrNumber","collHasKey","coll","getOwnPropertyDescriptor","toAny","clone","entries","reduce","result","entry","val","map","item","cloneColl","assertArray","toFixedArity","arity","min","get","assoc","slice","copy","cloneAndGetMeta","originalColl","innerCollMeta","resultColl","newResultColl","assertObj","parent","collectionUtilsFunctions","evaluate","params","defaultValue","nextValue","undefined","docs","category","returns","args","a","b","variants","argumentNames","description","seeAlso","examples","isAny","assertAny","lastKey","parentKey","ks","array","update","fun","rest","filteri","mapi","reducei","initial","reductions","reductionsi","collectionUtilsModule","functions","source","fromEntries","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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AAU,CAAC,CAAEC,cAAe,CAAC,IAAK,OAClCC,YAAa,oHACbC,QAAS,CAAC,oBAAqB,kBAAmB,uBAClDC,SAAU,CACR,oGAMA,2FAMA,0DACA,0DACA,0DACA,8FAMA,kGAWKgB,EAAqC,CAChD7I,KAAM,aACN8I,UAAWjC,EACXkC,OChsBa,o3ODisBb5B,MEpqBsC2B,EFoqBRjC,EEnqBvBhH,OAAOmJ,YACZnJ,OAAOyF,QAAQwD,GAAWnD,IAAI,EAAEsD,EAAGC,MACjC,IAAKA,EAAE/B,KACL,MAAM,IAAIjI,MAAM,8BAA8B+J,MAChD,MAAO,CAACA,EAAGC,EAAE/B,WALb,IAAkC2B"}
@@ -1,2 +0,0 @@
1
- "use strict";function e(e){if(!e.position||!e.code)return"";const n=e.position.column-1,t=e.code.length-n-1;return`${" ".repeat(Math.max(n,0))}^${" ".repeat(Math.max(t,0))}`}class n extends Error{sourceCodeInfo;shortMessage;constructor(t,o){const c=t instanceof Error?t.message:`${t}`;super(function(n,t){if(!t)return n;const o=`${t.position.line}:${t.position.column}`;return`${n}${t.filePath?`\n${t.filePath}:${o}`:`\nLocation ${o}`}\n${t.code}\n${e(t)}`}(c,o)),this.shortMessage=c,this.sourceCodeInfo=o,Object.setPrototypeOf(this,n.prototype),this.name="DvalaError"}getCodeMarker(){return this.sourceCodeInfo&&e(this.sourceCodeInfo)}}const t={Number:1,String:2,NormalExpression:3,SpecialExpression:4,UserDefinedSymbol:5,NormalBuiltinSymbol:6,SpecialBuiltinSymbol:7,ReservedSymbol:8,Binding:9,Spread:10},o=new Set(Object.values(t));const c=new Set(["UserDefined","Partial","Comp","Constantly","Juxt","Complement","EveryPred","SomePred","Fnull","EffectMatcher","Builtin","SpecialBuiltin","Module"]);const l="^^fn^^",i="^^re^^",r="^^ef^^";function a(e){return null!==e&&"object"==typeof e&&(l in e&&"functionType"in e&&("string"==typeof(n=e.functionType)&&c.has(n)));var n}function u(e){return!(!Array.isArray(e)||e.length<2)&&("number"==typeof(n=e[0])&&o.has(n));var n}function s(e){return a(e)?`<function ${e.name||"λ"}>`:u(e)?`${n=e[0],Object.keys(t).find(e=>t[e]===n)}-node`:null===e?"null":"object"==typeof e&&e instanceof RegExp?`${e}`:"object"==typeof e&&e instanceof Error?e.toString():JSON.stringify(e);var n}function d(e,n){return e?.sourceCodeInfo??n}function p(e,t,o){return new n(`Expected ${e}, got ${s(t)}.`,d(t,o))}function f(e){return!(null===e||"object"!=typeof e||Array.isArray(e)||e instanceof RegExp||function(e){return null!==e&&"object"==typeof e&&!!e[l]}(e)||(n=e,null!==n&&"object"==typeof n&&n[i])||function(e){return null!==e&&"object"==typeof e&&!!e[r]}(e));var n}function m(e){return function(e){return Array.isArray(e)||"string"==typeof e}(e)||f(e)}function h(e,n){return y(e,n),e}function y(e,n){if(!m(e))throw p("string, array or object",e,n)}function g(e,n={}){return"number"==typeof e&&(!Number.isNaN(e)&&(!(n.integer&&!Number.isInteger(e))&&(!(n.finite&&!Number.isFinite(e))&&((!n.zero||0===e)&&((!n.nonZero||0!==e)&&(!(n.positive&&e<=0)&&(!(n.negative&&e>=0)&&(!(n.nonPositive&&e>0)&&(!(n.nonNegative&&e<0)&&(!("number"==typeof n.gt&&e<=n.gt)&&(!("number"==typeof n.gte&&e<n.gte)&&(!("number"==typeof n.lt&&e>=n.lt)&&!("number"==typeof n.lte&&e>n.lte)))))))))))))}function v(e,t,o={}){if(!g(e,o))throw new n(`Expected ${function(e){if(e.zero)return"zero";const n=function(e){return e.positive?"positive":e.negative?"negative":e.nonNegative?"non negative":e.nonPositive?"non positive":e.nonZero?"non zero":""}(e),t=e.integer?"integer":"number",o=e.finite?"finite":"",c=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[n,o,t,c].filter(e=>!!e).join(" ")}(o)}, got ${s(e)}.`,d(e,t))}function b(e,n,t={}){if(!function(e,n={}){return!("string"!=typeof e||n.nonEmpty&&0===e.length||n.char&&1!==e.length)}(e,t))throw p(""+(t.nonEmpty?"non empty string":t.char?"character":"string"),e,n)}function x(e,n){return k(e,n),e}function k(e,n){if(!function(e){return"string"==typeof e||"number"==typeof e}(e))throw p("string or number",e,n)}function $(e,n){return!!m(e)&&("string"==typeof e||Array.isArray(e)?!!g(n,{integer:!0})&&(n>=0&&n<e.length):!!Object.getOwnPropertyDescriptor(e,n))}function w(e){return e??null}function A(e){return f(e)?Object.entries(e).reduce((e,n)=>{const[t,o]=n;return e[t]=A(o),e},{}):Array.isArray(e)?e.map(e=>A(e)):e}function E(e){return A(e)}function j(e,n){if(!Array.isArray(e))throw p("array",e,n)}function N(e){return{min:e,max:e}}function T(e,n){if(f(e)){if("string"==typeof n&&$(e,n))return w(e[n])}else if(g(n,{nonNegative:!0,integer:!0})&&n>=0&&n<e.length)return w(e[n])}function D(e,n,t,o){if(y(e,o),Array.isArray(e)||"string"==typeof e){if(v(n,o,{integer:!0}),v(n,o,{gte:0}),v(n,o,{lte:e.length}),"string"==typeof e)return b(t,o,{char:!0}),`${e.slice(0,n)}${t}${e.slice(n+1)}`;const c=[...e];return c[n]=t,c}b(n,o);const c={...e};return c[n]=t,c}function M(e,n,t){const o=E(e);return{coll:o,innerCollMeta:n.slice(0,n.length-1).reduce((e,n)=>{const o=e.coll;let c;return Array.isArray(o)?(v(n,t),c=h(o[n],t)):(!function(e,n){if(!f(e))throw p("object",e,n)}(o,t),b(n,t),$(e.coll,n)||(o[n]={}),c=h(o[n],t)),{coll:c,parent:o}},{coll:o,parent:{}})}}const R={"get-in":{evaluate:(e,n)=>{let t=w(e[0]);const o=e[1]??[],c=w(e[2]);j(o,n);for(const e of o){if(k(e,n),!m(t))return c;{const n=T(t,e);if(void 0===n)return c;t=n}}return t},arity:{min:2,max:3},docs:{category:"collection",returns:{type:"any"},args:{a:{type:"collection"},b:{type:"array"},"not-found":{type:"any"}},variants:[{argumentNames:["a","b"]},{argumentNames:["a","b","not-found"]}],description:"Returns the value in a nested collection, where $b is an array of keys. Returns $not-found if the key is not present. If $not-found is not set, `null` is returned.",seeAlso:["get","collection.assoc-in","collection.update-in"],examples:['\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: "Kalle" }, 6]],\n [1, 1, "a", 0]\n)','\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: "Kalle" }, 6]],\n [1, 1, "b", 0]\n)','\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: "Kalle" }, 6]],\n [1, 1, "b", 0],\n "Lisa"\n)']}},"assoc-in":{evaluate:([e,n,t],o)=>{if(y(e,o),j(n,o),function(e,n){if(!function(e){return void 0!==e}(e))throw p("not undefined",e,n)}(t,o),1===n.length)return k(n[0],o),D(e,n[0],t,o);const{coll:c,innerCollMeta:l}=M(e,n,o),i=x(n[n.length-1],o),r=x(n[n.length-2],o);return Array.isArray(l.parent)?(v(r,o),l.parent[r]=D(l.coll,i,t,o)):(b(r,o),l.parent[r]=D(l.coll,i,t,o)),c},arity:N(3),docs:{category:"collection",returns:{type:"collection"},args:{coll:{type:"collection"},ks:{type:["number","string"],array:!0},value:{type:"any"}},variants:[{argumentNames:["coll","ks","value"]}],description:"\nAssociates a value in the nested collection $coll, where $ks is an array of keys and $value is the new value.\n\nIf any levels do not exist, objects will be created - and the corresponding keys must be of type string.",seeAlso:["assoc","collection.get-in","collection.update-in"],examples:['\nlet cu = import(collection);\ncu.assoc-in(\n {},\n ["a", "b", "c"],\n "Albert"\n)','\nlet cu = import(collection);\ncu.assoc-in(\n [1, 2, [1, 2, 3]],\n [2, 1],\n "Albert"\n)','\nlet cu = import(collection);\ncu.assoc-in(\n [1, 2, { name: "albert" }],\n [2, "name", 0],\n "A"\n)']}},update:{evaluate:()=>{throw new Error("update: Dvala implementation should be used instead")},arity:{min:3},docs:{category:"collection",returns:{type:"collection"},args:{coll:{type:"collection"},key:{type:["string","number"]},fun:{type:"function"},"fun-args":{type:"any",rest:!0}},variants:[{argumentNames:["coll","key","fun"]},{argumentNames:["coll","key","fun","fun-args"]}],description:"\nUpdates a value in the $coll collection, where $key is a key. $fun is a function\nthat will take the old value and any supplied $fun-args and\nreturn the new value.\nIf the key does not exist, `null` is passed as the old value.",seeAlso:["collection.update-in","assoc"],examples:['\nlet cu = import(collection);\nlet x = { a: 1, b: 2 };\ncu.update(x, "a", inc)','\nlet cu = import(collection);\nlet x = { a: 1, b: 2 };\ncu.update(\n x,\n "c",\n val -> null?(val) ? 0 : inc(val)\n)']}},"update-in":{evaluate:()=>{throw new Error("update-in: Dvala implementation should be used instead")},arity:{min:3},docs:{category:"collection",returns:{type:"collection"},args:{coll:{type:"collection"},ks:{type:"array"},fun:{type:"function"},"fun-args":{type:"any",rest:!0}},variants:[{argumentNames:["coll","ks","fun"]},{argumentNames:["coll","ks","fun","fun-args"]}],description:"Updates a value in the $coll collection, where $ks is an array of\nkeys and $fun is a function that will take the old value and\nany supplied $fun-args and return the new value. If any levels do not exist,\nobjects will be created - and the corresponding keys must be of type string.",seeAlso:["collection.update","collection.assoc-in","collection.get-in"],examples:['\nlet cu = import(collection);\ncu.update-in(\n { a: [1, 2, 3] },\n ["a", 1],\n -> null?($) ? 0 : inc($)\n)','\nlet cu = import(collection);\ncu.update-in(\n { a: { foo: "bar"} },\n ["a", "foo"],\n -> null?($) ? "?" : "!"\n)','\nlet cu = import(collection);\ncu.update-in(\n { a: { foo: "bar"} },\n ["a", "baz"],\n -> null?($) ? "?" : "!"\n)','\nlet cu = import(collection);\ncu.update-in(\n { a: [1, 2, 3] },\n ["a", 1],\n *,\n 10,\n 10,\n 10,\n)']}},filteri:{evaluate:()=>{throw new Error("filteri: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"collection"},args:{a:{type:"collection"},b:{type:"function",description:"The function to call for each element in the collection. The function should take two arguments: the element itself and the index."}},variants:[{argumentNames:["a","b"]}],description:"Creates a new collection with all elements that pass the test implemented by $b. The function is called for each element in the collection, and it should take two arguments: the element itself and the index.",seeAlso:["filter","collection.mapi"],examples:["let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> i % 2 == 0)","let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> x % 2 == 0)","let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> x + i > 3)"]}},mapi:{evaluate:()=>{throw new Error("mapi: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"collection"},args:{a:{type:"collection"},b:{type:"function",description:"The function to call for each element in the collection. The function should take two arguments: the element itself and the index."}},variants:[{argumentNames:["a","b"]}],description:"Creates a new collection populated with the results of calling $b on every element in $a. The function is called for each element in the collection, and it should take two arguments: the element itself and the index.",seeAlso:["map","collection.filteri"],examples:["let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x + i)","let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x * i)","let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x - i)","let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x / i)","let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x % inc(i))"]}},reducei:{evaluate:()=>{throw new Error("reducei: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any"},args:{coll:{type:"collection"},fun:{type:"function",description:"The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index."},initial:{type:"any",description:"The initial value to use as the accumulator."}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Runs $fun function on each element of the $coll, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.",seeAlso:["reduce","collection.reducei-right","collection.reductionsi"],examples:["let cu = import(collection); cu.reducei([1, 2, 3], (acc, x, i) -> acc + x + i, 0)",'let cu = import(collection); cu.reducei("Albert", (acc, x, i) -> acc ++ x ++ i, "")','let cu = import(collection); cu.reducei({ a: 1, b: 2 }, -> $1 ++ $3, "")']}},"reduce-right":{evaluate:()=>{throw new Error("reduce-right: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any"},args:{fun:{type:"function"},coll:{type:"collection"},initial:{type:"any"}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Runs $fun function on each element of the $coll (starting from the last item), passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value.",seeAlso:["reduce","collection.reducei-right"],examples:['let cu = import(collection); cu.reduce-right(["A", "B", "C"], str, "")',"let cu = import(collection); cu.reduce-right({ a: 1, b: 2 }, +, 0)"]}},"reducei-right":{evaluate:()=>{throw new Error("reducei-right: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any"},args:{coll:{type:"collection"},fun:{type:"function",description:"The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index."},initial:{type:"any",description:"The initial value to use as the accumulator."}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Runs $fun function on each element of the $coll (starting from the last item), passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.",seeAlso:["collection.reducei","collection.reduce-right"],examples:["let cu = import(collection); cu.reducei-right([1, 2, 3], (acc, x, i) -> acc + x + i, 0)",'let cu = import(collection); cu.reducei-right("Albert", (acc, x, i) -> acc ++ x ++ i, "")','let cu = import(collection); cu.reducei-right({ a: 1, b: 2 }, -> $1 ++ $3, "")']}},reductions:{evaluate:()=>{throw new Error("reductions: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any",array:!0},args:{fun:{type:"function"},coll:{type:"collection"},initial:{type:"any"}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Returns an array of the intermediate values of the reduction (see `reduce`) of $coll by $fun.",seeAlso:["reduce","collection.reductionsi"],examples:["let cu = import(collection); cu.reductions([1, 2, 3], +, 0)","let cu = import(collection); cu.reductions([1, 2, 3], +, 10)","let cu = import(collection); cu.reductions([], +, 0)","let cu = import(collection); cu.reductions({ a: 1, b: 2 }, +, 0)","\nlet cu = import(collection);\ncu.reductions(\n [1, 2, 3, 4, 5, 6, 7, 8, 9],\n (result, value) -> result + (even?(value) ? value : 0),\n 0\n)"]}},reductionsi:{evaluate:()=>{throw new Error("reductionsi: Dvala implementation should be used instead")},arity:N(3),docs:{category:"collection",returns:{type:"any",array:!0},args:{coll:{type:"collection"},fun:{type:"function",description:"The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index."},initial:{type:"any",description:"The initial value to use as the accumulator."}},variants:[{argumentNames:["coll","fun","initial"]}],description:"Returns an array of the intermediate values of the reduction (see `reduce`) of $coll by $fun. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.",seeAlso:["collection.reductions","collection.reducei"],examples:["let cu = import(collection); cu.reductionsi([1, 2, 3], (acc, x, i) -> acc + x + i, 0)",'let cu = import(collection); cu.reductionsi("Albert", (acc, x, i) -> acc ++ x ++ i, "")','let cu = import(collection); cu.reductionsi({ a: 1, b: 2 }, -> $1 ++ $3, "")']}},"not-empty":{evaluate:([e],n)=>null===e?null:(y(e,n),"string"==typeof e||Array.isArray(e)?e.length>0?e:null:Object.keys(e).length>0?e:null),arity:N(1),docs:{category:"collection",returns:{type:"any"},args:{coll:{type:["collection","null"]}},variants:[{argumentNames:["coll"]}],description:"Returns `null` if $coll is empty or `null`, otherwise $coll.",seeAlso:["empty?","not-empty?"],examples:["let cu = import(collection); cu.not-empty([])","let cu = import(collection); cu.not-empty([1, 2, 3])","let cu = import(collection); cu.not-empty({})","let cu = import(collection); cu.not-empty({ a: 2 })",'let cu = import(collection); cu.not-empty("")','let cu = import(collection); cu.not-empty("Albert")',"let cu = import(collection); cu.not-empty(null)"]}},"every?":{evaluate:()=>{throw new Error("every?: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"boolean"},args:{a:{type:"collection"},b:{type:"function"}},variants:[{argumentNames:["a","b"]}],description:"Returns `true` if all entries in $a pass the test implemented by $b, otherwise returns `false`.",seeAlso:["collection.any?","collection.not-every?","collection.not-any?","functional.every-pred","grid.cell-every?"],examples:["let cu = import(collection); cu.every?([1, 2, 3], number?)","let cu = import(collection); cu.every?([1, 2, 3], even?)",'\nlet cu = import(collection);\ncu.every?(\n ["Albert", "Mojir", 160, [1, 2]],\n string?,\n)',"\nlet cu = import(collection);\ncu.every?(\n [50, 100, 150, 200],\n -> $ > 10,\n)","let cu = import(collection); cu.every?([], number?)",'let cu = import(collection); cu.every?("", number?)',"let cu = import(collection); cu.every?({}, number?)","\nlet cu = import(collection);\ncu.every?(\n { a: 2, b: 4},\n -> even?(second($))\n)","\nlet cu = import(collection);\ncu.every?(\n { a: 2, b: 3 },\n -> even?(second($))\n)"]}},"any?":{evaluate:()=>{throw new Error("any?: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"boolean"},args:{a:{type:"collection"},b:{type:"function"}},variants:[{argumentNames:["a","b"]}],description:"Returns `true` if any element in $a pass the test implemented by $b, otherwise returns `false`.",seeAlso:["collection.every?","collection.not-any?","collection.not-every?","functional.some-pred","some","grid.some?"],examples:['\nlet cu = import(collection);\ncu.any?(\n ["Albert", "Mojir", 160, [1, 2]],\n string?\n)',"\nlet cu = import(collection);\ncu.any?(\n [50, 100, 150, 200],\n x -> x > 10\n)","let cu = import(collection); cu.any?([], number?)",'let cu = import(collection); cu.any?("", number?)',"let cu = import(collection); cu.any?({}, number?)","\nlet cu = import(collection);\ncu.any?(\n { a: 2, b: 3 },\n -> even?(second($))\n)","\nlet cu = import(collection);\ncu.any?(\n { a: 1, b: 3 },\n -> even?(second($))\n)"]}},"not-any?":{evaluate:()=>{throw new Error("not-any?: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"boolean"},args:{a:{type:"collection"},b:{type:"function"}},variants:[{argumentNames:["a","b"]}],description:"Returns `false` if any element in $a pass the test implemented by $b, otherwise returns `true`.",seeAlso:["collection.any?","collection.every?","collection.not-every?"],examples:['\nlet cu = import(collection);\ncu.not-any?(\n ["Albert", "Mojir", 160, [1, 2]],\n string?\n)',"\nlet cu = import(collection);\ncu.not-any?(\n [50, 100, 150, 200],\n x -> x > 10\n)","let cu = import(collection); cu.not-any?([], number?)",'let cu = import(collection); cu.not-any?("", number?)',"let cu = import(collection); cu.not-any?({}, number?)","\nlet cu = import(collection);\ncu.not-any?(\n { a: 2, b: 3 },\n -> even?(second($))\n)","\nlet cu = import(collection);\ncu.not-any?(\n { a: 1, b: 3 },\n -> even?(second($))\n)"]}},"not-every?":{evaluate:()=>{throw new Error("not-every?: Dvala implementation should be used instead")},arity:N(2),docs:{category:"collection",returns:{type:"boolean"},args:{a:{type:"collection"},b:{type:"function"}},variants:[{argumentNames:["a","b"]}],description:"Returns `true` if at least one element in $a does not pass the test implemented by $b, otherwise returns `false`.",seeAlso:["collection.every?","collection.any?","collection.not-any?"],examples:['\nlet cu = import(collection);\ncu.not-every?(\n ["Albert", "Mojir", 160, [1, 2]],\n string?\n)',"\nlet cu = import(collection);\ncu.not-every?(\n [50, 100, 150, 200],\n x -> x > 10\n)","let cu = import(collection); cu.not-every?([], number?)",'let cu = import(collection); cu.not-every?("", number?)',"let cu = import(collection); cu.not-every?({}, number?)","\nlet cu = import(collection);\ncu.not-every?(\n { a: 2, b: 4 },\n -> even?(second($))\n)","\nlet cu = import(collection);\ncu.not-every?(\n { a: 2, b: 3 },\n -> even?(second($))\n)"]}}},C={name:"collection",functions:R,source:'{\n update: (coll, key, fn, ...extra-params) ->\n assoc(coll, key, apply(fn, [get(coll, key), ...extra-params])),\n\n update-in: (coll, ks, fn, ...extra-params) -> do\n let k = first(ks);\n if count(ks) == 1 then\n assoc(coll, k, apply(fn, [get(coll, k), ...extra-params]))\n else\n let inner = get(coll, k);\n let inner-coll = null?(inner) ? {} : inner;\n assoc(coll, k, apply(self, [inner-coll, slice(ks, 1), fn, ...extra-params]))\n end\n end,\n\n filteri: (coll, fn) -> do\n cond\n case array?(coll) then\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> if fn(first(pair), second(pair)) then [...acc, first(pair)] else acc end,\n []\n )\n\n case string?(coll) then\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> if fn(first(pair), second(pair)) then ++(acc, first(pair)) else acc end,\n ""\n )\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) ->\n if fn(coll(k), k) then assoc(acc, k, coll(k)) else acc end,\n {}\n )\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n mapi: (coll, fn) -> do\n cond\n case array?(coll) then\n for (i in range(count(coll))) -> fn(nth(coll, i), i)\n\n case string?(coll) then\n reduce(\n for (i in range(count(coll))) -> fn(nth(coll, i), i),\n (acc, ch) -> ++(acc, ch),\n ""\n )\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) ->\n assoc(acc, k, fn(coll(k), k)),\n {}\n )\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n reducei: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n loop (acc = initial, i = 0) -> do\n if i >= count(coll) then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i + 1)\n end\n end\n\n case array?(coll) then\n loop (acc = initial, i = 0) -> do\n if i >= count(coll) then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i + 1)\n end\n end\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) -> fn(acc, coll(k), k), initial)\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n reduce-right: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n reduce(reverse(coll), fn, initial)\n\n case array?(coll) then\n reduce(reverse(coll), fn, initial)\n\n case object?(coll) then\n reduce(reverse(keys(coll)), (acc, k) -> fn(acc, coll(k)), initial)\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n reducei-right: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n let len = count(coll);\n loop (acc = initial, i = len - 1) -> do\n if i < 0 then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i - 1)\n end\n end\n\n case array?(coll) then\n let len = count(coll);\n loop (acc = initial, i = len - 1) -> do\n if i < 0 then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i - 1)\n end\n end\n\n case object?(coll) then\n reduce(reverse(keys(coll)), (acc, k) -> fn(acc, coll(k), k), initial)\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n reductions: (coll, fn, initial) -> do\n let items = cond\n case string?(coll) then\n if count(coll) == 0 then [] else for (i in range(count(coll))) -> nth(coll, i) end\n\n case array?(coll) then coll\n\n case object?(coll) then\n for (k in keys(coll)) -> coll(k)\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end;\n if count(items) == 0 then\n [initial]\n else\n reduce(items, (acc, elem) -> do\n let prev = last(acc);\n [...acc, fn(prev, elem)]\n end, [initial])\n end\n end,\n\n reductionsi: (coll, fn, initial) -> do\n cond\n case string?(coll) then do\n if count(coll) == 0 then\n [initial]\n else\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> do\n let prev = last(acc);\n [...acc, fn(prev, first(pair), second(pair))]\n end,\n [initial]\n )\n end\n end\n\n case array?(coll) then do\n if count(coll) == 0 then\n [initial]\n else\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> do\n let prev = last(acc);\n [...acc, fn(prev, first(pair), second(pair))]\n end,\n [initial]\n )\n end\n end\n\n case object?(coll) then do\n let ks = keys(coll);\n if count(ks) == 0 then\n [initial]\n else\n reduce(ks, (acc, k) -> do\n let prev = last(acc);\n [...acc, fn(prev, coll(k), k)]\n end, [initial])\n end\n end\n\n case true then\n perform(effect(dvala.error), "Expected collection")\n end\n end,\n\n "every?": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), "Expected collection")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then true\n case not(fn(nth(items, i))) then false\n case true then recur(i + 1)\n end\n end,\n\n "any?": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), "Expected collection")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then false\n case fn(nth(items, i)) then true\n case true then recur(i + 1)\n end\n end,\n\n "not-any?": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), "Expected collection")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then true\n case fn(nth(items, i)) then false\n case true then recur(i + 1)\n end\n end,\n\n "not-every?": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), "Expected collection")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then false\n case not(fn(nth(items, i))) then true\n case true then recur(i + 1)\n end\n end\n}',docs:(S=R,Object.fromEntries(Object.entries(S).map(([e,n])=>{if(!n.docs)throw new Error(`Missing docs for function "${e}"`);return[e,n.docs]})))};var S;exports.collectionUtilsModule=C;
2
- //# sourceMappingURL=collection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collection.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/symbols.ts","../../src/utils/debug/debugTools.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/utils/getAssertionError.ts","../../src/typeGuards/dvala.ts","../../src/typeGuards/dvalaFunction.ts","../../src/typeGuards/number.ts","../../src/typeGuards/string.ts","../../src/utils/index.ts","../../src/typeGuards/array.ts","../../src/utils/arity.ts","../../src/builtin/modules/collection/index.ts","../../src/builtin/modules/collection/collection.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 { 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 { 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 { 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 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 { 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'\nimport { getAssertionError } from '../utils/getAssertionError'\n\ntype StringAssertionOptions =\n | {\n nonEmpty?: true\n char?: never\n }\n | {\n nonEmpty?: never\n char?: true\n }\n\nexport function isString(value: unknown, options: StringAssertionOptions = {}): value is string {\n if (typeof value !== 'string')\n return false\n\n if (options.nonEmpty && value.length === 0)\n return false\n\n if (options.char && value.length !== 1)\n return false\n\n return true\n}\n\nexport function assertString(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: StringAssertionOptions = {},\n): asserts value is string {\n if (!isString(value, options)) {\n throw getAssertionError(\n `${options.nonEmpty ? 'non empty string' : options.char ? 'character' : 'string'}`,\n value,\n sourceCodeInfo,\n )\n }\n}\n\nexport function asString(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: StringAssertionOptions = {},\n): string {\n assertString(value, sourceCodeInfo, options)\n return value\n}\n\nexport function isStringOrNumber(value: unknown): value is string | number {\n return typeof value === 'string' || typeof value === 'number'\n}\nexport function asStringOrNumber(value: unknown, sourceCodeInfo?: SourceCodeInfo): string | number {\n assertStringOrNumber(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | number {\n if (!isStringOrNumber(value))\n throw getAssertionError('string or number', value, sourceCodeInfo)\n}\n","import type { Any, Coll, Obj } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { asAny, isColl, isObj, isRegularExpression } from '../typeGuards/dvala'\nimport { isNumber } from '../typeGuards/number'\nimport { asString, assertStringOrNumber } from '../typeGuards/string'\nimport { isUnknownRecord } from '../typeGuards'\nimport { DvalaError } from '../errors'\n\nexport function collHasKey(coll: unknown, key: string | number): boolean {\n if (!isColl(coll))\n return false\n\n if (typeof coll === 'string' || Array.isArray(coll)) {\n if (!isNumber(key, { integer: true }))\n return false\n\n return key >= 0 && key < coll.length\n }\n return !!Object.getOwnPropertyDescriptor(coll, key)\n}\n\nexport function compare<T extends string | number>(a: T, b: T, sourceCodeInfo: SourceCodeInfo | undefined): number {\n assertStringOrNumber(a, sourceCodeInfo)\n assertStringOrNumber(b, sourceCodeInfo)\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a < b ? -1 : a > b ? 1 : 0\n }\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.sign((a) - (b))\n }\n throw new DvalaError(`Cannot compare values of different types: ${typeof a} and ${typeof b}`, sourceCodeInfo)\n}\n\nexport function deepEqual(a: unknown, b: unknown, sourceCodeInfo?: SourceCodeInfo): boolean {\n if (a === b)\n return true\n\n if (typeof a === 'number' && typeof b === 'number')\n return approxEqual(a, b)\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false\n\n for (let i = 0; i < a.length; i += 1) {\n if (!deepEqual(asAny(a[i], sourceCodeInfo), asAny(b[i], sourceCodeInfo), sourceCodeInfo))\n return false\n }\n return true\n }\n if (isRegularExpression(a) && isRegularExpression(b))\n return a.s === b.s && a.f === b.f\n\n if (isUnknownRecord(a) && isUnknownRecord(b)) {\n const aKeys = Object.keys(a)\n const bKeys = Object.keys(b)\n if (aKeys.length !== bKeys.length)\n return false\n\n for (let i = 0; i < aKeys.length; i += 1) {\n const key = asString(aKeys[i], sourceCodeInfo)\n if (!deepEqual(a[key], b[key], sourceCodeInfo))\n return false\n }\n return true\n }\n return false\n}\n\nexport function toNonNegativeInteger(num: number): number {\n return Math.max(0, Math.ceil(num))\n}\n\nexport function toAny(value: unknown): Any {\n return (value ?? null) as Any\n}\n\nfunction clone<T>(value: T): T {\n if (isObj(value)) {\n return Object.entries(value).reduce((result: Obj, entry) => {\n const [key, val] = entry\n result[key] = clone(val)\n return result\n }, {}) as T\n }\n if (Array.isArray(value))\n // eslint-disable-next-line ts/no-unsafe-return\n return value.map(item => clone(item)) as unknown as T\n\n return value\n}\n\nexport function cloneColl<T extends Coll>(value: T): T {\n return clone(value)\n}\n\nexport function joinSets<T>(...results: Set<T>[]): Set<T> {\n const result = new Set<T>()\n for (const symbols of results)\n symbols.forEach(symbol => result.add(symbol))\n\n return result\n}\n\nexport function addToSet<T>(target: Set<T>, source: Set<T>): void {\n source.forEach(symbol => target.add(symbol))\n}\n\nexport const EPSILON = 1e-10\n\nexport function approxEqual(a: number, b: number, epsilon: number = EPSILON): boolean {\n if (a === b) {\n return true\n }\n\n const diff = Math.abs(a - b)\n\n if (a === 0 || b === 0 || diff < epsilon) {\n // Use absolute error for values near zero\n return diff < epsilon\n }\n const absA = Math.abs(a)\n const absB = Math.abs(b)\n\n // Use relative error for larger values\n return diff / (absA + absB) < epsilon\n}\n\nexport function approxZero(value: number): boolean {\n return Math.abs(value) < EPSILON\n}\n\nexport function smartTrim(str: string, minIndent = 0): string {\n const lines = str.split('\\n')\n while (lines[0]?.match(/^\\s*$/)) {\n lines.shift() // Remove leading empty lines\n }\n while (lines[lines.length - 1]?.match(/^\\s*$/)) {\n lines.pop() // Remove trailing empty lines\n }\n const indent = lines.reduce((acc, line) => {\n if (line.match(/^\\s*$/))\n return acc // Skip empty lines\n const lineIndent = line.match(/^\\s*/)![0].length\n return Math.min(acc, lineIndent)\n }, Infinity)\n return lines.map(line => ' '.repeat(minIndent) + line.slice(indent)).join('\\n').trimEnd()\n}\n","import type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\n\n// isArray not needed, use Array.isArary\nexport function asArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): unknown[] {\n assertArray(value, sourceCodeInfo)\n return value\n}\nexport function assertArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is unknown[] {\n if (!Array.isArray(value))\n throw getAssertionError('array', value, sourceCodeInfo)\n}\n\nexport function isStringArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every(v => typeof v === 'string')\n}\nexport function asStringArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): string[] {\n assertStringArray(value, sourceCodeInfo)\n return value\n}\nexport function assertStringArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is string[] {\n if (!isStringArray(value))\n throw getAssertionError('array of strings', value, sourceCodeInfo)\n}\n\nexport function isCharArray(value: unknown): value is string[] {\n return Array.isArray(value) && value.every(v => typeof v === 'string' && v.length === 1)\n}\nexport function asCharArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): string[] {\n assertCharArray(value, sourceCodeInfo)\n return value\n}\nexport function assertCharArray(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is string[] {\n if (!isCharArray(value))\n throw getAssertionError('array of strings', value, 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 { Any, Arr, Coll, Obj } from '../../../interface'\nimport type { SourceCodeInfo } from '../../../tokenizer/token'\nimport { cloneColl, collHasKey, toAny } from '../../../utils'\nimport { asColl, assertAny, assertColl, assertObj, isColl, isObj } from '../../../typeGuards/dvala'\nimport type { BuiltinNormalExpressions } from '../../interface'\nimport { assertArray } from '../../../typeGuards/array'\nimport { assertNumber, isNumber } from '../../../typeGuards/number'\nimport { asStringOrNumber, assertString, assertStringOrNumber } from '../../../typeGuards/string'\nimport { toFixedArity } from '../../../utils/arity'\nimport { moduleDocsFromFunctions } from '../interface'\nimport type { DvalaModule } from '../interface'\nimport collectionModuleSource from './collection.dvala'\n\n// --- Private helper: get value from collection by key ---\nfunction get(coll: Coll, key: string | number): Any | undefined {\n if (isObj(coll)) {\n if (typeof key === 'string' && collHasKey(coll, key))\n return toAny(coll[key])\n }\n else {\n if (isNumber(key, { nonNegative: true, integer: true }) && key >= 0 && key < coll.length)\n return toAny(coll[key])\n }\n return undefined\n}\n\n// --- Private helper: assoc value into collection ---\nfunction assoc(coll: Coll, key: string | number, value: Any, sourceCodeInfo?: SourceCodeInfo) {\n assertColl(coll, sourceCodeInfo)\n if (Array.isArray(coll) || typeof coll === 'string') {\n assertNumber(key, sourceCodeInfo, { integer: true })\n assertNumber(key, sourceCodeInfo, { gte: 0 })\n assertNumber(key, sourceCodeInfo, { lte: coll.length })\n if (typeof coll === 'string') {\n assertString(value, sourceCodeInfo, { char: true })\n return `${coll.slice(0, key)}${value}${coll.slice(key + 1)}`\n }\n const copy = [...coll]\n copy[key] = value\n return copy\n }\n assertString(key, sourceCodeInfo)\n const copy = { ...coll }\n copy[key] = value\n return copy\n}\n\ninterface CollMeta {\n coll: Coll\n parent: Obj | Arr\n}\n\n// --- Private helper: clone and get meta for nested operations ---\nfunction cloneAndGetMeta(\n originalColl: Coll,\n keys: Arr,\n sourceCodeInfo?: SourceCodeInfo,\n): { coll: Coll, innerCollMeta: CollMeta } {\n const coll = cloneColl(originalColl)\n\n const butLastKeys = keys.slice(0, keys.length - 1)\n\n const innerCollMeta = butLastKeys.reduce(\n (result: CollMeta, key) => {\n const resultColl = result.coll\n\n let newResultColl: Coll\n if (Array.isArray(resultColl)) {\n assertNumber(key, sourceCodeInfo)\n newResultColl = asColl(resultColl[key], sourceCodeInfo)\n }\n else {\n assertObj(resultColl, sourceCodeInfo)\n assertString(key, sourceCodeInfo)\n if (!collHasKey(result.coll, key))\n (resultColl)[key] = {}\n\n newResultColl = asColl(resultColl[key], sourceCodeInfo)\n }\n\n return { coll: newResultColl, parent: resultColl }\n },\n { coll, parent: {} },\n )\n return { coll, innerCollMeta }\n}\n\nconst collectionUtilsFunctions: BuiltinNormalExpressions = {\n 'get-in': {\n evaluate: (params, sourceCodeInfo): Any => {\n let coll = toAny(params[0])\n const keys = params[1] ?? [] // null behaves as empty array\n const defaultValue = toAny(params[2])\n assertArray(keys, sourceCodeInfo)\n for (const key of keys) {\n assertStringOrNumber(key, sourceCodeInfo)\n if (isColl(coll)) {\n const nextValue = get(coll, key)\n if (nextValue !== undefined)\n coll = nextValue\n else\n return defaultValue\n }\n else {\n return defaultValue\n }\n }\n return coll\n },\n arity: { min: 2, max: 3 },\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n 'a': { type: 'collection' },\n 'b': { type: 'array' },\n 'not-found': { type: 'any' },\n },\n variants: [\n { argumentNames: ['a', 'b'] },\n { argumentNames: ['a', 'b', 'not-found'] },\n ],\n description: 'Returns the value in a nested collection, where $b is an array of keys. Returns $not-found if the key is not present. If $not-found is not set, `null` is returned.',\n seeAlso: ['get', 'collection.assoc-in', 'collection.update-in'],\n examples: [\n `\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: \"Kalle\" }, 6]],\n [1, 1, \"a\", 0]\n)`,\n `\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: \"Kalle\" }, 6]],\n [1, 1, \"b\", 0]\n)`,\n `\nlet cu = import(collection);\ncu.get-in(\n [[1, 2, 3], [4, { a: \"Kalle\" }, 6]],\n [1, 1, \"b\", 0],\n \"Lisa\"\n)`,\n ],\n },\n },\n 'assoc-in': {\n evaluate: ([originalColl, keys, value], sourceCodeInfo): Coll => {\n assertColl(originalColl, sourceCodeInfo)\n assertArray(keys, sourceCodeInfo)\n assertAny(value, sourceCodeInfo)\n\n if (keys.length === 1) {\n assertStringOrNumber(keys[0], sourceCodeInfo)\n return assoc(originalColl, keys[0], value, sourceCodeInfo)\n }\n\n const { coll, innerCollMeta } = cloneAndGetMeta(originalColl, keys, sourceCodeInfo)\n\n const lastKey = asStringOrNumber(keys[keys.length - 1], sourceCodeInfo)\n const parentKey = asStringOrNumber(keys[keys.length - 2], sourceCodeInfo)\n\n if (Array.isArray(innerCollMeta.parent)) {\n assertNumber(parentKey, sourceCodeInfo)\n innerCollMeta.parent[parentKey] = assoc(innerCollMeta.coll, lastKey, value, sourceCodeInfo)\n }\n else {\n assertString(parentKey, sourceCodeInfo)\n innerCollMeta.parent[parentKey] = assoc(innerCollMeta.coll, lastKey, value, sourceCodeInfo)\n }\n\n return coll\n },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n coll: { type: 'collection' },\n ks: { type: ['number', 'string'], array: true },\n value: { type: 'any' },\n },\n variants: [{ argumentNames: ['coll', 'ks', 'value'] }],\n description: `\nAssociates a value in the nested collection $coll, where $ks is an array of keys and $value is the new value.\n\nIf any levels do not exist, objects will be created - and the corresponding keys must be of type string.`,\n seeAlso: ['assoc', 'collection.get-in', 'collection.update-in'],\n examples: [\n `\nlet cu = import(collection);\ncu.assoc-in(\n {},\n [\"a\", \"b\", \"c\"],\n \"Albert\"\n)`,\n `\nlet cu = import(collection);\ncu.assoc-in(\n [1, 2, [1, 2, 3]],\n [2, 1],\n \"Albert\"\n)`,\n `\nlet cu = import(collection);\ncu.assoc-in(\n [1, 2, { name: \"albert\" }],\n [2, \"name\", 0],\n \"A\"\n)`,\n ],\n },\n },\n 'update': {\n evaluate: () => { throw new Error('update: Dvala implementation should be used instead') },\n arity: { min: 3 },\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n 'coll': { type: 'collection' },\n 'key': { type: ['string', 'number'] },\n 'fun': { type: 'function' },\n 'fun-args': { type: 'any', rest: true },\n },\n variants: [\n { argumentNames: ['coll', 'key', 'fun'] },\n { argumentNames: ['coll', 'key', 'fun', 'fun-args'] },\n ],\n description: `\nUpdates a value in the $coll collection, where $key is a key. $fun is a function\nthat will take the old value and any supplied $fun-args and\nreturn the new value.\nIf the key does not exist, \\`null\\` is passed as the old value.`,\n seeAlso: ['collection.update-in', 'assoc'],\n examples: [\n `\nlet cu = import(collection);\nlet x = { a: 1, b: 2 };\ncu.update(x, \"a\", inc)`,\n `\nlet cu = import(collection);\nlet x = { a: 1, b: 2 };\ncu.update(\n x,\n \"c\",\n val -> null?(val) ? 0 : inc(val)\n)`,\n ],\n },\n },\n 'update-in': {\n evaluate: () => { throw new Error('update-in: Dvala implementation should be used instead') },\n arity: { min: 3 },\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n 'coll': { type: 'collection' },\n 'ks': { type: 'array' },\n 'fun': { type: 'function' },\n 'fun-args': { type: 'any', rest: true },\n },\n variants: [\n { argumentNames: ['coll', 'ks', 'fun'] },\n { argumentNames: ['coll', 'ks', 'fun', 'fun-args'] },\n ],\n description: `Updates a value in the $coll collection, where $ks is an array of\nkeys and $fun is a function that will take the old value and\nany supplied $fun-args and return the new value. If any levels do not exist,\nobjects will be created - and the corresponding keys must be of type string.`,\n seeAlso: ['collection.update', 'collection.assoc-in', 'collection.get-in'],\n examples: [\n `\nlet cu = import(collection);\ncu.update-in(\n { a: [1, 2, 3] },\n [\"a\", 1],\n -> null?($) ? 0 : inc($)\n)`,\n `\nlet cu = import(collection);\ncu.update-in(\n { a: { foo: \"bar\"} },\n [\"a\", \"foo\"],\n -> null?($) ? \"?\" : \"!\"\n)`,\n `\nlet cu = import(collection);\ncu.update-in(\n { a: { foo: \"bar\"} },\n [\"a\", \"baz\"],\n -> null?($) ? \"?\" : \"!\"\n)`,\n `\nlet cu = import(collection);\ncu.update-in(\n { a: [1, 2, 3] },\n [\"a\", 1],\n *,\n 10,\n 10,\n 10,\n)`,\n ],\n },\n },\n 'filteri': {\n evaluate: () => { throw new Error('filteri: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n a: { type: 'collection' },\n b: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take two arguments: the element itself and the index.',\n },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Creates a new collection with all elements that pass the test implemented by $b. The function is called for each element in the collection, and it should take two arguments: the element itself and the index.',\n seeAlso: ['filter', 'collection.mapi'],\n examples: [\n 'let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> i % 2 == 0)',\n 'let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> x % 2 == 0)',\n 'let cu = import(collection); cu.filteri([1, 2, 3], (x, i) -> x + i > 3)',\n ],\n },\n },\n 'mapi': {\n evaluate: () => { throw new Error('mapi: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'collection' },\n args: {\n a: { type: 'collection' },\n b: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take two arguments: the element itself and the index.',\n },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Creates a new collection populated with the results of calling $b on every element in $a. The function is called for each element in the collection, and it should take two arguments: the element itself and the index.',\n seeAlso: ['map', 'collection.filteri'],\n examples: [\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x + i)',\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x * i)',\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x - i)',\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x / i)',\n 'let cu = import(collection); cu.mapi([1, 2, 3], (x, i) -> x % inc(i))',\n ],\n },\n },\n 'reducei': {\n evaluate: () => { throw new Error('reducei: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n coll: { type: 'collection' },\n fun: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index.',\n },\n initial: {\n type: 'any',\n description: 'The initial value to use as the accumulator.',\n },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Runs $fun function on each element of the $coll, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.',\n seeAlso: ['reduce', 'collection.reducei-right', 'collection.reductionsi'],\n examples: [\n 'let cu = import(collection); cu.reducei([1, 2, 3], (acc, x, i) -> acc + x + i, 0)',\n 'let cu = import(collection); cu.reducei(\"Albert\", (acc, x, i) -> acc ++ x ++ i, \"\")',\n 'let cu = import(collection); cu.reducei({ a: 1, b: 2 }, -> $1 ++ $3, \"\")',\n ],\n },\n },\n 'reduce-right': {\n evaluate: () => { throw new Error('reduce-right: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n fun: { type: 'function' },\n coll: { type: 'collection' },\n initial: { type: 'any' },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Runs $fun function on each element of the $coll (starting from the last item), passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value.',\n seeAlso: ['reduce', 'collection.reducei-right'],\n examples: [\n 'let cu = import(collection); cu.reduce-right([\"A\", \"B\", \"C\"], str, \"\")',\n 'let cu = import(collection); cu.reduce-right({ a: 1, b: 2 }, +, 0)',\n ],\n },\n },\n 'reducei-right': {\n evaluate: () => { throw new Error('reducei-right: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n coll: { type: 'collection' },\n fun: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index.',\n },\n initial: {\n type: 'any',\n description: 'The initial value to use as the accumulator.',\n },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Runs $fun function on each element of the $coll (starting from the last item), passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the $coll is a single value. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.',\n seeAlso: ['collection.reducei', 'collection.reduce-right'],\n examples: [\n 'let cu = import(collection); cu.reducei-right([1, 2, 3], (acc, x, i) -> acc + x + i, 0)',\n 'let cu = import(collection); cu.reducei-right(\"Albert\", (acc, x, i) -> acc ++ x ++ i, \"\")',\n 'let cu = import(collection); cu.reducei-right({ a: 1, b: 2 }, -> $1 ++ $3, \"\")',\n ],\n },\n },\n 'reductions': {\n evaluate: () => { throw new Error('reductions: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any', array: true },\n args: {\n fun: { type: 'function' },\n coll: { type: 'collection' },\n initial: { type: 'any' },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Returns an array of the intermediate values of the reduction (see `reduce`) of $coll by $fun.',\n seeAlso: ['reduce', 'collection.reductionsi'],\n examples: [\n 'let cu = import(collection); cu.reductions([1, 2, 3], +, 0)',\n 'let cu = import(collection); cu.reductions([1, 2, 3], +, 10)',\n 'let cu = import(collection); cu.reductions([], +, 0)',\n 'let cu = import(collection); cu.reductions({ a: 1, b: 2 }, +, 0)',\n `\nlet cu = import(collection);\ncu.reductions(\n [1, 2, 3, 4, 5, 6, 7, 8, 9],\n (result, value) -> result + (even?(value) ? value : 0),\n 0\n)`,\n ],\n },\n },\n 'reductionsi': {\n evaluate: () => { throw new Error('reductionsi: Dvala implementation should be used instead') },\n arity: toFixedArity(3),\n docs: {\n category: 'collection',\n returns: { type: 'any', array: true },\n args: {\n coll: { type: 'collection' },\n fun: {\n type: 'function',\n description: 'The function to call for each element in the collection. The function should take three arguments: the accumulator, the element itself, and the index.',\n },\n initial: {\n type: 'any',\n description: 'The initial value to use as the accumulator.',\n },\n },\n variants: [{ argumentNames: ['coll', 'fun', 'initial'] }],\n description: 'Returns an array of the intermediate values of the reduction (see `reduce`) of $coll by $fun. The function is called for each element in the collection, and it should take three arguments: the accumulator, the element itself, and the index.',\n seeAlso: ['collection.reductions', 'collection.reducei'],\n examples: [\n 'let cu = import(collection); cu.reductionsi([1, 2, 3], (acc, x, i) -> acc + x + i, 0)',\n 'let cu = import(collection); cu.reductionsi(\"Albert\", (acc, x, i) -> acc ++ x ++ i, \"\")',\n 'let cu = import(collection); cu.reductionsi({ a: 1, b: 2 }, -> $1 ++ $3, \"\")',\n ],\n },\n },\n 'not-empty': {\n evaluate: ([coll], sourceCodeInfo): Coll | null => {\n if (coll === null)\n return null\n\n assertColl(coll, sourceCodeInfo)\n if (typeof coll === 'string')\n return coll.length > 0 ? coll : null\n\n if (Array.isArray(coll))\n return coll.length > 0 ? coll : null\n\n return Object.keys(coll).length > 0 ? coll : null\n },\n arity: toFixedArity(1),\n docs: {\n category: 'collection',\n returns: { type: 'any' },\n args: {\n coll: { type: ['collection', 'null'] },\n },\n variants: [{ argumentNames: ['coll'] }],\n description: 'Returns `null` if $coll is empty or `null`, otherwise $coll.',\n seeAlso: ['empty?', 'not-empty?'],\n examples: [\n 'let cu = import(collection); cu.not-empty([])',\n 'let cu = import(collection); cu.not-empty([1, 2, 3])',\n 'let cu = import(collection); cu.not-empty({})',\n 'let cu = import(collection); cu.not-empty({ a: 2 })',\n 'let cu = import(collection); cu.not-empty(\"\")',\n 'let cu = import(collection); cu.not-empty(\"Albert\")',\n 'let cu = import(collection); cu.not-empty(null)',\n ],\n },\n },\n 'every?': {\n evaluate: () => { throw new Error('every?: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'boolean' },\n args: {\n a: { type: 'collection' },\n b: { type: 'function' },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Returns `true` if all entries in $a pass the test implemented by $b, otherwise returns `false`.',\n seeAlso: ['collection.any?', 'collection.not-every?', 'collection.not-any?', 'functional.every-pred', 'grid.cell-every?'],\n examples: [\n 'let cu = import(collection); cu.every?([1, 2, 3], number?)',\n 'let cu = import(collection); cu.every?([1, 2, 3], even?)',\n `\nlet cu = import(collection);\ncu.every?(\n [\"Albert\", \"Mojir\", 160, [1, 2]],\n string?,\n)`,\n `\nlet cu = import(collection);\ncu.every?(\n [50, 100, 150, 200],\n -> $ > 10,\n)`,\n 'let cu = import(collection); cu.every?([], number?)',\n 'let cu = import(collection); cu.every?(\"\", number?)',\n 'let cu = import(collection); cu.every?({}, number?)',\n `\nlet cu = import(collection);\ncu.every?(\n { a: 2, b: 4},\n -> even?(second($))\n)`,\n `\nlet cu = import(collection);\ncu.every?(\n { a: 2, b: 3 },\n -> even?(second($))\n)`,\n ],\n },\n },\n 'any?': {\n evaluate: () => { throw new Error('any?: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'boolean' },\n args: {\n a: { type: 'collection' },\n b: { type: 'function' },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Returns `true` if any element in $a pass the test implemented by $b, otherwise returns `false`.',\n seeAlso: ['collection.every?', 'collection.not-any?', 'collection.not-every?', 'functional.some-pred', 'some', 'grid.some?'],\n examples: [\n `\nlet cu = import(collection);\ncu.any?(\n [\"Albert\", \"Mojir\", 160, [1, 2]],\n string?\n)`,\n `\nlet cu = import(collection);\ncu.any?(\n [50, 100, 150, 200],\n x -> x > 10\n)`,\n 'let cu = import(collection); cu.any?([], number?)',\n 'let cu = import(collection); cu.any?(\"\", number?)',\n 'let cu = import(collection); cu.any?({}, number?)',\n `\nlet cu = import(collection);\ncu.any?(\n { a: 2, b: 3 },\n -> even?(second($))\n)`,\n `\nlet cu = import(collection);\ncu.any?(\n { a: 1, b: 3 },\n -> even?(second($))\n)`,\n ],\n },\n },\n 'not-any?': {\n evaluate: () => { throw new Error('not-any?: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'boolean' },\n args: {\n a: { type: 'collection' },\n b: { type: 'function' },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Returns `false` if any element in $a pass the test implemented by $b, otherwise returns `true`.',\n seeAlso: ['collection.any?', 'collection.every?', 'collection.not-every?'],\n examples: [\n `\nlet cu = import(collection);\ncu.not-any?(\n [\"Albert\", \"Mojir\", 160, [1, 2]],\n string?\n)`,\n `\nlet cu = import(collection);\ncu.not-any?(\n [50, 100, 150, 200],\n x -> x > 10\n)`,\n 'let cu = import(collection); cu.not-any?([], number?)',\n 'let cu = import(collection); cu.not-any?(\"\", number?)',\n 'let cu = import(collection); cu.not-any?({}, number?)',\n `\nlet cu = import(collection);\ncu.not-any?(\n { a: 2, b: 3 },\n -> even?(second($))\n)`,\n `\nlet cu = import(collection);\ncu.not-any?(\n { a: 1, b: 3 },\n -> even?(second($))\n)`,\n ],\n },\n },\n 'not-every?': {\n evaluate: () => { throw new Error('not-every?: Dvala implementation should be used instead') },\n arity: toFixedArity(2),\n docs: {\n category: 'collection',\n returns: { type: 'boolean' },\n args: {\n a: { type: 'collection' },\n b: { type: 'function' },\n },\n variants: [{ argumentNames: ['a', 'b'] }],\n description: 'Returns `true` if at least one element in $a does not pass the test implemented by $b, otherwise returns `false`.',\n seeAlso: ['collection.every?', 'collection.any?', 'collection.not-any?'],\n examples: [\n `\nlet cu = import(collection);\ncu.not-every?(\n [\"Albert\", \"Mojir\", 160, [1, 2]],\n string?\n)`,\n `\nlet cu = import(collection);\ncu.not-every?(\n [50, 100, 150, 200],\n x -> x > 10\n)`,\n 'let cu = import(collection); cu.not-every?([], number?)',\n 'let cu = import(collection); cu.not-every?(\"\", number?)',\n 'let cu = import(collection); cu.not-every?({}, number?)',\n `\nlet cu = import(collection);\ncu.not-every?(\n { a: 2, b: 4 },\n -> even?(second($))\n)`,\n `\nlet cu = import(collection);\ncu.not-every?(\n { a: 2, b: 3 },\n -> even?(second($))\n)`,\n ],\n },\n },\n}\n\nexport const collectionUtilsModule: DvalaModule = {\n name: 'collection',\n functions: collectionUtilsFunctions,\n source: collectionModuleSource,\n docs: moduleDocsFromFunctions(collectionUtilsFunctions),\n}\n","{\n update: (coll, key, fn, ...extra-params) ->\n assoc(coll, key, apply(fn, [get(coll, key), ...extra-params])),\n\n update-in: (coll, ks, fn, ...extra-params) -> do\n let k = first(ks);\n if count(ks) == 1 then\n assoc(coll, k, apply(fn, [get(coll, k), ...extra-params]))\n else\n let inner = get(coll, k);\n let inner-coll = null?(inner) ? {} : inner;\n assoc(coll, k, apply(self, [inner-coll, slice(ks, 1), fn, ...extra-params]))\n end\n end,\n\n filteri: (coll, fn) -> do\n cond\n case array?(coll) then\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> if fn(first(pair), second(pair)) then [...acc, first(pair)] else acc end,\n []\n )\n\n case string?(coll) then\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> if fn(first(pair), second(pair)) then ++(acc, first(pair)) else acc end,\n \"\"\n )\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) ->\n if fn(coll(k), k) then assoc(acc, k, coll(k)) else acc end,\n {}\n )\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n mapi: (coll, fn) -> do\n cond\n case array?(coll) then\n for (i in range(count(coll))) -> fn(nth(coll, i), i)\n\n case string?(coll) then\n reduce(\n for (i in range(count(coll))) -> fn(nth(coll, i), i),\n (acc, ch) -> ++(acc, ch),\n \"\"\n )\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) ->\n assoc(acc, k, fn(coll(k), k)),\n {}\n )\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n reducei: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n loop (acc = initial, i = 0) -> do\n if i >= count(coll) then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i + 1)\n end\n end\n\n case array?(coll) then\n loop (acc = initial, i = 0) -> do\n if i >= count(coll) then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i + 1)\n end\n end\n\n case object?(coll) then\n reduce(keys(coll), (acc, k) -> fn(acc, coll(k), k), initial)\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n reduce-right: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n reduce(reverse(coll), fn, initial)\n\n case array?(coll) then\n reduce(reverse(coll), fn, initial)\n\n case object?(coll) then\n reduce(reverse(keys(coll)), (acc, k) -> fn(acc, coll(k)), initial)\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n reducei-right: (coll, fn, initial) -> do\n cond\n case string?(coll) then\n let len = count(coll);\n loop (acc = initial, i = len - 1) -> do\n if i < 0 then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i - 1)\n end\n end\n\n case array?(coll) then\n let len = count(coll);\n loop (acc = initial, i = len - 1) -> do\n if i < 0 then\n acc\n else\n recur(fn(acc, nth(coll, i), i), i - 1)\n end\n end\n\n case object?(coll) then\n reduce(reverse(keys(coll)), (acc, k) -> fn(acc, coll(k), k), initial)\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n reductions: (coll, fn, initial) -> do\n let items = cond\n case string?(coll) then\n if count(coll) == 0 then [] else for (i in range(count(coll))) -> nth(coll, i) end\n\n case array?(coll) then coll\n\n case object?(coll) then\n for (k in keys(coll)) -> coll(k)\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end;\n if count(items) == 0 then\n [initial]\n else\n reduce(items, (acc, elem) -> do\n let prev = last(acc);\n [...acc, fn(prev, elem)]\n end, [initial])\n end\n end,\n\n reductionsi: (coll, fn, initial) -> do\n cond\n case string?(coll) then do\n if count(coll) == 0 then\n [initial]\n else\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> do\n let prev = last(acc);\n [...acc, fn(prev, first(pair), second(pair))]\n end,\n [initial]\n )\n end\n end\n\n case array?(coll) then do\n if count(coll) == 0 then\n [initial]\n else\n reduce(\n for (i in range(count(coll))) -> [nth(coll, i), i],\n (acc, pair) -> do\n let prev = last(acc);\n [...acc, fn(prev, first(pair), second(pair))]\n end,\n [initial]\n )\n end\n end\n\n case object?(coll) then do\n let ks = keys(coll);\n if count(ks) == 0 then\n [initial]\n else\n reduce(ks, (acc, k) -> do\n let prev = last(acc);\n [...acc, fn(prev, coll(k), k)]\n end, [initial])\n end\n end\n\n case true then\n perform(effect(dvala.error), \"Expected collection\")\n end\n end,\n\n \"every?\": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), \"Expected collection\")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then true\n case not(fn(nth(items, i))) then false\n case true then recur(i + 1)\n end\n end,\n\n \"any?\": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), \"Expected collection\")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then false\n case fn(nth(items, i)) then true\n case true then recur(i + 1)\n end\n end,\n\n \"not-any?\": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), \"Expected collection\")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then true\n case fn(nth(items, i)) then false\n case true then recur(i + 1)\n end\n end,\n\n \"not-every?\": (coll, fn) -> do\n let items = cond\n case array?(coll) then coll\n case string?(coll) then for (i in range(count(coll))) -> nth(coll, i)\n case object?(coll) then for (k in keys(coll)) -> [k, coll(k)]\n case true then perform(effect(dvala.error), \"Expected collection\")\n end;\n loop (i = 0) ->\n cond\n case i >= count(items) then false\n case not(fn(nth(items, i))) then true\n case true then recur(i + 1)\n end\n end\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","getSourceCodeInfo","anyValue","getAssertionError","typeName","isObj","regexp","isEffect","isColl","isSeq","asColl","assertColl","isNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","assertNumber","sign","getSignString","numberType","range","getRangeString","filter","x","join","getNumberTypeName","assertString","nonEmpty","char","isString","asStringOrNumber","assertStringOrNumber","isStringOrNumber","collHasKey","coll","getOwnPropertyDescriptor","toAny","clone","entries","reduce","result","entry","val","map","item","cloneColl","assertArray","toFixedArity","arity","min","get","assoc","slice","copy","cloneAndGetMeta","originalColl","innerCollMeta","resultColl","newResultColl","assertObj","parent","collectionUtilsFunctions","evaluate","params","defaultValue","nextValue","undefined","docs","category","returns","args","a","b","variants","argumentNames","description","seeAlso","examples","isAny","assertAny","lastKey","parentKey","ks","array","update","fun","rest","filteri","mapi","reducei","initial","reductions","reductionsi","collectionUtilsModule","functions","source","fromEntries","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,E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