@dallaylaen/ski-interpreter 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.3.2] - 2026-03-01
9
+
10
+ ### Added
11
+
12
+ - `SKI.extras.foldr(expr: Expr, fun: (expr: Expr, args: T[]) => T): T` (experimental) -
13
+ apply function `fun` to every term in root position in a subexpression,
14
+ followed by the result of folding its arguments.
15
+
8
16
  ## [2.3.1] - 2026-03-01
9
17
 
10
18
  ### Fixed
@@ -2220,7 +2220,11 @@ var require_extras = __commonJS({
2220
2220
  return s.format({ inventory: res.env });
2221
2221
  }).join("; ");
2222
2222
  }
2223
- module2.exports = { search, deepFormat, declare };
2223
+ function foldr(expr, fun) {
2224
+ const [head, ...tail] = expr.unroll();
2225
+ return fun(head, tail.map((e) => foldr(e, fun)));
2226
+ }
2227
+ module2.exports = { search, deepFormat, declare, foldr };
2224
2228
  }
2225
2229
  });
2226
2230