@mojir/dvala 0.0.1 → 0.0.3

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 (914) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1613 -4
  3. package/dist/bundler.esm.js +2 -0
  4. package/dist/bundler.esm.js.map +1 -0
  5. package/dist/bundler.js +2 -0
  6. package/dist/bundler.js.map +1 -0
  7. package/dist/cli/cli/src/cli.d.ts +2 -0
  8. package/dist/cli/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  9. package/dist/cli/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  10. package/dist/cli/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  11. package/dist/cli/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  12. package/dist/cli/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  13. package/dist/cli/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  14. package/dist/cli/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  15. package/dist/cli/cli/src/cliFormatterRules.d.ts +13 -0
  16. package/dist/cli/cli/src/colorizer.d.ts +939 -0
  17. package/dist/cli/cli/src/createReadlineInterface.d.ts +5 -0
  18. package/dist/cli/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  19. package/dist/cli/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  20. package/dist/cli/cli/src/js-interop/Cli/index.d.ts +2 -0
  21. package/dist/cli/cli.js +38685 -0
  22. package/dist/cli/common/createFormatter.d.ts +6 -0
  23. package/dist/cli/common/utils.d.ts +2 -0
  24. package/dist/cli/reference/api.d.ts +75 -0
  25. package/dist/cli/reference/datatype.d.ts +3 -0
  26. package/dist/cli/reference/effect.d.ts +3 -0
  27. package/dist/cli/reference/examples.d.ts +11 -0
  28. package/dist/cli/reference/index.d.ts +191 -0
  29. package/dist/cli/reference/shorthand.d.ts +3 -0
  30. package/dist/cli/src/AutoCompleter/AutoCompleter.d.ts +25 -0
  31. package/dist/cli/src/Dvala/Cache.d.ts +16 -0
  32. package/dist/cli/src/Dvala/Dvala.d.ts +68 -0
  33. package/dist/cli/src/allModules.d.ts +2 -0
  34. package/dist/cli/src/builtin/bindingNode.d.ts +11 -0
  35. package/dist/cli/src/builtin/core/array.d.ts +2 -0
  36. package/dist/cli/src/builtin/core/assertion.d.ts +2 -0
  37. package/dist/cli/src/builtin/core/bitwise.d.ts +2 -0
  38. package/dist/cli/src/builtin/core/collection.d.ts +2 -0
  39. package/dist/cli/src/builtin/core/functional.d.ts +2 -0
  40. package/dist/cli/src/builtin/core/math.d.ts +2 -0
  41. package/dist/cli/src/builtin/core/meta.d.ts +3 -0
  42. package/dist/cli/src/builtin/core/misc.d.ts +2 -0
  43. package/dist/cli/src/builtin/core/object.d.ts +2 -0
  44. package/dist/cli/src/builtin/core/predicates.d.ts +2 -0
  45. package/dist/cli/src/builtin/core/regexp.d.ts +2 -0
  46. package/dist/cli/src/builtin/core/sequence.d.ts +2 -0
  47. package/dist/cli/src/builtin/core/string.d.ts +2 -0
  48. package/dist/cli/src/builtin/core/vector.d.ts +2 -0
  49. package/dist/cli/src/builtin/index.d.ts +13 -0
  50. package/dist/cli/src/builtin/interface.d.ts +113 -0
  51. package/dist/cli/src/builtin/modules/assertion/docs.d.ts +2 -0
  52. package/dist/cli/src/builtin/modules/assertion/index.d.ts +2 -0
  53. package/dist/cli/src/builtin/modules/bitwise/index.d.ts +2 -0
  54. package/dist/cli/src/builtin/modules/collection/index.d.ts +2 -0
  55. package/dist/cli/src/builtin/modules/convert/index.d.ts +2 -0
  56. package/dist/cli/src/builtin/modules/functional/index.d.ts +2 -0
  57. package/dist/cli/src/builtin/modules/grid/docs.d.ts +2 -0
  58. package/dist/cli/src/builtin/modules/grid/fromArray.d.ts +8 -0
  59. package/dist/cli/src/builtin/modules/grid/index.d.ts +2 -0
  60. package/dist/cli/src/builtin/modules/grid/transpose.d.ts +2 -0
  61. package/dist/cli/src/builtin/modules/interface.d.ts +28 -0
  62. package/dist/cli/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  63. package/dist/cli/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  64. package/dist/cli/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  65. package/dist/cli/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  66. package/dist/cli/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  67. package/dist/cli/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  68. package/dist/cli/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  69. package/dist/cli/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  70. package/dist/cli/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  71. package/dist/cli/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  72. package/dist/cli/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  73. package/dist/cli/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  74. package/dist/cli/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  75. package/dist/cli/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  76. package/dist/cli/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  77. package/dist/cli/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  78. package/dist/cli/src/builtin/modules/math/index.d.ts +2 -0
  79. package/dist/cli/src/builtin/modules/matrix/docs.d.ts +2 -0
  80. package/dist/cli/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  81. package/dist/cli/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  82. package/dist/cli/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  83. package/dist/cli/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  84. package/dist/cli/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  85. package/dist/cli/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  86. package/dist/cli/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  87. package/dist/cli/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  88. package/dist/cli/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  89. package/dist/cli/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  90. package/dist/cli/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  91. package/dist/cli/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  92. package/dist/cli/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  93. package/dist/cli/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  94. package/dist/cli/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  95. package/dist/cli/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  96. package/dist/cli/src/builtin/modules/matrix/index.d.ts +4 -0
  97. package/dist/cli/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  98. package/dist/cli/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  99. package/dist/cli/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  100. package/dist/cli/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  101. package/dist/cli/src/builtin/modules/number-theory/docs.d.ts +2 -0
  102. package/dist/cli/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  103. package/dist/cli/src/builtin/modules/number-theory/index.d.ts +4 -0
  104. package/dist/cli/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  105. package/dist/cli/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  106. package/dist/cli/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  107. package/dist/cli/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  108. package/dist/cli/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  109. package/dist/cli/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  110. package/dist/cli/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  111. package/dist/cli/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  112. package/dist/cli/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  113. package/dist/cli/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  114. package/dist/cli/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  115. package/dist/cli/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  116. package/dist/cli/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  117. package/dist/cli/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  118. package/dist/cli/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  119. package/dist/cli/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  120. package/dist/cli/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  121. package/dist/cli/src/builtin/modules/number-theory/sequences/index.d.ts +27 -0
  122. package/dist/cli/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  123. package/dist/cli/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  124. package/dist/cli/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  125. package/dist/cli/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  126. package/dist/cli/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  127. package/dist/cli/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  128. package/dist/cli/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  129. package/dist/cli/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  130. package/dist/cli/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  131. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  132. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  133. package/dist/cli/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  134. package/dist/cli/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  135. package/dist/cli/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  136. package/dist/cli/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  137. package/dist/cli/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  138. package/dist/cli/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  139. package/dist/cli/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  140. package/dist/cli/src/builtin/modules/random/docs.d.ts +2 -0
  141. package/dist/cli/src/builtin/modules/random/index.d.ts +2 -0
  142. package/dist/cli/src/builtin/modules/sequence/index.d.ts +2 -0
  143. package/dist/cli/src/builtin/modules/string/index.d.ts +2 -0
  144. package/dist/cli/src/builtin/modules/vector/bincount.d.ts +9 -0
  145. package/dist/cli/src/builtin/modules/vector/calcMad.d.ts +1 -0
  146. package/dist/cli/src/builtin/modules/vector/calcMean.d.ts +1 -0
  147. package/dist/cli/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  148. package/dist/cli/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  149. package/dist/cli/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  150. package/dist/cli/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  151. package/dist/cli/src/builtin/modules/vector/docs.d.ts +2 -0
  152. package/dist/cli/src/builtin/modules/vector/entropy.d.ts +8 -0
  153. package/dist/cli/src/builtin/modules/vector/histogram.d.ts +9 -0
  154. package/dist/cli/src/builtin/modules/vector/index.d.ts +2 -0
  155. package/dist/cli/src/builtin/modules/vector/mode.d.ts +6 -0
  156. package/dist/cli/src/builtin/modules/vector/outliers.d.ts +7 -0
  157. package/dist/cli/src/builtin/modules/vector/percentile.d.ts +7 -0
  158. package/dist/cli/src/builtin/modules/vector/quartiles.d.ts +1 -0
  159. package/dist/cli/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  160. package/dist/cli/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  161. package/dist/cli/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  162. package/dist/cli/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  163. package/dist/cli/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  164. package/dist/cli/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  165. package/dist/cli/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  166. package/dist/cli/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  167. package/dist/cli/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  168. package/dist/cli/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  169. package/dist/cli/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  170. package/dist/cli/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  171. package/dist/cli/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  172. package/dist/cli/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  173. package/dist/cli/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  174. package/dist/cli/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  175. package/dist/cli/src/builtin/normalExpressions/index.d.ts +8 -0
  176. package/dist/cli/src/builtin/specialExpressionTypes.d.ts +26 -0
  177. package/dist/cli/src/builtin/specialExpressions/and.d.ts +6 -0
  178. package/dist/cli/src/builtin/specialExpressions/array.d.ts +6 -0
  179. package/dist/cli/src/builtin/specialExpressions/block.d.ts +6 -0
  180. package/dist/cli/src/builtin/specialExpressions/cond.d.ts +6 -0
  181. package/dist/cli/src/builtin/specialExpressions/defined.d.ts +5 -0
  182. package/dist/cli/src/builtin/specialExpressions/effect.d.ts +5 -0
  183. package/dist/cli/src/builtin/specialExpressions/functions.d.ts +6 -0
  184. package/dist/cli/src/builtin/specialExpressions/if.d.ts +6 -0
  185. package/dist/cli/src/builtin/specialExpressions/import.d.ts +6 -0
  186. package/dist/cli/src/builtin/specialExpressions/let.d.ts +6 -0
  187. package/dist/cli/src/builtin/specialExpressions/loop.d.ts +6 -0
  188. package/dist/cli/src/builtin/specialExpressions/loops.d.ts +9 -0
  189. package/dist/cli/src/builtin/specialExpressions/match.d.ts +7 -0
  190. package/dist/cli/src/builtin/specialExpressions/object.d.ts +6 -0
  191. package/dist/cli/src/builtin/specialExpressions/or.d.ts +6 -0
  192. package/dist/cli/src/builtin/specialExpressions/parallel.d.ts +6 -0
  193. package/dist/cli/src/builtin/specialExpressions/perform.d.ts +6 -0
  194. package/dist/cli/src/builtin/specialExpressions/qq.d.ts +6 -0
  195. package/dist/cli/src/builtin/specialExpressions/race.d.ts +6 -0
  196. package/dist/cli/src/builtin/specialExpressions/recur.d.ts +5 -0
  197. package/dist/cli/src/builtin/specialExpressions/throw.d.ts +5 -0
  198. package/dist/cli/src/builtin/specialExpressions/try.d.ts +7 -0
  199. package/dist/cli/src/builtin/specialExpressions/unless.d.ts +6 -0
  200. package/dist/cli/src/builtin/utils.d.ts +6 -0
  201. package/dist/cli/src/bundler/index.d.ts +9 -0
  202. package/dist/cli/src/bundler/interface.d.ts +15 -0
  203. package/dist/cli/src/bundler.d.ts +3 -0
  204. package/dist/cli/src/cli.d.ts +2 -0
  205. package/dist/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  206. package/dist/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  207. package/dist/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  208. package/dist/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  209. package/dist/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  210. package/dist/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  211. package/dist/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  212. package/dist/cli/src/cliFormatterRules.d.ts +13 -0
  213. package/dist/cli/src/colorizer.d.ts +939 -0
  214. package/dist/cli/src/constants/constants.d.ts +19 -0
  215. package/dist/cli/src/createReadlineInterface.d.ts +5 -0
  216. package/dist/cli/src/effects.d.ts +106 -0
  217. package/dist/cli/src/errors.d.ts +24 -0
  218. package/dist/cli/src/evaluator/ContextStack.d.ts +65 -0
  219. package/dist/cli/src/evaluator/effectRef.d.ts +27 -0
  220. package/dist/cli/src/evaluator/effectTypes.d.ts +79 -0
  221. package/dist/cli/src/evaluator/frames.d.ts +539 -0
  222. package/dist/cli/src/evaluator/interface.d.ts +14 -0
  223. package/dist/cli/src/evaluator/serialization.d.ts +45 -0
  224. package/dist/cli/src/evaluator/standardEffects.d.ts +35 -0
  225. package/dist/cli/src/evaluator/step.d.ts +159 -0
  226. package/dist/cli/src/evaluator/suspension.d.ts +53 -0
  227. package/dist/cli/src/evaluator/trampoline.d.ts +119 -0
  228. package/dist/cli/src/getUndefinedSymbols/index.d.ts +7 -0
  229. package/dist/cli/src/index.d.ts +18 -0
  230. package/dist/cli/src/initReferenceData.d.ts +1 -0
  231. package/dist/cli/src/interface.d.ts +7 -0
  232. package/dist/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  233. package/dist/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  234. package/dist/cli/src/js-interop/Cli/index.d.ts +2 -0
  235. package/dist/cli/src/parser/ParserContext.d.ts +20 -0
  236. package/dist/cli/src/parser/getPrecedence.d.ts +3 -0
  237. package/dist/cli/src/parser/helpers.d.ts +19 -0
  238. package/dist/cli/src/parser/index.d.ts +5 -0
  239. package/dist/cli/src/parser/subParsers/parseArray.d.ts +3 -0
  240. package/dist/cli/src/parser/subParsers/parseBindingTarget.d.ts +8 -0
  241. package/dist/cli/src/parser/subParsers/parseCond.d.ts +4 -0
  242. package/dist/cli/src/parser/subParsers/parseDo.d.ts +3 -0
  243. package/dist/cli/src/parser/subParsers/parseExpression.d.ts +5 -0
  244. package/dist/cli/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  245. package/dist/cli/src/parser/subParsers/parseFunction.d.ts +4 -0
  246. package/dist/cli/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  247. package/dist/cli/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  248. package/dist/cli/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  249. package/dist/cli/src/parser/subParsers/parseLet.d.ts +4 -0
  250. package/dist/cli/src/parser/subParsers/parseLoop.d.ts +4 -0
  251. package/dist/cli/src/parser/subParsers/parseMatch.d.ts +4 -0
  252. package/dist/cli/src/parser/subParsers/parseNumber.d.ts +3 -0
  253. package/dist/cli/src/parser/subParsers/parseObject.d.ts +3 -0
  254. package/dist/cli/src/parser/subParsers/parseOperand.d.ts +3 -0
  255. package/dist/cli/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  256. package/dist/cli/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  257. package/dist/cli/src/parser/subParsers/parseString.d.ts +4 -0
  258. package/dist/cli/src/parser/subParsers/parseSymbol.d.ts +3 -0
  259. package/dist/cli/src/parser/subParsers/parseTry.d.ts +4 -0
  260. package/dist/cli/src/parser/types.d.ts +129 -0
  261. package/dist/cli/src/symbolPatterns.d.ts +2 -0
  262. package/dist/cli/src/testFramework/index.d.ts +15 -0
  263. package/dist/cli/src/tokenizer/minifyTokenStream.d.ts +4 -0
  264. package/dist/cli/src/tokenizer/operators.d.ts +12 -0
  265. package/dist/cli/src/tokenizer/reservedNames.d.ts +66 -0
  266. package/dist/cli/src/tokenizer/token.d.ts +84 -0
  267. package/dist/cli/src/tokenizer/tokenize.d.ts +8 -0
  268. package/dist/cli/src/tokenizer/tokenizers.d.ts +14 -0
  269. package/dist/cli/src/transformer/index.d.ts +2 -0
  270. package/dist/cli/src/typeGuards/annotatedArrays.d.ts +16 -0
  271. package/dist/cli/src/typeGuards/array.d.ts +9 -0
  272. package/dist/cli/src/typeGuards/astNode.d.ts +19 -0
  273. package/dist/cli/src/typeGuards/dvala.d.ts +26 -0
  274. package/dist/cli/src/typeGuards/dvalaFunction.d.ts +12 -0
  275. package/dist/cli/src/typeGuards/index.d.ts +7 -0
  276. package/dist/cli/src/typeGuards/number.d.ts +66 -0
  277. package/dist/cli/src/typeGuards/string.d.ts +15 -0
  278. package/dist/cli/src/untokenizer/index.d.ts +2 -0
  279. package/dist/cli/src/utils/arity.d.ts +10 -0
  280. package/dist/cli/src/utils/debug/debugTools.d.ts +1 -0
  281. package/dist/cli/src/utils/debug/getCodeMarker.d.ts +2 -0
  282. package/dist/cli/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  283. package/dist/cli/src/utils/docString/generateDocString.d.ts +2 -0
  284. package/dist/cli/src/utils/getAssertionError.d.ts +3 -0
  285. package/dist/cli/src/utils/index.d.ts +14 -0
  286. package/dist/cli/src/utils/maybePromise.d.ts +54 -0
  287. package/dist/cli/src/utils/symbols.d.ts +3 -0
  288. package/dist/common/createFormatter.d.ts +6 -0
  289. package/dist/common/utils.d.ts +2 -0
  290. package/dist/debug.esm.js +2 -0
  291. package/dist/debug.esm.js.map +1 -0
  292. package/dist/debug.js +2 -0
  293. package/dist/debug.js.map +1 -0
  294. package/dist/dvala.iife.js +2 -0
  295. package/dist/dvala.iife.js.map +1 -0
  296. package/dist/full.esm.js +2 -0
  297. package/dist/full.esm.js.map +1 -0
  298. package/dist/full.js +2 -0
  299. package/dist/full.js.map +1 -0
  300. package/dist/index.esm.js +2 -0
  301. package/dist/index.esm.js.map +1 -0
  302. package/dist/index.js +2 -2
  303. package/dist/index.js.map +1 -1
  304. package/dist/modules/assertion.esm.js +2 -0
  305. package/dist/modules/assertion.esm.js.map +1 -0
  306. package/dist/modules/assertion.js +2 -0
  307. package/dist/modules/assertion.js.map +1 -0
  308. package/dist/modules/bitwise.esm.js +2 -0
  309. package/dist/modules/bitwise.esm.js.map +1 -0
  310. package/dist/modules/bitwise.js +2 -0
  311. package/dist/modules/bitwise.js.map +1 -0
  312. package/dist/modules/cli/src/cli.d.ts +2 -0
  313. package/dist/modules/cli/src/cliDocumentation/formatCliDescription.d.ts +3 -0
  314. package/dist/modules/cli/src/cliDocumentation/getCliArgumentInfo.d.ts +3 -0
  315. package/dist/modules/cli/src/cliDocumentation/getCliDocumentation.d.ts +2 -0
  316. package/dist/modules/cli/src/cliDocumentation/getCliFunctionExamples.d.ts +3 -0
  317. package/dist/modules/cli/src/cliDocumentation/getCliFunctionSignature.d.ts +3 -0
  318. package/dist/modules/cli/src/cliDocumentation/getCliTitle.d.ts +3 -0
  319. package/dist/modules/cli/src/cliDocumentation/getCliType.d.ts +3 -0
  320. package/dist/modules/cli/src/cliFormatterRules.d.ts +13 -0
  321. package/dist/modules/cli/src/colorizer.d.ts +939 -0
  322. package/dist/modules/cli/src/createReadlineInterface.d.ts +5 -0
  323. package/dist/modules/cli/src/js-interop/Cli/Fs/index.d.ts +2 -0
  324. package/dist/modules/cli/src/js-interop/Cli/Proc/index.d.ts +3 -0
  325. package/dist/modules/cli/src/js-interop/Cli/index.d.ts +2 -0
  326. package/dist/modules/collection.esm.js +2 -0
  327. package/dist/modules/collection.esm.js.map +1 -0
  328. package/dist/modules/collection.js +2 -0
  329. package/dist/modules/collection.js.map +1 -0
  330. package/dist/modules/common/createFormatter.d.ts +6 -0
  331. package/dist/modules/common/utils.d.ts +2 -0
  332. package/dist/modules/convert.esm.js +2 -0
  333. package/dist/modules/convert.esm.js.map +1 -0
  334. package/dist/modules/convert.js +2 -0
  335. package/dist/modules/convert.js.map +1 -0
  336. package/dist/modules/functional.esm.js +2 -0
  337. package/dist/modules/functional.esm.js.map +1 -0
  338. package/dist/modules/functional.js +2 -0
  339. package/dist/modules/functional.js.map +1 -0
  340. package/dist/modules/grid.esm.js +2 -0
  341. package/dist/modules/grid.esm.js.map +1 -0
  342. package/dist/modules/grid.js +2 -0
  343. package/dist/modules/grid.js.map +1 -0
  344. package/dist/modules/linear-algebra.esm.js +2 -0
  345. package/dist/modules/linear-algebra.esm.js.map +1 -0
  346. package/dist/modules/linear-algebra.js +2 -0
  347. package/dist/modules/linear-algebra.js.map +1 -0
  348. package/dist/modules/math.esm.js +2 -0
  349. package/dist/modules/math.esm.js.map +1 -0
  350. package/dist/modules/math.js +2 -0
  351. package/dist/modules/math.js.map +1 -0
  352. package/dist/modules/matrix.esm.js +2 -0
  353. package/dist/modules/matrix.esm.js.map +1 -0
  354. package/dist/modules/matrix.js +2 -0
  355. package/dist/modules/matrix.js.map +1 -0
  356. package/dist/modules/number-theory.esm.js +2 -0
  357. package/dist/modules/number-theory.esm.js.map +1 -0
  358. package/dist/modules/number-theory.js +2 -0
  359. package/dist/modules/number-theory.js.map +1 -0
  360. package/dist/modules/random.esm.js +2 -0
  361. package/dist/modules/random.esm.js.map +1 -0
  362. package/dist/modules/random.js +2 -0
  363. package/dist/modules/random.js.map +1 -0
  364. package/dist/modules/reference/api.d.ts +75 -0
  365. package/dist/modules/reference/datatype.d.ts +3 -0
  366. package/dist/modules/reference/effect.d.ts +3 -0
  367. package/dist/modules/reference/index.d.ts +191 -0
  368. package/dist/modules/reference/shorthand.d.ts +3 -0
  369. package/dist/modules/sequence.esm.js +2 -0
  370. package/dist/modules/sequence.esm.js.map +1 -0
  371. package/dist/modules/sequence.js +2 -0
  372. package/dist/modules/sequence.js.map +1 -0
  373. package/dist/modules/src/AutoCompleter/AutoCompleter.d.ts +25 -0
  374. package/dist/modules/src/Dvala/Cache.d.ts +16 -0
  375. package/dist/modules/src/Dvala/Dvala.d.ts +68 -0
  376. package/dist/modules/src/allModules.d.ts +2 -0
  377. package/dist/modules/src/builtin/bindingNode.d.ts +11 -0
  378. package/dist/modules/src/builtin/core/array.d.ts +2 -0
  379. package/dist/modules/src/builtin/core/assertion.d.ts +2 -0
  380. package/dist/modules/src/builtin/core/bitwise.d.ts +2 -0
  381. package/dist/modules/src/builtin/core/collection.d.ts +2 -0
  382. package/dist/modules/src/builtin/core/functional.d.ts +2 -0
  383. package/dist/modules/src/builtin/core/math.d.ts +2 -0
  384. package/dist/modules/src/builtin/core/meta.d.ts +3 -0
  385. package/dist/modules/src/builtin/core/misc.d.ts +2 -0
  386. package/dist/modules/src/builtin/core/object.d.ts +2 -0
  387. package/dist/modules/src/builtin/core/predicates.d.ts +2 -0
  388. package/dist/modules/src/builtin/core/regexp.d.ts +2 -0
  389. package/dist/modules/src/builtin/core/sequence.d.ts +2 -0
  390. package/dist/modules/src/builtin/core/string.d.ts +2 -0
  391. package/dist/modules/src/builtin/core/vector.d.ts +2 -0
  392. package/dist/modules/src/builtin/index.d.ts +13 -0
  393. package/dist/modules/src/builtin/interface.d.ts +113 -0
  394. package/dist/modules/src/builtin/modules/assertion/docs.d.ts +2 -0
  395. package/dist/modules/src/builtin/modules/assertion/index.d.ts +2 -0
  396. package/dist/modules/src/builtin/modules/bitwise/index.d.ts +2 -0
  397. package/dist/modules/src/builtin/modules/collection/index.d.ts +2 -0
  398. package/dist/modules/src/builtin/modules/convert/index.d.ts +2 -0
  399. package/dist/modules/src/builtin/modules/functional/index.d.ts +2 -0
  400. package/dist/modules/src/builtin/modules/grid/docs.d.ts +2 -0
  401. package/dist/modules/src/builtin/modules/grid/fromArray.d.ts +8 -0
  402. package/dist/modules/src/builtin/modules/grid/index.d.ts +2 -0
  403. package/dist/modules/src/builtin/modules/grid/transpose.d.ts +2 -0
  404. package/dist/modules/src/builtin/modules/interface.d.ts +28 -0
  405. package/dist/modules/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  406. package/dist/modules/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  407. package/dist/modules/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  408. package/dist/modules/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  409. package/dist/modules/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  410. package/dist/modules/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  411. package/dist/modules/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  412. package/dist/modules/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  413. package/dist/modules/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  414. package/dist/modules/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  415. package/dist/modules/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  416. package/dist/modules/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  417. package/dist/modules/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  418. package/dist/modules/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  419. package/dist/modules/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  420. package/dist/modules/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  421. package/dist/modules/src/builtin/modules/math/index.d.ts +2 -0
  422. package/dist/modules/src/builtin/modules/matrix/docs.d.ts +2 -0
  423. package/dist/modules/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  424. package/dist/modules/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  425. package/dist/modules/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  426. package/dist/modules/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  427. package/dist/modules/src/builtin/modules/matrix/helpers/diagonal.d.ts +1 -0
  428. package/dist/modules/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  429. package/dist/modules/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  430. package/dist/modules/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  431. package/dist/modules/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  432. package/dist/modules/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  433. package/dist/modules/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  434. package/dist/modules/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  435. package/dist/modules/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  436. package/dist/modules/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  437. package/dist/modules/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  438. package/dist/modules/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  439. package/dist/modules/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  440. package/dist/modules/src/builtin/modules/matrix/index.d.ts +4 -0
  441. package/dist/modules/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  442. package/dist/modules/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  443. package/dist/modules/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  444. package/dist/modules/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  445. package/dist/modules/src/builtin/modules/number-theory/docs.d.ts +2 -0
  446. package/dist/modules/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  447. package/dist/modules/src/builtin/modules/number-theory/index.d.ts +4 -0
  448. package/dist/modules/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  449. package/dist/modules/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  450. package/dist/modules/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  451. package/dist/modules/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  452. package/dist/modules/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  453. package/dist/modules/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  454. package/dist/modules/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  455. package/dist/modules/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  456. package/dist/modules/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  457. package/dist/modules/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  458. package/dist/modules/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  459. package/dist/modules/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  460. package/dist/modules/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  461. package/dist/modules/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  462. package/dist/modules/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  463. package/dist/modules/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  464. package/dist/modules/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  465. package/dist/modules/src/builtin/modules/number-theory/sequences/index.d.ts +27 -0
  466. package/dist/modules/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  467. package/dist/modules/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  468. package/dist/modules/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  469. package/dist/modules/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  470. package/dist/modules/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  471. package/dist/modules/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  472. package/dist/modules/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  473. package/dist/modules/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  474. package/dist/modules/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  475. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  476. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  477. package/dist/modules/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  478. package/dist/modules/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  479. package/dist/modules/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  480. package/dist/modules/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  481. package/dist/modules/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  482. package/dist/modules/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  483. package/dist/modules/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  484. package/dist/modules/src/builtin/modules/random/docs.d.ts +2 -0
  485. package/dist/modules/src/builtin/modules/random/index.d.ts +2 -0
  486. package/dist/modules/src/builtin/modules/sequence/index.d.ts +2 -0
  487. package/dist/modules/src/builtin/modules/string/index.d.ts +2 -0
  488. package/dist/modules/src/builtin/modules/vector/bincount.d.ts +9 -0
  489. package/dist/modules/src/builtin/modules/vector/calcMad.d.ts +1 -0
  490. package/dist/modules/src/builtin/modules/vector/calcMean.d.ts +1 -0
  491. package/dist/modules/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  492. package/dist/modules/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  493. package/dist/modules/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  494. package/dist/modules/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  495. package/dist/modules/src/builtin/modules/vector/docs.d.ts +2 -0
  496. package/dist/modules/src/builtin/modules/vector/entropy.d.ts +8 -0
  497. package/dist/modules/src/builtin/modules/vector/histogram.d.ts +9 -0
  498. package/dist/modules/src/builtin/modules/vector/index.d.ts +2 -0
  499. package/dist/modules/src/builtin/modules/vector/mode.d.ts +6 -0
  500. package/dist/modules/src/builtin/modules/vector/outliers.d.ts +7 -0
  501. package/dist/modules/src/builtin/modules/vector/percentile.d.ts +7 -0
  502. package/dist/modules/src/builtin/modules/vector/quartiles.d.ts +1 -0
  503. package/dist/modules/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  504. package/dist/modules/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  505. package/dist/modules/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  506. package/dist/modules/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  507. package/dist/modules/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  508. package/dist/modules/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  509. package/dist/modules/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  510. package/dist/modules/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  511. package/dist/modules/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  512. package/dist/modules/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  513. package/dist/modules/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  514. package/dist/modules/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  515. package/dist/modules/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  516. package/dist/modules/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  517. package/dist/modules/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  518. package/dist/modules/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  519. package/dist/modules/src/builtin/normalExpressions/index.d.ts +8 -0
  520. package/dist/modules/src/builtin/specialExpressionTypes.d.ts +26 -0
  521. package/dist/modules/src/builtin/specialExpressions/and.d.ts +6 -0
  522. package/dist/modules/src/builtin/specialExpressions/array.d.ts +6 -0
  523. package/dist/modules/src/builtin/specialExpressions/block.d.ts +6 -0
  524. package/dist/modules/src/builtin/specialExpressions/cond.d.ts +6 -0
  525. package/dist/modules/src/builtin/specialExpressions/defined.d.ts +5 -0
  526. package/dist/modules/src/builtin/specialExpressions/effect.d.ts +5 -0
  527. package/dist/modules/src/builtin/specialExpressions/functions.d.ts +6 -0
  528. package/dist/modules/src/builtin/specialExpressions/if.d.ts +6 -0
  529. package/dist/modules/src/builtin/specialExpressions/import.d.ts +6 -0
  530. package/dist/modules/src/builtin/specialExpressions/let.d.ts +6 -0
  531. package/dist/modules/src/builtin/specialExpressions/loop.d.ts +6 -0
  532. package/dist/modules/src/builtin/specialExpressions/loops.d.ts +9 -0
  533. package/dist/modules/src/builtin/specialExpressions/match.d.ts +7 -0
  534. package/dist/modules/src/builtin/specialExpressions/object.d.ts +6 -0
  535. package/dist/modules/src/builtin/specialExpressions/or.d.ts +6 -0
  536. package/dist/modules/src/builtin/specialExpressions/parallel.d.ts +6 -0
  537. package/dist/modules/src/builtin/specialExpressions/perform.d.ts +6 -0
  538. package/dist/modules/src/builtin/specialExpressions/qq.d.ts +6 -0
  539. package/dist/modules/src/builtin/specialExpressions/race.d.ts +6 -0
  540. package/dist/modules/src/builtin/specialExpressions/recur.d.ts +5 -0
  541. package/dist/modules/src/builtin/specialExpressions/throw.d.ts +5 -0
  542. package/dist/modules/src/builtin/specialExpressions/try.d.ts +7 -0
  543. package/dist/modules/src/builtin/specialExpressions/unless.d.ts +6 -0
  544. package/dist/modules/src/builtin/utils.d.ts +6 -0
  545. package/dist/modules/src/bundler/index.d.ts +9 -0
  546. package/dist/modules/src/bundler/interface.d.ts +15 -0
  547. package/dist/modules/src/bundler.d.ts +3 -0
  548. package/dist/modules/src/constants/constants.d.ts +19 -0
  549. package/dist/modules/src/debug.d.ts +115 -0
  550. package/dist/modules/src/effects.d.ts +106 -0
  551. package/dist/modules/src/errors.d.ts +24 -0
  552. package/dist/modules/src/evaluator/ContextStack.d.ts +65 -0
  553. package/dist/modules/src/evaluator/effectRef.d.ts +27 -0
  554. package/dist/modules/src/evaluator/effectTypes.d.ts +79 -0
  555. package/dist/modules/src/evaluator/frames.d.ts +539 -0
  556. package/dist/modules/src/evaluator/interface.d.ts +14 -0
  557. package/dist/modules/src/evaluator/serialization.d.ts +45 -0
  558. package/dist/modules/src/evaluator/standardEffects.d.ts +35 -0
  559. package/dist/modules/src/evaluator/step.d.ts +159 -0
  560. package/dist/modules/src/evaluator/suspension.d.ts +53 -0
  561. package/dist/modules/src/evaluator/trampoline.d.ts +119 -0
  562. package/dist/modules/src/full.d.ts +17 -0
  563. package/dist/modules/src/getUndefinedSymbols/index.d.ts +7 -0
  564. package/dist/modules/src/index.d.ts +18 -0
  565. package/dist/modules/src/initReferenceData.d.ts +1 -0
  566. package/dist/modules/src/interface.d.ts +7 -0
  567. package/dist/modules/src/modules/assertion.d.ts +2 -0
  568. package/dist/modules/src/modules/bitwise.d.ts +2 -0
  569. package/dist/modules/src/modules/collection.d.ts +2 -0
  570. package/dist/modules/src/modules/convert.d.ts +2 -0
  571. package/dist/modules/src/modules/functional.d.ts +2 -0
  572. package/dist/modules/src/modules/grid.d.ts +2 -0
  573. package/dist/modules/src/modules/linear-algebra.d.ts +2 -0
  574. package/dist/modules/src/modules/math.d.ts +2 -0
  575. package/dist/modules/src/modules/matrix.d.ts +2 -0
  576. package/dist/modules/src/modules/number-theory.d.ts +2 -0
  577. package/dist/modules/src/modules/random.d.ts +2 -0
  578. package/dist/modules/src/modules/sequence.d.ts +2 -0
  579. package/dist/modules/src/modules/string.d.ts +2 -0
  580. package/dist/modules/src/modules/vector.d.ts +2 -0
  581. package/dist/modules/src/parser/ParserContext.d.ts +20 -0
  582. package/dist/modules/src/parser/getPrecedence.d.ts +3 -0
  583. package/dist/modules/src/parser/helpers.d.ts +19 -0
  584. package/dist/modules/src/parser/index.d.ts +5 -0
  585. package/dist/modules/src/parser/subParsers/parseArray.d.ts +3 -0
  586. package/dist/modules/src/parser/subParsers/parseBindingTarget.d.ts +8 -0
  587. package/dist/modules/src/parser/subParsers/parseCond.d.ts +4 -0
  588. package/dist/modules/src/parser/subParsers/parseDo.d.ts +3 -0
  589. package/dist/modules/src/parser/subParsers/parseExpression.d.ts +5 -0
  590. package/dist/modules/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  591. package/dist/modules/src/parser/subParsers/parseFunction.d.ts +4 -0
  592. package/dist/modules/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  593. package/dist/modules/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  594. package/dist/modules/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  595. package/dist/modules/src/parser/subParsers/parseLet.d.ts +4 -0
  596. package/dist/modules/src/parser/subParsers/parseLoop.d.ts +4 -0
  597. package/dist/modules/src/parser/subParsers/parseMatch.d.ts +4 -0
  598. package/dist/modules/src/parser/subParsers/parseNumber.d.ts +3 -0
  599. package/dist/modules/src/parser/subParsers/parseObject.d.ts +3 -0
  600. package/dist/modules/src/parser/subParsers/parseOperand.d.ts +3 -0
  601. package/dist/modules/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  602. package/dist/modules/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  603. package/dist/modules/src/parser/subParsers/parseString.d.ts +4 -0
  604. package/dist/modules/src/parser/subParsers/parseSymbol.d.ts +3 -0
  605. package/dist/modules/src/parser/subParsers/parseTry.d.ts +4 -0
  606. package/dist/modules/src/parser/types.d.ts +129 -0
  607. package/dist/modules/src/symbolPatterns.d.ts +2 -0
  608. package/dist/modules/src/testFramework/index.d.ts +15 -0
  609. package/dist/modules/src/tokenizer/minifyTokenStream.d.ts +4 -0
  610. package/dist/modules/src/tokenizer/operators.d.ts +12 -0
  611. package/dist/modules/src/tokenizer/reservedNames.d.ts +66 -0
  612. package/dist/modules/src/tokenizer/token.d.ts +84 -0
  613. package/dist/modules/src/tokenizer/tokenize.d.ts +8 -0
  614. package/dist/modules/src/tokenizer/tokenizers.d.ts +14 -0
  615. package/dist/modules/src/transformer/index.d.ts +2 -0
  616. package/dist/modules/src/typeGuards/annotatedArrays.d.ts +16 -0
  617. package/dist/modules/src/typeGuards/array.d.ts +9 -0
  618. package/dist/modules/src/typeGuards/astNode.d.ts +19 -0
  619. package/dist/modules/src/typeGuards/dvala.d.ts +26 -0
  620. package/dist/modules/src/typeGuards/dvalaFunction.d.ts +12 -0
  621. package/dist/modules/src/typeGuards/index.d.ts +7 -0
  622. package/dist/modules/src/typeGuards/number.d.ts +66 -0
  623. package/dist/modules/src/typeGuards/string.d.ts +15 -0
  624. package/dist/modules/src/untokenizer/index.d.ts +2 -0
  625. package/dist/modules/src/utils/arity.d.ts +10 -0
  626. package/dist/modules/src/utils/debug/debugTools.d.ts +1 -0
  627. package/dist/modules/src/utils/debug/getCodeMarker.d.ts +2 -0
  628. package/dist/modules/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  629. package/dist/modules/src/utils/docString/generateDocString.d.ts +2 -0
  630. package/dist/modules/src/utils/getAssertionError.d.ts +3 -0
  631. package/dist/modules/src/utils/index.d.ts +14 -0
  632. package/dist/modules/src/utils/maybePromise.d.ts +54 -0
  633. package/dist/modules/src/utils/symbols.d.ts +3 -0
  634. package/dist/modules/string.esm.js +2 -0
  635. package/dist/modules/string.esm.js.map +1 -0
  636. package/dist/modules/string.js +2 -0
  637. package/dist/modules/string.js.map +1 -0
  638. package/dist/modules/vector.esm.js +2 -0
  639. package/dist/modules/vector.esm.js.map +1 -0
  640. package/dist/modules/vector.js +2 -0
  641. package/dist/modules/vector.js.map +1 -0
  642. package/dist/reference/api.d.ts +75 -0
  643. package/dist/reference/datatype.d.ts +3 -0
  644. package/dist/reference/effect.d.ts +3 -0
  645. package/dist/reference/index.d.ts +191 -0
  646. package/dist/reference/shorthand.d.ts +3 -0
  647. package/dist/src/AutoCompleter/AutoCompleter.d.ts +25 -0
  648. package/dist/src/Dvala/Cache.d.ts +16 -0
  649. package/dist/src/Dvala/Dvala.d.ts +68 -0
  650. package/dist/src/allModules.d.ts +2 -0
  651. package/dist/src/builtin/bindingNode.d.ts +11 -0
  652. package/dist/src/builtin/core/array.d.ts +2 -0
  653. package/dist/src/builtin/core/assertion.d.ts +2 -0
  654. package/dist/src/builtin/core/bitwise.d.ts +2 -0
  655. package/dist/src/builtin/core/collection.d.ts +2 -0
  656. package/dist/src/builtin/core/functional.d.ts +2 -0
  657. package/dist/src/builtin/core/math.d.ts +2 -0
  658. package/dist/src/builtin/core/meta.d.ts +3 -0
  659. package/dist/src/builtin/core/misc.d.ts +2 -0
  660. package/dist/src/builtin/core/object.d.ts +2 -0
  661. package/dist/src/builtin/core/predicates.d.ts +2 -0
  662. package/dist/src/builtin/core/regexp.d.ts +2 -0
  663. package/dist/src/builtin/core/sequence.d.ts +2 -0
  664. package/dist/src/builtin/core/string.d.ts +2 -0
  665. package/dist/src/builtin/core/vector.d.ts +2 -0
  666. package/dist/src/builtin/index.d.ts +13 -0
  667. package/dist/src/builtin/interface.d.ts +113 -0
  668. package/dist/src/builtin/modules/assertion/docs.d.ts +2 -0
  669. package/dist/src/builtin/modules/assertion/index.d.ts +2 -0
  670. package/dist/src/builtin/modules/bitwise/index.d.ts +2 -0
  671. package/dist/src/builtin/modules/collection/index.d.ts +2 -0
  672. package/dist/src/builtin/modules/convert/index.d.ts +2 -0
  673. package/dist/src/builtin/modules/functional/index.d.ts +2 -0
  674. package/dist/src/builtin/modules/grid/docs.d.ts +2 -0
  675. package/dist/src/builtin/modules/grid/fromArray.d.ts +8 -0
  676. package/dist/src/builtin/modules/grid/index.d.ts +2 -0
  677. package/dist/src/builtin/modules/grid/transpose.d.ts +2 -0
  678. package/dist/src/builtin/modules/interface.d.ts +28 -0
  679. package/dist/src/builtin/modules/linear-algebra/docs.d.ts +2 -0
  680. package/dist/src/builtin/modules/linear-algebra/helpers/calcFractionalRanks.d.ts +1 -0
  681. package/dist/src/builtin/modules/linear-algebra/helpers/collinear.d.ts +2 -0
  682. package/dist/src/builtin/modules/linear-algebra/helpers/corrleation.d.ts +8 -0
  683. package/dist/src/builtin/modules/linear-algebra/helpers/covariance.d.ts +4 -0
  684. package/dist/src/builtin/modules/linear-algebra/helpers/dot.d.ts +1 -0
  685. package/dist/src/builtin/modules/linear-algebra/helpers/gaussJordanElimination.d.ts +7 -0
  686. package/dist/src/builtin/modules/linear-algebra/helpers/getUnit.d.ts +2 -0
  687. package/dist/src/builtin/modules/linear-algebra/helpers/isZeroVector.d.ts +1 -0
  688. package/dist/src/builtin/modules/linear-algebra/helpers/kendallTau.d.ts +10 -0
  689. package/dist/src/builtin/modules/linear-algebra/helpers/length.d.ts +1 -0
  690. package/dist/src/builtin/modules/linear-algebra/helpers/pearsonCorr.d.ts +1 -0
  691. package/dist/src/builtin/modules/linear-algebra/helpers/scale.d.ts +1 -0
  692. package/dist/src/builtin/modules/linear-algebra/helpers/solve.d.ts +8 -0
  693. package/dist/src/builtin/modules/linear-algebra/helpers/subtract.d.ts +1 -0
  694. package/dist/src/builtin/modules/linear-algebra/index.d.ts +4 -0
  695. package/dist/src/builtin/modules/math/index.d.ts +2 -0
  696. package/dist/src/builtin/modules/matrix/docs.d.ts +2 -0
  697. package/dist/src/builtin/modules/matrix/helpers/adjugate.d.ts +1 -0
  698. package/dist/src/builtin/modules/matrix/helpers/band.d.ts +9 -0
  699. package/dist/src/builtin/modules/matrix/helpers/cofactor.d.ts +1 -0
  700. package/dist/src/builtin/modules/matrix/helpers/determinant.d.ts +6 -0
  701. package/dist/src/builtin/modules/matrix/helpers/diagonal.d.ts +1 -0
  702. package/dist/src/builtin/modules/matrix/helpers/inverse.d.ts +6 -0
  703. package/dist/src/builtin/modules/matrix/helpers/isBanded.d.ts +11 -0
  704. package/dist/src/builtin/modules/matrix/helpers/isDiagonal.d.ts +10 -0
  705. package/dist/src/builtin/modules/matrix/helpers/isIdentity.d.ts +1 -0
  706. package/dist/src/builtin/modules/matrix/helpers/isOrthogonal.d.ts +1 -0
  707. package/dist/src/builtin/modules/matrix/helpers/isSquare.d.ts +1 -0
  708. package/dist/src/builtin/modules/matrix/helpers/isSymetric.d.ts +8 -0
  709. package/dist/src/builtin/modules/matrix/helpers/isTriangular.d.ts +13 -0
  710. package/dist/src/builtin/modules/matrix/helpers/matrixMultiply.d.ts +7 -0
  711. package/dist/src/builtin/modules/matrix/helpers/minor.d.ts +1 -0
  712. package/dist/src/builtin/modules/matrix/helpers/norm1.d.ts +1 -0
  713. package/dist/src/builtin/modules/matrix/helpers/trace.d.ts +8 -0
  714. package/dist/src/builtin/modules/matrix/index.d.ts +4 -0
  715. package/dist/src/builtin/modules/number-theory/binomialCefficient.d.ts +1 -0
  716. package/dist/src/builtin/modules/number-theory/combinations.d.ts +2 -0
  717. package/dist/src/builtin/modules/number-theory/derangements.d.ts +2 -0
  718. package/dist/src/builtin/modules/number-theory/divisors.d.ts +4 -0
  719. package/dist/src/builtin/modules/number-theory/docs.d.ts +2 -0
  720. package/dist/src/builtin/modules/number-theory/factorial.d.ts +3 -0
  721. package/dist/src/builtin/modules/number-theory/index.d.ts +4 -0
  722. package/dist/src/builtin/modules/number-theory/partitions.d.ts +2 -0
  723. package/dist/src/builtin/modules/number-theory/permutations.d.ts +2 -0
  724. package/dist/src/builtin/modules/number-theory/powerSet.d.ts +2 -0
  725. package/dist/src/builtin/modules/number-theory/primeFactors.d.ts +11 -0
  726. package/dist/src/builtin/modules/number-theory/sequences/abundant.d.ts +2 -0
  727. package/dist/src/builtin/modules/number-theory/sequences/arithmetic.d.ts +2 -0
  728. package/dist/src/builtin/modules/number-theory/sequences/bell.d.ts +1 -0
  729. package/dist/src/builtin/modules/number-theory/sequences/bernoulli.d.ts +2 -0
  730. package/dist/src/builtin/modules/number-theory/sequences/catalan.d.ts +1 -0
  731. package/dist/src/builtin/modules/number-theory/sequences/collatz.d.ts +2 -0
  732. package/dist/src/builtin/modules/number-theory/sequences/composite.d.ts +3 -0
  733. package/dist/src/builtin/modules/number-theory/sequences/deficient.d.ts +2 -0
  734. package/dist/src/builtin/modules/number-theory/sequences/factorial.d.ts +1 -0
  735. package/dist/src/builtin/modules/number-theory/sequences/fibonacci.d.ts +1 -0
  736. package/dist/src/builtin/modules/number-theory/sequences/geometric.d.ts +2 -0
  737. package/dist/src/builtin/modules/number-theory/sequences/golomb.d.ts +2 -0
  738. package/dist/src/builtin/modules/number-theory/sequences/happy.d.ts +2 -0
  739. package/dist/src/builtin/modules/number-theory/sequences/index.d.ts +27 -0
  740. package/dist/src/builtin/modules/number-theory/sequences/juggler.d.ts +2 -0
  741. package/dist/src/builtin/modules/number-theory/sequences/lookAndSay.d.ts +2 -0
  742. package/dist/src/builtin/modules/number-theory/sequences/lucas.d.ts +1 -0
  743. package/dist/src/builtin/modules/number-theory/sequences/lucky.d.ts +2 -0
  744. package/dist/src/builtin/modules/number-theory/sequences/mersenne.d.ts +1 -0
  745. package/dist/src/builtin/modules/number-theory/sequences/padovan.d.ts +2 -0
  746. package/dist/src/builtin/modules/number-theory/sequences/partition.d.ts +1 -0
  747. package/dist/src/builtin/modules/number-theory/sequences/pell.d.ts +1 -0
  748. package/dist/src/builtin/modules/number-theory/sequences/perfect.d.ts +1 -0
  749. package/dist/src/builtin/modules/number-theory/sequences/perfectCube.d.ts +2 -0
  750. package/dist/src/builtin/modules/number-theory/sequences/perfectPower.d.ts +10 -0
  751. package/dist/src/builtin/modules/number-theory/sequences/perfectSquare.d.ts +2 -0
  752. package/dist/src/builtin/modules/number-theory/sequences/poligonal.d.ts +2 -0
  753. package/dist/src/builtin/modules/number-theory/sequences/prime.d.ts +3 -0
  754. package/dist/src/builtin/modules/number-theory/sequences/recaman.d.ts +9 -0
  755. package/dist/src/builtin/modules/number-theory/sequences/sylvester.d.ts +1 -0
  756. package/dist/src/builtin/modules/number-theory/sequences/thueMorse.d.ts +2 -0
  757. package/dist/src/builtin/modules/number-theory/sequences/tribonacci.d.ts +1 -0
  758. package/dist/src/builtin/modules/random/docs.d.ts +2 -0
  759. package/dist/src/builtin/modules/random/index.d.ts +2 -0
  760. package/dist/src/builtin/modules/sequence/index.d.ts +2 -0
  761. package/dist/src/builtin/modules/string/index.d.ts +2 -0
  762. package/dist/src/builtin/modules/vector/bincount.d.ts +9 -0
  763. package/dist/src/builtin/modules/vector/calcMad.d.ts +1 -0
  764. package/dist/src/builtin/modules/vector/calcMean.d.ts +1 -0
  765. package/dist/src/builtin/modules/vector/calcMedad.d.ts +1 -0
  766. package/dist/src/builtin/modules/vector/calcMedian.d.ts +1 -0
  767. package/dist/src/builtin/modules/vector/calcStdDev.d.ts +2 -0
  768. package/dist/src/builtin/modules/vector/calcVariance.d.ts +2 -0
  769. package/dist/src/builtin/modules/vector/docs.d.ts +2 -0
  770. package/dist/src/builtin/modules/vector/entropy.d.ts +8 -0
  771. package/dist/src/builtin/modules/vector/histogram.d.ts +9 -0
  772. package/dist/src/builtin/modules/vector/index.d.ts +2 -0
  773. package/dist/src/builtin/modules/vector/mode.d.ts +6 -0
  774. package/dist/src/builtin/modules/vector/outliers.d.ts +7 -0
  775. package/dist/src/builtin/modules/vector/percentile.d.ts +7 -0
  776. package/dist/src/builtin/modules/vector/quartiles.d.ts +1 -0
  777. package/dist/src/builtin/modules/vector/reductionFunctions/entropy.d.ts +2 -0
  778. package/dist/src/builtin/modules/vector/reductionFunctions/giniCoefficient.d.ts +2 -0
  779. package/dist/src/builtin/modules/vector/reductionFunctions/index.d.ts +13 -0
  780. package/dist/src/builtin/modules/vector/reductionFunctions/iqr.d.ts +2 -0
  781. package/dist/src/builtin/modules/vector/reductionFunctions/kurtosis.d.ts +5 -0
  782. package/dist/src/builtin/modules/vector/reductionFunctions/mad.d.ts +2 -0
  783. package/dist/src/builtin/modules/vector/reductionFunctions/mean.d.ts +4 -0
  784. package/dist/src/builtin/modules/vector/reductionFunctions/medad.d.ts +2 -0
  785. package/dist/src/builtin/modules/vector/reductionFunctions/median.d.ts +2 -0
  786. package/dist/src/builtin/modules/vector/reductionFunctions/prod.d.ts +2 -0
  787. package/dist/src/builtin/modules/vector/reductionFunctions/rms.d.ts +2 -0
  788. package/dist/src/builtin/modules/vector/reductionFunctions/skewness.d.ts +3 -0
  789. package/dist/src/builtin/modules/vector/reductionFunctions/span.d.ts +2 -0
  790. package/dist/src/builtin/modules/vector/reductionFunctions/standardDeviation.d.ts +3 -0
  791. package/dist/src/builtin/modules/vector/reductionFunctions/sum.d.ts +2 -0
  792. package/dist/src/builtin/modules/vector/reductionFunctions/variance.d.ts +3 -0
  793. package/dist/src/builtin/normalExpressions/index.d.ts +8 -0
  794. package/dist/src/builtin/specialExpressionTypes.d.ts +26 -0
  795. package/dist/src/builtin/specialExpressions/and.d.ts +6 -0
  796. package/dist/src/builtin/specialExpressions/array.d.ts +6 -0
  797. package/dist/src/builtin/specialExpressions/block.d.ts +6 -0
  798. package/dist/src/builtin/specialExpressions/cond.d.ts +6 -0
  799. package/dist/src/builtin/specialExpressions/defined.d.ts +5 -0
  800. package/dist/src/builtin/specialExpressions/effect.d.ts +5 -0
  801. package/dist/src/builtin/specialExpressions/functions.d.ts +6 -0
  802. package/dist/src/builtin/specialExpressions/if.d.ts +6 -0
  803. package/dist/src/builtin/specialExpressions/import.d.ts +6 -0
  804. package/dist/src/builtin/specialExpressions/let.d.ts +6 -0
  805. package/dist/src/builtin/specialExpressions/loop.d.ts +6 -0
  806. package/dist/src/builtin/specialExpressions/loops.d.ts +9 -0
  807. package/dist/src/builtin/specialExpressions/match.d.ts +7 -0
  808. package/dist/src/builtin/specialExpressions/object.d.ts +6 -0
  809. package/dist/src/builtin/specialExpressions/or.d.ts +6 -0
  810. package/dist/src/builtin/specialExpressions/parallel.d.ts +6 -0
  811. package/dist/src/builtin/specialExpressions/perform.d.ts +6 -0
  812. package/dist/src/builtin/specialExpressions/qq.d.ts +6 -0
  813. package/dist/src/builtin/specialExpressions/race.d.ts +6 -0
  814. package/dist/src/builtin/specialExpressions/recur.d.ts +5 -0
  815. package/dist/src/builtin/specialExpressions/throw.d.ts +5 -0
  816. package/dist/src/builtin/specialExpressions/try.d.ts +7 -0
  817. package/dist/src/builtin/specialExpressions/unless.d.ts +6 -0
  818. package/dist/src/builtin/utils.d.ts +6 -0
  819. package/dist/src/bundler/index.d.ts +9 -0
  820. package/dist/src/bundler/interface.d.ts +15 -0
  821. package/dist/src/bundler.d.ts +3 -0
  822. package/dist/src/constants/constants.d.ts +19 -0
  823. package/dist/src/debug.d.ts +115 -0
  824. package/dist/src/effects.d.ts +106 -0
  825. package/dist/src/errors.d.ts +24 -0
  826. package/dist/src/evaluator/ContextStack.d.ts +65 -0
  827. package/dist/src/evaluator/effectRef.d.ts +27 -0
  828. package/dist/src/evaluator/effectTypes.d.ts +79 -0
  829. package/dist/src/evaluator/frames.d.ts +539 -0
  830. package/dist/src/evaluator/interface.d.ts +14 -0
  831. package/dist/src/evaluator/serialization.d.ts +45 -0
  832. package/dist/src/evaluator/standardEffects.d.ts +35 -0
  833. package/dist/src/evaluator/step.d.ts +159 -0
  834. package/dist/src/evaluator/suspension.d.ts +53 -0
  835. package/dist/src/evaluator/trampoline.d.ts +119 -0
  836. package/dist/src/full.d.ts +17 -0
  837. package/dist/src/getUndefinedSymbols/index.d.ts +7 -0
  838. package/dist/src/index.d.ts +18 -0
  839. package/dist/src/initReferenceData.d.ts +1 -0
  840. package/dist/src/interface.d.ts +7 -0
  841. package/dist/src/modules/assertion.d.ts +2 -0
  842. package/dist/src/modules/bitwise.d.ts +2 -0
  843. package/dist/src/modules/collection.d.ts +2 -0
  844. package/dist/src/modules/convert.d.ts +2 -0
  845. package/dist/src/modules/functional.d.ts +2 -0
  846. package/dist/src/modules/grid.d.ts +2 -0
  847. package/dist/src/modules/linear-algebra.d.ts +2 -0
  848. package/dist/src/modules/math.d.ts +2 -0
  849. package/dist/src/modules/matrix.d.ts +2 -0
  850. package/dist/src/modules/number-theory.d.ts +2 -0
  851. package/dist/src/modules/random.d.ts +2 -0
  852. package/dist/src/modules/sequence.d.ts +2 -0
  853. package/dist/src/modules/string.d.ts +2 -0
  854. package/dist/src/modules/vector.d.ts +2 -0
  855. package/dist/src/parser/ParserContext.d.ts +20 -0
  856. package/dist/src/parser/getPrecedence.d.ts +3 -0
  857. package/dist/src/parser/helpers.d.ts +19 -0
  858. package/dist/src/parser/index.d.ts +5 -0
  859. package/dist/src/parser/subParsers/parseArray.d.ts +3 -0
  860. package/dist/src/parser/subParsers/parseBindingTarget.d.ts +8 -0
  861. package/dist/src/parser/subParsers/parseCond.d.ts +4 -0
  862. package/dist/src/parser/subParsers/parseDo.d.ts +3 -0
  863. package/dist/src/parser/subParsers/parseExpression.d.ts +5 -0
  864. package/dist/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  865. package/dist/src/parser/subParsers/parseFunction.d.ts +4 -0
  866. package/dist/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  867. package/dist/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  868. package/dist/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  869. package/dist/src/parser/subParsers/parseLet.d.ts +4 -0
  870. package/dist/src/parser/subParsers/parseLoop.d.ts +4 -0
  871. package/dist/src/parser/subParsers/parseMatch.d.ts +4 -0
  872. package/dist/src/parser/subParsers/parseNumber.d.ts +3 -0
  873. package/dist/src/parser/subParsers/parseObject.d.ts +3 -0
  874. package/dist/src/parser/subParsers/parseOperand.d.ts +3 -0
  875. package/dist/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  876. package/dist/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  877. package/dist/src/parser/subParsers/parseString.d.ts +4 -0
  878. package/dist/src/parser/subParsers/parseSymbol.d.ts +3 -0
  879. package/dist/src/parser/subParsers/parseTry.d.ts +4 -0
  880. package/dist/src/parser/types.d.ts +129 -0
  881. package/dist/src/symbolPatterns.d.ts +2 -0
  882. package/dist/src/testFramework/index.d.ts +15 -0
  883. package/dist/src/tokenizer/minifyTokenStream.d.ts +4 -0
  884. package/dist/src/tokenizer/operators.d.ts +12 -0
  885. package/dist/src/tokenizer/reservedNames.d.ts +66 -0
  886. package/dist/src/tokenizer/token.d.ts +84 -0
  887. package/dist/src/tokenizer/tokenize.d.ts +8 -0
  888. package/dist/src/tokenizer/tokenizers.d.ts +14 -0
  889. package/dist/src/transformer/index.d.ts +2 -0
  890. package/dist/src/typeGuards/annotatedArrays.d.ts +16 -0
  891. package/dist/src/typeGuards/array.d.ts +9 -0
  892. package/dist/src/typeGuards/astNode.d.ts +19 -0
  893. package/dist/src/typeGuards/dvala.d.ts +26 -0
  894. package/dist/src/typeGuards/dvalaFunction.d.ts +12 -0
  895. package/dist/src/typeGuards/index.d.ts +7 -0
  896. package/dist/src/typeGuards/number.d.ts +66 -0
  897. package/dist/src/typeGuards/string.d.ts +15 -0
  898. package/dist/src/untokenizer/index.d.ts +2 -0
  899. package/dist/src/utils/arity.d.ts +10 -0
  900. package/dist/src/utils/debug/debugTools.d.ts +1 -0
  901. package/dist/src/utils/debug/getCodeMarker.d.ts +2 -0
  902. package/dist/src/utils/debug/getSourceCodeInfo.d.ts +2 -0
  903. package/dist/src/utils/docString/generateDocString.d.ts +2 -0
  904. package/dist/src/utils/getAssertionError.d.ts +3 -0
  905. package/dist/src/utils/index.d.ts +14 -0
  906. package/dist/src/utils/maybePromise.d.ts +54 -0
  907. package/dist/src/utils/symbols.d.ts +3 -0
  908. package/dist/testFramework.esm.js +2 -0
  909. package/dist/testFramework.esm.js.map +1 -0
  910. package/dist/testFramework.js +2 -0
  911. package/dist/testFramework.js.map +1 -0
  912. package/package.json +144 -16
  913. package/dist/index.d.ts +0 -2
  914. package/dist/index.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,7 +1,1616 @@
1
- # dvala
1
+ # Dvala
2
2
 
3
- Here is where you soon will find Dvala, a suspendable virtual machine — pause anywhere, resume anytime, debug backward through time.
3
+ A suspendable virtual machine — pause anywhere, resume anytime, debug backward through time.
4
4
 
5
- ## License
5
+ Try it in the [Dvala Playground](https://mojir.github.io/dvala/).
6
6
 
7
- MIT
7
+ ## Features
8
+
9
+ - **Algebraic effects** - `perform` is the only IO boundary; host-side handlers in JavaScript decide whether to resume synchronously, resolve asynchronously, or suspend the VM entirely
10
+ - **Serializable continuations** - when a handler suspends, the entire execution state freezes to a JSON blob; store it anywhere and resume across processes, machines, and time
11
+ - **Time-travel debugging** - step backward through any execution, jump to any captured state, and explore alternate timelines by re-running from any point with a different value
12
+ - **Parallel & race** - run effects concurrently with `parallel` (waits for all) and `race` (takes the first to complete, cancelling the rest)
13
+ - **Pure functional** - immutable data and no side effects; variables cannot be changed, ensuring predictable behavior
14
+ - **Expression-based syntax** - everything returns a value; no statements, making the language composable and consistent
15
+ - **Sandboxed** - no file system, network, or global access unless the host explicitly provides it — safe for user-supplied code
16
+ - **Algebraic notation** - all operators can be used as functions, and binary functions can be used as operators
17
+ - **First-class functions** - functions are values that can be passed, returned, and composed freely
18
+ - **Comprehensive standard library** - rich set of functions for collections, math, strings, regular expressions, and more
19
+ - **JavaScript interoperability** - JavaScript values and functions can be exposed directly in Dvala
20
+ - **Fully serializable** - every Dvala value, including functions and regexps, is JSON-serializable
21
+ - **Structural equality** - objects are compared by value, not by reference
22
+ - **Destructuring** - extract values from complex data structures with ease
23
+
24
+ ## Installation
25
+
26
+ ### As a Library
27
+
28
+ ```bash
29
+ npm install @mojir/dvala
30
+ ```
31
+
32
+ ### CLI Tool
33
+
34
+ Install globally to use the Dvala command-line interface:
35
+
36
+ ```bash
37
+ npm install --global @mojir/dvala
38
+ ```
39
+
40
+ #### CLI Usage
41
+
42
+ ```bash
43
+ # Start an interactive REPL session
44
+ $ dvala
45
+
46
+ # Evaluate Dvala code directly
47
+ $ dvala eval "5 + 3"
48
+ $ dvala eval "[1, 2, 3, 4] filter odd? map inc"
49
+
50
+ # Run a Dvala file
51
+ $ dvala run script.dvala
52
+
53
+ # Bundle a multi-file project into a single .json file
54
+ $ dvala bundle main.dvala -o bundle.dvala.json
55
+
56
+ # Run a bundle
57
+ $ dvala run-bundle bundle.dvala.json
58
+
59
+ # Run tests
60
+ $ dvala test tests.test.dvala
61
+
62
+ # Get help
63
+ $ dvala --help
64
+ ```
65
+
66
+ **Subcommands:**
67
+
68
+ | Subcommand | Description |
69
+ |---|---|
70
+ | `run <file>` | Run a `.dvala` source file |
71
+ | `run-bundle <file>` | Run a `.json` bundle (with validation) |
72
+ | `eval <expression>` | Evaluate a Dvala expression |
73
+ | `bundle <entry>` | Bundle a multi-file project into a single JSON file |
74
+ | `test <file>` | Run a `.test.dvala` test file |
75
+ | `repl` | Start an interactive REPL (default when no subcommand) |
76
+
77
+ **Common options:**
78
+
79
+ | Option | Applies to | Description |
80
+ |---|---|---|
81
+ | `-c, --context=<json>` | `run`, `run-bundle`, `eval`, `repl` | Provide context as a JSON string |
82
+ | `-C, --context-file=<file>` | `run`, `run-bundle`, `eval`, `repl` | Provide context from a `.json` file |
83
+ | `-s, --silent` | `run`, `run-bundle`, `eval` | Suppress printing the result |
84
+ | `-o, --output=<file>` | `bundle` | Write bundle to file (default: stdout) |
85
+ | `--pattern=<regex>` | `test` | Only run tests matching pattern |
86
+ | `-l, --load=<file>` | `repl` | Preload a `.dvala` file into the REPL |
87
+
88
+ The REPL provides an interactive environment where you can experiment with Dvala code, test functions, and explore the language features in real-time.
89
+
90
+ ## Quick Start
91
+
92
+ Here's a simple example to get you started:
93
+
94
+ ```dvala
95
+ // Defining a function - note that everything returns a value
96
+ let square = x -> x * x;
97
+
98
+ // Using the function
99
+ let result = square(5);
100
+ // => 25
101
+
102
+ // Using function as an operator
103
+ let squares = [1, 2, 3, 4, 5] map square;
104
+ // => [1, 4, 9, 16, 25]
105
+
106
+ // Using operator as a function
107
+ +(1, 2, 3, 4, 5);
108
+ // => 15
109
+ ```
110
+
111
+ ## Expression-Based Language
112
+
113
+ In Dvala, everything is an expression that evaluates to a value. This means:
114
+
115
+ ```dvala
116
+ // Conditional expressions always return a value
117
+ let a = 10;
118
+ let result = if a > 0 then "positive" else "non-positive" end;
119
+
120
+ // Function definitions are expressions that return the function
121
+ let add = (a, b) -> a + b;
122
+
123
+ // Even variable bindings return the bound value
124
+ let x = let y = 5; // x becomes 5
125
+
126
+ // Blocks are expressions - they return the last expression's value
127
+ let value = do
128
+ let temp = 42;
129
+ temp * 2 + 1 // => 85
130
+ end;
131
+ ```
132
+ This expression-based design makes Dvala highly composable and eliminates the statement/expression distinction found in many other languages.
133
+
134
+ ## Basic Syntax
135
+
136
+ ### Data Types
137
+
138
+ ```dvala
139
+ // Numbers
140
+ 42; // integer
141
+ 3.14; // float
142
+ 0xFFFF; // hexadecimal
143
+ 0b1100; // binary
144
+ 0o77; // octal
145
+ -2.3e-2; // scientific notation
146
+
147
+ // Strings
148
+ "Hello, world!";
149
+ "String with \"escapes\"";
150
+
151
+ // Booleans
152
+ true;
153
+ false;
154
+
155
+ // Functions
156
+ (x -> x * 2); // Anonymous function
157
+ let add = (a, b) -> a + b; // Named function
158
+
159
+ // Regular expressions
160
+ #"[a-z]+";
161
+ #"\d{3}-\d{3}-\d{4}";
162
+
163
+ // null
164
+ null;
165
+ ```
166
+
167
+ #### Arrays (General Collections)
168
+
169
+ Arrays are the primary collection type in Dvala, supporting mixed data types:
170
+
171
+ ```dvala
172
+ // Basic arrays
173
+ [1, 2, 3, 4, 5];
174
+ ["apple", "banana", "orange"];
175
+ [true, 42, "mixed types"];
176
+
177
+ // Nested arrays
178
+ [[1, 2], [3, 4], [5, 6]];
179
+ [{name: "Alice"}, {name: "Bob"}];
180
+
181
+ // Array operations
182
+ let numbers = [1, 2, 3, 4, 5];
183
+ numbers[0]; // => 1 (indexing)
184
+ count(numbers); // => 5 (length)
185
+ first(numbers); // => 1
186
+ last(numbers); // => 5
187
+ rest(numbers); // => [2, 3, 4, 5]
188
+
189
+ // Functional array operations
190
+ numbers map -> $ * 2; // => [2, 4, 6, 8, 10]
191
+ numbers filter odd?; // => [1, 3, 5]
192
+ ```
193
+
194
+ #### Vectors (Number Arrays)
195
+
196
+ A vector is simply a non-empty array containing only numbers. The `vec` module provides mathematical operations specifically for these number arrays:
197
+
198
+ ```dvala
199
+ // Import vector and linear algebra modules
200
+ let vec = import(vector);
201
+ let lin = import(linear-algebra);
202
+
203
+ // Vectors are just number arrays
204
+ [1, 2, 3, 4, 5]; // This is a vector
205
+ [3.14, 2.71, 1.41]; // This is also a vector
206
+ [1, "hello", 3]; // This is NOT a vector (mixed types)
207
+ []; // This is NOT a vector (empty)
208
+
209
+ // Vector creation functions
210
+ vec.linspace(0, 10, 5); // => [0, 2.5, 5, 7.5, 10]
211
+ repeat(0, 5); // => [0, 0, 0, 0, 0]
212
+ repeat(1, 3); // => [1, 1, 1]
213
+ repeat(3.14, 4); // => [3.14, 3.14, 3.14, 3.14]
214
+
215
+ // Vector mathematical operations (use lin module for vector math)
216
+ lin.dot([1, 2, 3], [4, 5, 6]); // => 32 (dot product)
217
+ lin.euclidean-norm([3, 4]); // => 5.0 (Euclidean norm/magnitude)
218
+ lin.normalize-l2([3, 4]); // => [0.6, 0.8] (unit vector)
219
+ lin.euclidean-distance([0, 0], [3, 4]); // => 5.0 (Euclidean distance)
220
+
221
+ // Vector statistical operations (sum, mean, median, prod are core built-ins)
222
+ sum([1, 2, 3, 4]); // => 10
223
+ mean([1, 2, 3, 4]); // => 2.5
224
+ median([1, 2, 3, 4, 5]); // => 3
225
+ vec.stdev([1, 2, 3, 4]); // => 1.29... (standard deviation)
226
+ vec.variance([1, 2, 3, 4]); // => 1.67... (variance)
227
+
228
+ // Vector analysis (min and max are core built-ins)
229
+ min([3, 1, 4, 1, 5]); // => 1
230
+ max([3, 1, 4, 1, 5]); // => 5
231
+ vec.min-index([3, 1, 4]); // => 1 (index of minimum)
232
+ vec.max-index([3, 1, 4]); // => 2 (index of maximum)
233
+
234
+ // Cumulative operations
235
+ vec.cumsum([1, 2, 3, 4]); // => [1, 3, 6, 10]
236
+ vec.cumprod([1, 2, 3, 4]); // => [1, 2, 6, 24]
237
+
238
+ // Vector predicates
239
+ vec.increasing?([1, 1, 2, 3, 4]); // => true
240
+ vec.strictly-increasing?([1, 1, 2, 3, 4]); // => false
241
+
242
+ // Structural equality works with all vectors
243
+ [1, 2, 3] == [1, 2, 3]; // => true
244
+ [1, 2] == [1, 2, 3]; // => false
245
+ ```
246
+
247
+ #### Matrices (2D Vectors)
248
+
249
+ A matrix is a 2D array where each row is a vector (non-empty array of numbers) and all rows have the same length. The `mat` module provides linear algebra operations for these structures:
250
+
251
+ ```dvala
252
+ // Import matrix module
253
+ let mat = import(matrix);
254
+
255
+ // Matrices are 2D number arrays with consistent row lengths
256
+ [[1, 2], [3, 4]]; // This is a 2x2 matrix
257
+ [[1, 2, 3], [4, 5, 6]]; // This is a 2x3 matrix
258
+ [[1, 2], [3, 4, 5]]; // This is NOT a matrix (inconsistent row length)
259
+ [[1, "hello"], [3, 4]]; // This is NOT a matrix (contains non-numbers)
260
+ [[]]; // This is NOT a matrix (contains empty row)
261
+
262
+ // Basic matrix operations
263
+ let matrixA = [[1, 2], [3, 4]];
264
+ let matrixB = [[5, 6], [7, 8]];
265
+
266
+ mat.mul(matrixA, matrixB); // => [[19, 22], [43, 50]] (multiplication)
267
+ mat.det(matrixA); // => -2 (determinant)
268
+ mat.inv(matrixA); // => [[-2, 1], [1.5, -0.5]] (inverse)
269
+ mat.trace(matrixA); // => 5 (trace - sum of diagonal)
270
+
271
+ // Matrix construction
272
+ mat.hilbert(3); // => 3x3 Hilbert matrix
273
+ mat.vandermonde([1, 2, 3]); // => Vandermonde matrix from vector
274
+ mat.band(4, 1, 1); // => 4x4 band matrix
275
+
276
+ // Matrix properties and predicates
277
+ mat.symmetric?([[1, 2], [2, 1]]); // => true
278
+ mat.invertible?([[1, 2], [3, 4]]); // => true
279
+ mat.square?([[1, 2], [3, 4]]); // => true
280
+ mat.diagonal?([[1, 0], [0, 2]]); // => true
281
+ mat.identity?([[1, 0], [0, 1]]); // => true
282
+
283
+ // Advanced matrix operations
284
+ mat.adj(matrixA); // => [[4, -2], [-3, 1]] (adjugate)
285
+ mat.cofactor(matrixA); // => cofactor matrix
286
+ mat.minor(matrixA, 0, 1); // => minor by removing row 0, col 1
287
+ mat.frobenius-norm(matrixA); // => Frobenius norm
288
+ mat.one-norm(matrixA); // => 1-norm (max column sum)
289
+ mat.inf-norm(matrixA); // => infinity norm (max row sum)
290
+ mat.max-norm(matrixA); // => max norm (largest absolute element)
291
+
292
+ // Matrix analysis
293
+ mat.rank(matrixA); // => matrix rank
294
+ ```
295
+
296
+ #### Objects (Maps)
297
+
298
+ Objects store key-value pairs:
299
+
300
+ ```dvala
301
+ // Object creation
302
+ { name: "John", age: 30 };
303
+ { "key with spaces": "value", count: 42 };
304
+
305
+ // Nested objects
306
+ {
307
+ person: { name: "Alice", age: 25 },
308
+ scores: [95, 87, 92],
309
+ active: true
310
+ };
311
+
312
+ // Object operations
313
+ let user = { name: "Bob", age: 30, city: "NYC" };
314
+ get(user, "name"); // => "Bob"
315
+ assoc(user, "age", 31); // => new object with age updated
316
+ dissoc(user, "city"); // => new object without city
317
+ keys(user); // => ["name", "age", "city"]
318
+ vals(user); // => ["Bob", 30, "NYC"]
319
+ ```
320
+
321
+ #### Type Predicates
322
+
323
+ Dvala provides predicate functions to check data types at runtime:
324
+
325
+ ```dvala
326
+ // Basic type predicates
327
+ number?(42); // => true
328
+ string?("hello"); // => true
329
+ boolean?(true); // => true
330
+ function?(x -> x * 2); // => true
331
+ regexp?(#"[a-z]+"); // => true
332
+ array?([1, 2, 3]); // => true
333
+ object?({name: "Alice"}); // => true
334
+ null?(null); // => true
335
+
336
+ // Specialized array predicates
337
+ vector?([1, 2, 3]); // => true (non-empty number array)
338
+ vector?([1, "hello", 3]); // => false (mixed types)
339
+ vector?([]); // => false (empty)
340
+
341
+ matrix?([[1, 2], [3, 4]]); // => true (2D number array, consistent rows)
342
+ matrix?([[1, 2], [3]]); // => false (inconsistent row lengths)
343
+ matrix?([[]]); // => false (contains empty row)
344
+
345
+ // Collection predicates
346
+ sequence?([1, 2, 3]); // => true (sequences: strings and arrays)
347
+ sequence?("hello"); // => true
348
+ sequence?({a: 1}); // => false
349
+
350
+ collection?([1, 2, 3]); // => true (collections: strings, arrays, objects)
351
+ collection?("hello"); // => true
352
+ collection?({a: 1}); // => true
353
+ collection?(42); // => false
354
+ ```
355
+
356
+ #### Type Hierarchy
357
+
358
+ The type predicates follow a logical hierarchy:
359
+
360
+ ```dvala
361
+ // If something is a matrix, it's also a vector and an array
362
+ let mat = [[1, 2], [3, 4]];
363
+ matrix?(mat); // => true
364
+ vector?(mat); // => true (matrix is a special vector)
365
+ array?(mat); // => true (vector is a special array)
366
+
367
+ // If something is a vector, it's also an array
368
+ let vec = [1, 2, 3];
369
+ vector?(vec); // => true
370
+ array?(vec); // => true
371
+
372
+ // But not all arrays are vectors
373
+ let arr = [1, "hello", 3];
374
+ array?(arr); // => true
375
+ vector?(arr); // => false (contains non-numbers)
376
+ ```
377
+
378
+ Each data type is immutable by design - operations return new values rather than modifying existing ones, ensuring predictable behavior and easier reasoning about code.
379
+
380
+ ### Mathematical Constants
381
+
382
+ Dvala provides predefined mathematical constants:
383
+
384
+ ```dvala
385
+ PI; // => 3.141592653589793
386
+ π; // => 3.141592653589793 (Unicode alternative)
387
+ E; // => 2.718281828459045 (Euler's number)
388
+ ε; // => 2.718281828459045 (Unicode alternative)
389
+ PHI; // => 1.618033988749895 (Golden ratio)
390
+ φ; // => 1.618033988749895 (Unicode alternative)
391
+
392
+ // Infinity values
393
+ POSITIVE_INFINITY; // => Infinity
394
+ ∞; // => Infinity (Unicode alternative)
395
+ NEGATIVE_INFINITY; // => -Infinity
396
+
397
+ // Integer and float limits
398
+ MAX_SAFE_INTEGER; // => 9007199254740991
399
+ MIN_SAFE_INTEGER; // => -9007199254740991
400
+ MAX_VALUE; // => 1.7976931348623157e+308
401
+ MIN_VALUE; // => 5e-324
402
+ ```
403
+
404
+ ## Special Expressions
405
+
406
+ ### Variable Binding
407
+
408
+ #### Let
409
+
410
+ ```dvala
411
+ // Simple binding
412
+ let x = 10;
413
+ // => 10
414
+
415
+ // Variables are immutable
416
+ // let x = 20; // Error: x is already defined
417
+
418
+ // Shadowing in inner scopes
419
+ let y = do
420
+ let x = 20;
421
+ x
422
+ end;
423
+ // => 20, outer x is still 10
424
+ ```
425
+
426
+ #### Destructuring
427
+
428
+ ##### Basic Object Destructuring
429
+
430
+ ```dvala
431
+ // Object destructuring
432
+ let { name, age } = { name: "John", age: 30 };
433
+ // name => "John", age => 30
434
+ ```
435
+
436
+ ```dvala
437
+ // With default values
438
+ let { name = "Unknown", age = 0 } = { name: "John" };
439
+ // name => "John", age => 0
440
+ ```
441
+
442
+ ```dvala
443
+ // Renaming with 'as'
444
+ let { name as userName } = { name: "Dave" };
445
+ // userName => "Dave"
446
+ ```
447
+
448
+ ```dvala
449
+ // Multiple renames
450
+ let { firstName as name, age as years } = { firstName: "Eve", age: 28 };
451
+ // name => "Eve", years => 28
452
+ ```
453
+
454
+ ##### Advanced Destructuring Patterns
455
+
456
+ ```dvala
457
+ // Complex nested destructuring with defaults and renaming
458
+ let {
459
+ name as userName = "Guest",
460
+ profile: {
461
+ age = 0,
462
+ contact: { email as userEmail = "none" }
463
+ },
464
+ settings = { theme: "light" },
465
+ scores as userScores = [],
466
+ ...others
467
+ } = { name: "Sam", profile: { contact: {} } };
468
+ // userName => "Sam", age => 0, userEmail => "none", etc.
469
+ ```
470
+
471
+ ```dvala
472
+ // Combining array and object destructuring
473
+ let [{ name }, { age }] = [{ name: "Tina" }, { age: 33 }];
474
+ // name => "Tina", age => 33
475
+ ```
476
+
477
+ ```dvala
478
+ // Object with array property destructuring
479
+ let { name, scores: [one, two] } = { name: "Uma", scores: [85, 92] };
480
+ // name => "Uma", one => 85, two => 92
481
+ ```
482
+
483
+ ##### Array Destructuring
484
+
485
+ ```dvala
486
+ // Array destructuring
487
+ let [, , a, b] = [1, 2, 3, 4];
488
+ // a => 3, b => 4
489
+ ```
490
+
491
+ ```dvala
492
+ // Array destructuring with defaults
493
+ let [one, two = 2] = [1];
494
+ // one => 1, two => 2
495
+ ```
496
+
497
+ ```dvala
498
+ // Skipping elements
499
+ let [x, , z] = [1, 2, 3];
500
+ // x => 1, z => 3
501
+ ```
502
+
503
+ ##### Rest Patterns
504
+
505
+ ```dvala
506
+ // Array rest pattern
507
+ let [head, ...tail] = [1, 2, 3, 4];
508
+ // head => 1, tail => [2, 3, 4]
509
+ ```
510
+
511
+ ```dvala
512
+ // Object rest pattern
513
+ let { name, ...otherProps } = { name: "John", age: 30, city: "NYC" };
514
+ // name => "John", otherProps => { age: 30, city: "NYC" }
515
+ ```
516
+
517
+ ```dvala
518
+ // Empty rest patterns
519
+ let [only, ...empty] = [1];
520
+ // only => 1, empty => []
521
+ ```
522
+
523
+ ##### Function Parameter Destructuring
524
+
525
+ ```dvala
526
+ // Basic parameter destructuring
527
+ let greet = ({ name }) -> "Hello, " ++ name;
528
+ greet({ name: "Pat" });
529
+ // => "Hello, Pat"
530
+ ```
531
+
532
+ ```dvala
533
+ // With defaults in parameters
534
+ let greet2 = ({ name = "friend" }) -> "Hello, " ++ name;
535
+ greet2({});
536
+ // => "Hello, friend"
537
+ ```
538
+
539
+ ```dvala
540
+ // Nested parameter destructuring
541
+ let processUser = ({ profile: { name, age }}) ->
542
+ name ++ " is " ++ str(age);
543
+ processUser({ profile: { name: "Quinn", age: 29 }});
544
+ // => "Quinn is 29"
545
+ ```
546
+
547
+ ```dvala
548
+ // Array parameter destructuring
549
+ let processCoords = ([x, y]) -> x + y;
550
+ processCoords([3, 4]);
551
+ // => 7
552
+ ```
553
+
554
+ ### Functions
555
+
556
+ #### Lambda Functions
557
+
558
+ ```dvala
559
+ // Multi-parameter lambda
560
+ let add = (a, b) -> a + b;
561
+
562
+ // Single parameter (parentheses optional)
563
+ let square = x -> x * x;
564
+
565
+ // No parameters
566
+ let constant = () -> 42;
567
+
568
+ // Positional arguments
569
+ let add-v2 = -> $1 + $2;
570
+
571
+ // Single positional argument
572
+ let square-v2 = -> $ * $;
573
+
574
+ // Self-reference for recursion
575
+ let factorial = n ->
576
+ if n <= 1 then
577
+ 1
578
+ else
579
+ n * self(n - 1)
580
+ end;
581
+ ```
582
+
583
+ ### Control Flow
584
+
585
+ #### If/Unless
586
+
587
+ ```dvala
588
+ let x = 15; // Fixed value for compilation
589
+
590
+ if x > 10 then
591
+ "large"
592
+ else
593
+ "small"
594
+ end;
595
+ // => "large"
596
+
597
+ // If without else returns null
598
+ if false then "never" end;
599
+ // => null
600
+
601
+ // Unless (inverted if)
602
+ let y = 8;
603
+ unless y > 10 then
604
+ "small"
605
+ else
606
+ "large"
607
+ end;
608
+ // => "small"
609
+ ```
610
+
611
+ #### Cond
612
+
613
+ ```dvala
614
+ let x = 12;
615
+
616
+ // Multi-branch conditional
617
+ cond
618
+ case x < 5 then "small"
619
+ case x < 10 then "medium"
620
+ case x < 15 then "large"
621
+ case true then "extra large" // default case
622
+ end;
623
+ // => "large"
624
+
625
+ // Cond with complex conditions
626
+ let urgent = true;
627
+ let important = false;
628
+ let priority = cond
629
+ case urgent && important then "critical"
630
+ case urgent then "high"
631
+ case important then "medium"
632
+ case true then "low"
633
+ end;
634
+ // => "high"
635
+ ```
636
+
637
+ #### Match
638
+
639
+ ```dvala
640
+ let x = 1;
641
+
642
+ // Match on value
643
+ match x
644
+ case 0 then "zero"
645
+ case 1 then "one"
646
+ case 2 then "two"
647
+ end;
648
+ // => "one"
649
+
650
+ // Match with multiple cases
651
+ let userInput = "help";
652
+ let exit = () -> "exiting";
653
+ let showHelp = () -> "showing help";
654
+ let saveData = () -> "saving data";
655
+
656
+ match userInput
657
+ case "quit" then exit()
658
+ case "help" then showHelp()
659
+ case "save" then saveData()
660
+ end;
661
+ // => "showing help"
662
+ ```
663
+
664
+ ### Loops and Iteration
665
+
666
+ #### For Comprehensions
667
+
668
+ ```dvala
669
+ // Simple iteration
670
+ for (x in [1, 2, 3, 4]) -> x * 2;
671
+ // => [2, 4, 6, 8]
672
+
673
+ // With filtering (when clause)
674
+ for (x in [1, 2, 3, 4] when odd?(x)) -> x * 2;
675
+ // => [2, 6]
676
+
677
+ // With early termination (while clause)
678
+ for (x in [1, 2, 3, 4] while x < 3) -> x * 2;
679
+ // => [2, 4]
680
+
681
+ // With let bindings for intermediate calculations
682
+ for (x in [1, 2, 3] let doubled = x * 2) -> doubled + 1;
683
+ // => [3, 5, 7]
684
+
685
+ // Multiple iterators
686
+ for (x in [1, 2], y in [10, 20]) -> x + y;
687
+ // => [11, 21, 12, 22]
688
+
689
+ // Complex for comprehensions with multiple conditions
690
+ for (
691
+ i in range(10)
692
+ let ii = i ^ 2
693
+ while ii < 40
694
+ when ii % 3 == 0,
695
+ j in range(10)
696
+ when j % 2 == 1
697
+ ) -> ii + j;
698
+
699
+ // Using previous bindings in subsequent iterations
700
+ for (x in [1, 2], y in [x, 2 * x]) -> x * y;
701
+ // => [1, 2, 4, 8]
702
+
703
+ // Object iteration
704
+ for (entry in { a: 1, b: 2 } let [key, value] = entry) -> key ++ ":" ++ str(value);
705
+ // => ["a:1", "b:2"]
706
+ ```
707
+
708
+ #### Doseq (Side Effects)
709
+
710
+ ```dvala
711
+ // For side effects only (returns null)
712
+ doseq (x in [1, 2, 3]) -> write!(x)
713
+ // Prints: 1 2 3, returns null
714
+ ```
715
+
716
+ #### Loop (Tail Recursion)
717
+
718
+ ```dvala
719
+ // Loop with recur for tail recursion
720
+ loop (n = 5, acc = 1) -> do
721
+ if zero?(n) then
722
+ acc
723
+ else
724
+ recur(n - 1, acc * n)
725
+ end
726
+ end;
727
+ // => 120 (factorial of 5)
728
+
729
+ // Complex loop with multiple variables
730
+ loop (items = [1, 2, 3, 4, 5], acc = 0, cnt = 0) -> do
731
+ if empty?(items) then
732
+ { sum: acc, average: acc / cnt }
733
+ else
734
+ recur(rest(items), acc + first(items), cnt + 1)
735
+ end
736
+ end;
737
+ ```
738
+
739
+ ### Recursion with Recur
740
+
741
+ #### Function Recursion
742
+
743
+ ```dvala
744
+ // Simple recursive function with recur
745
+ let factorial = (n) -> do
746
+ if n <= 1 then
747
+ 1
748
+ else
749
+ n * recur(n - 1)
750
+ end
751
+ end;
752
+
753
+ // Tail-recursive function
754
+ let sumToN = (n, acc = 0) -> do
755
+ if zero?(n) then
756
+ acc
757
+ else
758
+ recur(n - 1, acc + n)
759
+ end
760
+ end;
761
+ ```
762
+
763
+ ### Error Handling
764
+
765
+ #### Try/Catch
766
+
767
+ ```dvala
768
+ // Basic try/catch
769
+ let riskyOperation = () -> throw("Something went wrong");
770
+ try
771
+ riskyOperation()
772
+ catch
773
+ "Something went wrong"
774
+ end;
775
+
776
+ // With error binding
777
+ try
778
+ riskyOperation()
779
+ catch (error)
780
+ "Error: " ++ error.message
781
+ end;
782
+
783
+ // Try-catch for graceful degradation
784
+ let parseData = () -> { value: 42 };
785
+ let process = (val) -> val * 2;
786
+ try
787
+ let { value } = parseData();
788
+ process(value)
789
+ catch
790
+ "Using default value"
791
+ end;
792
+ ```
793
+
794
+ #### Throw
795
+
796
+ ```dvala
797
+ // Throwing errors
798
+ try
799
+ throw("Custom error message")
800
+ catch
801
+ "Caught an error"
802
+ end;
803
+
804
+ // Custom error messages in functions
805
+ let divide = (a, b) ->
806
+ if zero?(b) then
807
+ throw("Cannot divide by zero")
808
+ else
809
+ a / b
810
+ end;
811
+
812
+ // Conditional error throwing
813
+ let validateAge = (age) ->
814
+ cond
815
+ case age < 0 then throw("Age cannot be negative")
816
+ case age > 150 then throw("Age seems unrealistic")
817
+ case true then age
818
+ end;
819
+ ```
820
+
821
+ ### Block Expressions
822
+
823
+ ```dvala
824
+ // Block for grouping expressions
825
+ let computeX = () -> 5;
826
+ let computeY = () -> 10;
827
+ let processResult = (z) -> z * 2;
828
+
829
+ let result = do
830
+ let x = computeX();
831
+ let y = computeY();
832
+ let z = x * y;
833
+ processResult(z)
834
+ end;
835
+
836
+ // Block with side effects
837
+ let loadData = () -> [1, 2, 3];
838
+ let processData = (data) -> data map -> $ * 2;
839
+
840
+ do
841
+ write!("Starting process...");
842
+ let data = loadData();
843
+ let processed = processData(data);
844
+ write!("Process completed");
845
+ processed
846
+ end
847
+ ```
848
+
849
+ ### Array and Object Construction
850
+
851
+ #### Array Construction
852
+
853
+ ```dvala
854
+ // Array literal
855
+ [1, 2, 3, 4];
856
+
857
+ // Array function
858
+ array(1, 2, 3, 4);
859
+
860
+ // With spread
861
+ let small-set = [3, 4, 5];
862
+ [1, 2, ...small-set, 6];
863
+ // => [1, 2, 3, 4, 5, 6]
864
+ ```
865
+
866
+ #### Array Spread
867
+
868
+ ```dvala
869
+ // Spread in array literals
870
+ let combined = [1, 2, ...[3, 4, 5], 6];
871
+ // => [1, 2, 3, 4, 5, 6]
872
+
873
+ // Multiple spreads
874
+ let start = [1, 2];
875
+ let middle = [3, 4];
876
+ let stop = [5, 6];
877
+ let result = [...start, ...middle, ...stop];
878
+ ```
879
+
880
+ #### Object Construction
881
+
882
+ ```dvala
883
+ // Object literal with static keys
884
+ { name: "John", age: 30 };
885
+
886
+ // Object literal with dynamic keys using bracket notation
887
+ let keyName = "dynamic";
888
+ { [keyName]: "value", ["computed" ++ "Key"]: 42 };
889
+ // => { dynamic: "value", computedKey: 42 }
890
+
891
+ // Object function
892
+ object("name", "John", "age", 30);
893
+
894
+ // With spread
895
+ let defaults = { type: "Person", active: true };
896
+ {
897
+ ...defaults,
898
+ name: "John",
899
+ age: 30
900
+ };
901
+ // => { type: "Person", active: true, name: "John", age: 30 }
902
+
903
+ // Combining static and dynamic keys
904
+ let propName = "score";
905
+ {
906
+ id: 123,
907
+ [propName]: 95,
908
+ ["level" ++ "Number"]: 5
909
+ };
910
+ // => { id: 123, score: 95, levelNumber: 5 }
911
+ ```
912
+
913
+ #### Object Spread
914
+
915
+ ```dvala
916
+ // Object spread for merging
917
+ let person = {
918
+ name: "John",
919
+ age: 30
920
+ };
921
+
922
+ let employee = {
923
+ ...person,
924
+ id: "E123",
925
+ department: "Engineering"
926
+ };
927
+ // => { name: "John", age: 30, id: "E123", department: "Engineering" }
928
+
929
+ // Spread with override
930
+ let defaults = {
931
+ name: "Default Name",
932
+ theme: "light",
933
+ active: true
934
+ };
935
+
936
+ let updated = {
937
+ ...defaults,
938
+ name: "Custom Name" // Override defaults.name
939
+ };
940
+ ```
941
+
942
+ ### Logical Operators
943
+
944
+ #### And/Or
945
+
946
+ ```dvala
947
+ // Logical AND (short-circuit)
948
+ true && "second value"; // => "second value"
949
+ false && "never reached"; // => false
950
+
951
+ // Logical OR (short-circuit)
952
+ false || "default value"; // => "default value"
953
+ true || "never reached"; // => true
954
+
955
+ // Multiple arguments
956
+ &&(true, true, "all true"); // => "all true"
957
+ ||(false, false, "found"); // => "found"
958
+ ```
959
+
960
+ #### Null Coalescing
961
+
962
+ ```dvala
963
+ // Null coalescing operator
964
+ null ?? "default"; // => "default"
965
+ 0 ?? "default"; // => 0 (only null/undefined are coalesced)
966
+ false ?? "default"; // => false
967
+ "" ?? "default"; // => ""
968
+ ```
969
+
970
+ ### Ternary Operator
971
+
972
+ ```dvala
973
+ // Conditional expression
974
+ let age = 25;
975
+ let result = age >= 18 ? "adult" : "minor";
976
+
977
+ // Nested ternary
978
+ let score = 85;
979
+ let category = score >= 90 ? "A" : score >= 80 ? "B" : "C";
980
+
981
+ // With complex expressions
982
+ let isLoggedIn = () -> true;
983
+ let hasPermission = () -> true;
984
+ let status = isLoggedIn() && hasPermission() ? "authorized" : "unauthorized";
985
+ ```
986
+
987
+ ## Variable Names
988
+
989
+ Dvala is generous with variable naming conventions, allowing a wide range of characters that would be invalid in many other programming languages.
990
+
991
+ ### Basic Rules
992
+
993
+ Variable names in Dvala can contain almost any character except for a small set of reserved symbols. The only restrictions are:
994
+
995
+ **Illegal characters anywhere in a variable name:**
996
+ - Parentheses: `(` `)`
997
+ - Brackets: `[` `]`
998
+ - Braces: `{` `}`
999
+ - Quotes: `'` `"` `` ` ``
1000
+ - Punctuation: `,` `.` `;`
1001
+ - Whitespace: spaces, newlines, tabs
1002
+
1003
+ **Additional restrictions for the first character:**
1004
+ - Cannot start with digits `0-9`
1005
+
1006
+ ### Unicode and Emoji Support
1007
+
1008
+ Beyond these minimal restrictions, Dvala supports Unicode characters, including emojis, in variable names:
1009
+
1010
+ ```dvala
1011
+ // Unicode characters are welcome
1012
+ let résultat = 42;
1013
+ let naïve = "simple approach";
1014
+ let coöperation = "working together";
1015
+
1016
+ // Emojis work too!
1017
+ let 😅 = "grinning face with sweat";
1018
+ let 🚀 = "rocket ship";
1019
+ let result = 😅 ++ " " ++ 🚀;
1020
+ // => "grinning face with sweat rocket ship"
1021
+ ```
1022
+
1023
+ ### Quoted Variable Names
1024
+
1025
+ For cases where you need to use the normally illegal characters in variable names, Dvala supports quoted variable names using single quotes:
1026
+
1027
+ ```dvala
1028
+ // Variables with spaces and special characters
1029
+ let 'A strange variable' = 42;
1030
+ let 'user.name' = "John Doe";
1031
+ let 'data[0]' = "first element";
1032
+ let 'function()' = "callable";
1033
+
1034
+ // Access them the same way
1035
+ 'A strange variable' + 8;
1036
+ // => 50
1037
+ ```
1038
+
1039
+ ### Practical Examples
1040
+
1041
+ Here are some examples showcasing the flexibility of Dvala variable naming:
1042
+
1043
+ ```dvala
1044
+ // Mathematical notation with Greek letters (avoiding reserved symbols)
1045
+ let α = 0.5;
1046
+ let β = 1.2;
1047
+ let γ = 2.0;
1048
+ let Δ = β - α;
1049
+
1050
+ // Descriptive names with special characters
1051
+ let user-name = "alice";
1052
+ let is-valid? = true;
1053
+ let counter! = 0;
1054
+
1055
+ // Mixed styles
1056
+ let dataSet₁ = [1, 2, 3];
1057
+ let dataSet₂ = [4, 5, 6];
1058
+ let 🔧config = { debug: true };
1059
+ ```
1060
+
1061
+ ### Important: Operator Spacing
1062
+
1063
+ Due to Dvala' flexible variable naming, **operators must be separated by whitespace**. This is crucial to understand:
1064
+
1065
+ ```dvala
1066
+ // This is a variable name, NOT addition!
1067
+ let x+1 = 42;
1068
+ let result1 = x+1; // => 42
1069
+
1070
+ // To perform addition, use spaces
1071
+ let x = 5;
1072
+ let result2 = x + 1; // => 6
1073
+
1074
+ // More examples of what looks like operations but are actually variable names
1075
+ let a-b = "subtraction variable";
1076
+ let c*d = "multiplication variable";
1077
+ let e/f = "division variable";
1078
+ let g<h = "comparison variable";
1079
+
1080
+ // To use these as actual operations, add spaces
1081
+ let a = 10;
1082
+ let b = 3;
1083
+ let a-sum = a + b; // Addition
1084
+ let a-diff = a - b; // Subtraction
1085
+ let a-prod = a * b; // Multiplication
1086
+ let a-quot = a / b; // Division
1087
+ let a-comp = a < b; // Comparison
1088
+ ```
1089
+
1090
+ Without whitespace, Dvala treats the entire sequence as a single variable identifier. This applies to all operators, including comparison operators, logical operators, and arithmetic operators.
1091
+
1092
+ This flexibility allows for expressive and readable code while maintaining the functional programming paradigm that Dvala embodies.
1093
+ ## Operators and Functions
1094
+
1095
+ ### Algebraic Notation
1096
+
1097
+ All functions that take two parameters can be used as operators:
1098
+
1099
+ ```dvala
1100
+ // As a function
1101
+ max(5, 10); // => 10
1102
+
1103
+ // As an operator
1104
+ 5 max 10; // => 10
1105
+ ```
1106
+
1107
+ All operators can be used as functions:
1108
+
1109
+ ```dvala
1110
+ // As an operator
1111
+ 5 + 3; // => 8
1112
+
1113
+ // As a function
1114
+ +(5, 3); // => 8
1115
+
1116
+ // Partial application with underscore placeholder
1117
+ let add5 = +(5, _);
1118
+ add5(3); // => 8
1119
+
1120
+ // Multiple placeholders
1121
+ let subtractTwoValues = -(100, _, _);
1122
+ subtractTwoValues(4, 3); // => 93
1123
+
1124
+ // Single placeholder in different positions
1125
+ let subtract = -(_, 2);
1126
+ subtract(10); // => 8
1127
+
1128
+ let divide = /(10, _);
1129
+ divide(2); // => 5
1130
+ ```
1131
+
1132
+ ### Data Types as Functions
1133
+
1134
+ Dvala allows arrays, objects, numbers, and strings to be used as functions. This creates elegant, flexible code where data structures become accessors.
1135
+
1136
+ #### Arrays and Numbers as Index Accessors
1137
+
1138
+ Arrays can be called with an index to get an element, and numbers can be called with collections to access that index:
1139
+
1140
+ ```dvala
1141
+ let arr = [10, 20, 30, 40];
1142
+
1143
+ // Array as function (accessing by index)
1144
+ arr(0); // => 10
1145
+ arr(2); // => 30
1146
+
1147
+ // Number as function (accessing array at that index)
1148
+ 2(arr); // => 30 (same as arr(2))
1149
+ 0(arr); // => 10 (same as arr(0))
1150
+ ```
1151
+
1152
+ #### Strings and Numbers for Character Access
1153
+
1154
+ Similar to arrays, strings support indexed access in both directions:
1155
+
1156
+ ```dvala
1157
+ let name = "Albert";
1158
+
1159
+ // String as function (accessing character by index)
1160
+ name(0); // => "A"
1161
+ name(2); // => "b"
1162
+
1163
+ // Number as function (accessing string at that index)
1164
+ 2(name); // => "b" (same as name(2))
1165
+ 4(name); // => "r" (same as name(4))
1166
+ ```
1167
+
1168
+ #### Objects and Strings as Property Accessors
1169
+
1170
+ Objects can be called with property names, and strings can be called with objects to access properties:
1171
+
1172
+ ```dvala
1173
+ let person = { foo: 1, bar: 2, name: "John" };
1174
+
1175
+ // Object as function (accessing property by key)
1176
+ person("foo"); // => 1
1177
+ person("name"); // => "John"
1178
+
1179
+ // String as function (accessing object property)
1180
+ "foo"(person); // => 1 (same as person("foo"))
1181
+ "bar"(person); // => 2 (same as person("bar"))
1182
+ ```
1183
+
1184
+ #### Powerful Higher-Order Function Applications
1185
+
1186
+ This feature makes higher-order functions incredibly flexible. You can pass data directly as accessor functions:
1187
+
1188
+ ```dvala
1189
+ let data = [
1190
+ { name: "Alice", score: 95 },
1191
+ { name: "Bob", score: 87 },
1192
+ { name: "Carol", score: 92 }
1193
+ ];
1194
+
1195
+ // Extract names using string as function
1196
+ data map "name";
1197
+ // => ["Alice", "Bob", "Carol"]
1198
+
1199
+ // Extract scores using string as function
1200
+ data map "score";
1201
+ // => [95, 87, 92]
1202
+
1203
+ // Get second element of multiple arrays using number as function
1204
+ let arrays = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
1205
+ arrays map 1;
1206
+ // => [2, 5, 8]
1207
+
1208
+ // Access nested data
1209
+ let records = [
1210
+ { values: [10, 20, 30] },
1211
+ { values: [40, 50, 60] },
1212
+ { values: [70, 80, 90] }
1213
+ ];
1214
+
1215
+ // Get first value from each record's values array
1216
+ records map "values" map 0;
1217
+ // => [10, 40, 70]
1218
+ ```
1219
+
1220
+ #### Practical Examples
1221
+
1222
+ ```dvala
1223
+ // Matrix column extraction
1224
+ let matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
1225
+ matrix map 1; // => [2, 5, 8] (second column)
1226
+
1227
+ // Object property extraction
1228
+ let users = [
1229
+ { id: 1, active: true },
1230
+ { id: 2, active: false },
1231
+ { id: 3, active: true }
1232
+ ];
1233
+ users map "active"; // => [true, false, true]
1234
+
1235
+ // String character extraction
1236
+ let words = ["hello", "world", "test"];
1237
+ words map 0; // => ["h", "w", "t"] (first characters)
1238
+
1239
+ // Complex data navigation
1240
+ let sales = [
1241
+ { quarter: "Q1", regions: { north: 100, south: 200 } },
1242
+ { quarter: "Q2", regions: { north: 150, south: 180 } }
1243
+ ];
1244
+ sales map "regions" map "north"; // => [100, 150]
1245
+ ```
1246
+
1247
+ This feature eliminates the need for verbose accessor functions and makes data transformation pipelines more concise and readable.
1248
+
1249
+ ### Parameter Order
1250
+
1251
+ Dvala favors subject-first parameter order for better operator chaining:
1252
+
1253
+ ```dvala
1254
+ // Function style
1255
+ filter([1, 2, 3, 4], odd?); // => [1, 3]
1256
+
1257
+ // Operator style (more readable)
1258
+ [1, 2, 3, 4] filter odd?; // => [1, 3]
1259
+ ```
1260
+
1261
+ ### Pipe Operator
1262
+
1263
+ The pipe operator `|>` passes the result of the left expression as the first argument to the right function:
1264
+
1265
+ ```dvala
1266
+ // Without pipe operator
1267
+ reduce(map(filter([1, 2, 3, 4, 5, 6], odd?), -> $ * $), +, 0);
1268
+
1269
+ // With pipe operator (much more readable)
1270
+ [1, 2, 3, 4, 5, 6]
1271
+ |> filter(_, odd?)
1272
+ |> map(_, -> $ * $)
1273
+ |> reduce(_, +, 0);
1274
+ // => 35
1275
+
1276
+ // Simple transformations
1277
+ "hello world"
1278
+ |> upper-case
1279
+ |> split(_, " ")
1280
+ |> reverse
1281
+ |> join(_, "-");
1282
+ // => "WORLD-HELLO"
1283
+
1284
+ // Mathematical operations
1285
+ 10
1286
+ |> +(_, 5)
1287
+ |> *(_, 2)
1288
+ |> /(_, 3);
1289
+ // => 10 (10 + 5 = 15, 15 * 2 = 30, 30 / 3 = 10)
1290
+
1291
+ // Data processing pipeline
1292
+ { numbers: [1, 2, 3, 4, 5], multiplier: 3 }
1293
+ |> get(_, "numbers")
1294
+ |> filter(_, even?)
1295
+ |> map(_, *(_, 3))
1296
+ |> reduce(_, +, 0);
1297
+ // => 18 (even numbers [2, 4] -> [6, 12] -> sum = 18)
1298
+ ```
1299
+
1300
+ ### Operator Precedence
1301
+
1302
+ Dvala follows a specific operator precedence order that determines how expressions are evaluated. Operators with higher precedence are evaluated first. When operators have the same precedence, they are evaluated left-to-right.
1303
+
1304
+ Here's the complete precedence table, from highest to lowest:
1305
+
1306
+ | Precedence | Operator(s) | Description | Example |
1307
+ |------------|-------------|-------------|---------|
1308
+ | 12 | `^` | Exponentiation | `2 ^ 3 ^ 2` → `2 ^ (3 ^ 2)` → `512` |
1309
+ | 11 | `*` `/` `%` | Multiplication, Division, Remainder | `6 + 4 * 2` → `6 + 8` → `14` |
1310
+ | 10 | `+` `-` | Addition, Subtraction | `10 - 3 + 2` → `7 + 2` → `9` |
1311
+ | 9 | `<<` `>>` `>>>` | Bit shift operations | `8 >> 1 + 1` → `8 >> 2` → `2` |
1312
+ | 8 | `++` | String concatenation | `"a" ++ "b" ++ "c"` → `"abc"` |
1313
+ | 7 | `<` `<=` `>` `>=` | Comparison operators | `3 + 2 > 4` → `5 > 4` → `true` |
1314
+ | 6 | `==` `!=` | Equality operators | `2 * 3 == 6` → `6 == 6` → `true` |
1315
+ | 5 | `&` `xor` `\|` | Bitwise operations | `4 \| 2 & 1` → `4 \| 0` → `4` |
1316
+ | 4 | `&&` `\|\|` `??` | Logical operations | `true && false \|\| true` → `false \|\| true` → `true` |
1317
+ | 3 | *function operators* | Binary functions used as operators | `5 max 3 + 2` → `5 max 5` → `5` |
1318
+ | 2 | `\|>` | Pipe operator | `[1,2] \|> map(_, inc) \|> sum` |
1319
+ | 1 | `?` `:` | Conditional (ternary) operator | `true ? 1 + 2 : 3` → `true ? 3 : 3` → `3` |
1320
+
1321
+ #### Examples of Precedence in Action
1322
+
1323
+ ```dvala
1324
+ // Exponentiation has highest precedence
1325
+ 2 + 3 ^ 2; // => 2 + 9 = 11 (not 5^2 = 25)
1326
+
1327
+ // Multiplication before addition
1328
+ 2 + 3 * 4; // => 2 + 12 = 14 (not 5*4 = 20)
1329
+
1330
+ // String concatenation before comparison
1331
+ "a" ++ "b" == "ab"; // => "ab" == "ab" = true
1332
+
1333
+ // Comparison before logical AND
1334
+ 3 > 2 && 1 < 2; // => true && true = true
1335
+
1336
+ // Pipe has very low precedence
1337
+ let vec = import(vector);
1338
+ [1, 2, 3] |> map(_, inc) |> sum; // Evaluates left to right
1339
+
1340
+ // Conditional has lowest precedence
1341
+ true ? 2 + 3 : 4 + 5; // => true ? 5 : 9 = 5
1342
+ ```
1343
+
1344
+ #### Using Parentheses
1345
+
1346
+ When in doubt, or to make your intent clear, use parentheses to override precedence:
1347
+
1348
+ ```dvala
1349
+ // Without parentheses (follows precedence)
1350
+ 2 + 3 * 4; // => 14
1351
+
1352
+ // With parentheses (explicit grouping)
1353
+ (2 + 3) * 4; // => 20
1354
+
1355
+ // Complex expression with explicit grouping
1356
+ let a = 2;
1357
+ let b = 3;
1358
+ let c = 4;
1359
+ let d = true;
1360
+ let e = false;
1361
+ let f = 10;
1362
+ let g = 5;
1363
+ ((a + b) * c) > (d && e ? f : g) // => (5 * 4) > (false ? 10 : 5) = 20 > 5 = true;
1364
+ ```
1365
+
1366
+ #### Associativity
1367
+
1368
+ Most operators are left-associative, meaning they evaluate from left to right when they have the same precedence:
1369
+
1370
+ ```dvala
1371
+ 10 - 5 - 2; // => (10 - 5) - 2 = 3 (not 10 - (5 - 2) = 7)
1372
+ "a" ++ "b" ++ "c"; // => ("a" ++ "b") ++ "c" = "abc"
1373
+ ```
1374
+
1375
+ **Exception**: Exponentiation (`^`) is right-associative:
1376
+ ```dvala
1377
+ 2 ^ 3 ^ 2 // => 2 ^ (3 ^ 2) = 2 ^ 9 = 512 (not (2 ^ 3) ^ 2 = 64)
1378
+ ```
1379
+
1380
+ ## Built-in Functions
1381
+
1382
+ Dvala comes with a comprehensive standard library of functions for:
1383
+
1384
+ - **Arithmetic and Math**: Basic operations, trigonometry, logarithms, rounding
1385
+ - **Collections**: Working with arrays and objects (get, assoc, merge, etc.)
1386
+ - **Sequences**: Filtering, mapping, reducing, sorting, and transforming data
1387
+ - **Strings**: Manipulation, formatting, encoding, and pattern matching
1388
+ - **Predicates**: Type checking and condition testing functions
1389
+ - **Functional Programming**: Function composition, partial application, and utilities
1390
+ - **Regular Expressions**: Pattern matching and text processing
1391
+ - **Bitwise Operations**: Low-level bit manipulation
1392
+ - **Assertions**: Testing and validation utilities
1393
+
1394
+ For a complete reference of all available functions with examples, visit the [Dvala Playground](https://mojir.github.io/dvala/) where you can explore the interactive documentation and try functions in real-time.
1395
+
1396
+ ## Serialization
1397
+
1398
+ A unique feature of Dvala is that every result from evaluation is fully serializable as JSON, including functions and regular expressions:
1399
+
1400
+ ```dvala
1401
+ // Functions are serializable
1402
+ let myFunction = x -> x * 2;
1403
+
1404
+ // Regular expressions are serializable
1405
+ let myRegex = #"[a-z]+";
1406
+
1407
+ // Complex data structures with functions are serializable
1408
+ let config = {
1409
+ transform: x -> x * 3,
1410
+ pattern: #"\d+",
1411
+ data: [1, 2, 3]
1412
+ };
1413
+
1414
+ // All of these can be serialized to JSON and later deserialized
1415
+ // back into working Dvala values, preserving their functionality
1416
+ ```
1417
+
1418
+ ## File Value
1419
+
1420
+ A Dvala file evaluates to the value of its last expression:
1421
+
1422
+ ```dvala
1423
+ let pi = 3.14159;
1424
+ let square = x -> x * x;
1425
+ // The file's value is the result of the last expression
1426
+ {pi: pi, square: square}
1427
+ ```
1428
+
1429
+ ## Examples
1430
+
1431
+ ### Factorial
1432
+
1433
+ ```dvala
1434
+ let factorial = n -> n <= 1 ? 1 : n * self(n - 1);
1435
+
1436
+ factorial(5); // => 120
1437
+ ```
1438
+
1439
+ ### Array Processing
1440
+
1441
+ ```dvala
1442
+ let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
1443
+
1444
+ // Get even numbers squared
1445
+ let evenSquares = numbers
1446
+ |> filter(_, even?)
1447
+ |> map(_, -> $ * $);
1448
+ // => [4, 16, 36, 64, 100]
1449
+
1450
+ // Sum of odd numbers
1451
+ let oddSum = numbers
1452
+ |> filter(_, odd?)
1453
+ |> reduce(_, +, 0);
1454
+ // => 25
1455
+ ```
1456
+
1457
+ ### String Processing
1458
+
1459
+ ```dvala
1460
+ let text = "Hello, World! How are you today?";
1461
+
1462
+ // Word count
1463
+ let wordCount = text
1464
+ |> split(_, #"\s+")
1465
+ |> count;
1466
+ // => 6
1467
+
1468
+ // Uppercase words longer than 4 characters
1469
+ let longWords = text
1470
+ |> split(_, #"\s+")
1471
+ |> filter(_, -> count($) > 4)
1472
+ |> map(_, upper-case);
1473
+ // => ["HELLO,", "WORLD!", "TODAY?"]
1474
+ ```
1475
+
1476
+ ### Data Transformation
1477
+
1478
+ ```dvala
1479
+ let su = import(sequence);
1480
+ let users = [
1481
+ { name: "Alice", age: 30, department: "Engineering" },
1482
+ { name: "Bob", age: 25, department: "Marketing" },
1483
+ { name: "Charlie", age: 35, department: "Engineering" }
1484
+ ];
1485
+
1486
+ // Group by department and get average age
1487
+ let grouped = users |> su.group-by(_, "department");
1488
+ let departmentAges = grouped
1489
+ |> entries(_)
1490
+ |> map(_, ([dept, people]) -> do
1491
+ let ages = people |> map(_, "age");
1492
+ let total = ages |> reduce(_, +, 0);
1493
+ [dept, total / count(ages)]
1494
+ end)
1495
+ |> (pairs -> zipmap(map(pairs, 0), map(pairs, 1)));
1496
+ // => { "Engineering": 32.5, "Marketing": 25 }
1497
+ ```
1498
+
1499
+ ## JavaScript Interoperability
1500
+
1501
+ ### Entry Points and Bundles
1502
+
1503
+ The package provides multiple entry points for different use cases:
1504
+
1505
+ ```javascript
1506
+ // Minimal entry — core Dvala class, types, and type guards only.
1507
+ // No modules or reference data. Smallest bundle size.
1508
+ import { Dvala } from '@mojir/dvala';
1509
+
1510
+ // Full entry — everything from minimal plus all modules,
1511
+ // reference data, and API helpers (e.g. apiReference, isApiName).
1512
+ import { Dvala, allBuiltinModules, apiReference } from '@mojir/dvala/full';
1513
+
1514
+ // Individual module entries — import only the modules you need.
1515
+ import { vectorModule } from '@mojir/dvala/modules/vector';
1516
+ import { matrixModule } from '@mojir/dvala/modules/matrix';
1517
+ import { linearAlgebraModule } from '@mojir/dvala/modules/linearAlgebra';
1518
+ import { gridModule } from '@mojir/dvala/modules/grid';
1519
+ import { randomModule } from '@mojir/dvala/modules/random';
1520
+ import { assertModule } from '@mojir/dvala/modules/assertion';
1521
+ import { numberTheoryModule } from '@mojir/dvala/modules/numberTheory';
1522
+ ```
1523
+
1524
+ To make module functions available in Dvala code, pass them to the `Dvala` constructor:
1525
+
1526
+ ```javascript
1527
+ import { Dvala } from '@mojir/dvala';
1528
+ import { vectorModule } from '@mojir/dvala/modules/vector';
1529
+ import { matrixModule } from '@mojir/dvala/modules/matrix';
1530
+
1531
+ const dvala = new Dvala({ modules: [vectorModule, matrixModule] });
1532
+
1533
+ // Now you can use import(vector) and import(matrix) in Dvala code
1534
+ dvala.run('let v = import(vector); v.dot([1, 2, 3], [4, 5, 6])'); // => 32
1535
+ ```
1536
+
1537
+ ### Using Dvala in JavaScript
1538
+
1539
+ ```javascript
1540
+ import { Dvala } from '@mojir/dvala';
1541
+
1542
+ const dvala = new Dvala();
1543
+
1544
+ // Basic usage
1545
+ const result1 = dvala.run('+(1, 2, 3)');
1546
+ console.log(result1); // 6
1547
+
1548
+ // Provide JavaScript values
1549
+ const result2 = dvala.run('name ++ " is " ++ str(age)', {
1550
+ values: { name: 'John', age: 30 }
1551
+ });
1552
+ console.log(result2); // "John is 30"
1553
+
1554
+ // Expose JavaScript functions
1555
+ const result3 = dvala.run('myAlert("Hello from Dvala!")', {
1556
+ jsFunctions: {
1557
+ myAlert: {
1558
+ fn: (message) => console.log(`Alert: ${message}`),
1559
+ arity: { min: 1, max: 1 }
1560
+ }
1561
+ }
1562
+ });
1563
+
1564
+ // Execute Dvala code
1565
+ const result4 = dvala.run('+(5, 3)');
1566
+ ```
1567
+
1568
+ ### Dvala Class Methods
1569
+
1570
+ ```typescript
1571
+ interface Dvala {
1572
+ // Execute Dvala code directly
1573
+ run(programOrBundle: string | DvalaBundle, params?: ContextParams & FilePathParams): unknown
1574
+
1575
+ // Find undefined symbols in code
1576
+ getUndefinedSymbols(programOrAst: string | Ast, params?: ContextParams): Set<string>
1577
+
1578
+ // Parse pipeline
1579
+ tokenize(program: string, params?: FilePathParams & MinifyParams): TokenStream
1580
+ parse(tokenStream: TokenStream): Ast
1581
+
1582
+ // Apply Dvala function with JavaScript arguments
1583
+ apply(fn: DvalaFunction, fnParams: unknown[], params?: ContextParams): unknown
1584
+
1585
+ // Utility methods
1586
+ transformSymbols(tokenStream: TokenStream, transformer: (symbol: string) => string): TokenStream
1587
+ untokenize(tokenStream: TokenStream): string
1588
+ getRuntimeInfo(): DvalaRuntimeInfo
1589
+ }
1590
+ ```
1591
+
1592
+ ### Context Parameters
1593
+
1594
+ ```typescript
1595
+ interface ContextParams {
1596
+ globalContext?: Context // Global variable context
1597
+ contexts?: Context[] // Additional context layers
1598
+ values?: Record<string, unknown> // JavaScript values to expose
1599
+ jsFunctions?: Record<string, JsFunction> // JavaScript functions to expose
1600
+ globalModuleScope?: boolean // Make top-level let bindings persist in global context
1601
+ }
1602
+
1603
+ interface JsFunction {
1604
+ fn: (...args: any[]) => unknown // The JavaScript function
1605
+ arity?: Arity // Function arity constraints
1606
+ docString?: string // Documentation
1607
+ }
1608
+ ```
1609
+
1610
+ ## Learn More
1611
+
1612
+ - Try Dvala in the [online playground](https://mojir.github.io/dvala/)
1613
+ - Explore the comprehensive function reference
1614
+ - Check out more complex examples in the documentation
1615
+
1616
+ Dvala combines the elegance of functional programming with practical syntax, making it perfect for data transformation, mathematical computation, and any scenario where immutability and expressiveness are valued.