summaryrefslogtreecommitdiff
path: root/test/test.ts
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2025-11-05 01:20:07 -0800
committerKai Stevenson <kai@kaistevenson.com>2025-11-06 20:28:00 -0800
commitd8a969e231135978c4dd1fa67559101f506ad6f3 (patch)
tree7a556db33abe541fa3f5902690ca93d782c0ecc7 /test/test.ts
parente86c68dffaffee6ba44d98ba06761245f6d5b670 (diff)
recursion works for types with depth limit 5
Diffstat (limited to 'test/test.ts')
-rw-r--r--test/test.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test.ts b/test/test.ts
index 672fb4e..5e884ab 100644
--- a/test/test.ts
+++ b/test/test.ts
@@ -1,4 +1,4 @@
-import { createFn } from "../src";
+import { _Evaluate, createFn } from "../src";
const KS_boolToBin = "fn(b, ?(b, 1, 0))";
@@ -6,5 +6,10 @@ const boolArrToBinaryArr = createFn<[boolean[]]>()(
`fn(boolArr, map(boolArr, ${KS_boolToBin}))`
);
-const result = boolArrToBinaryArr([true, false, true]);
-console.log(result);
+const factorial = createFn<[number]>()(
+ `bind(fac,fn(n,?(eq(n, 1),n,mul(n,call(fac,sub(n,1))))))`
+);
+
+const res = factorial(6);
+
+// console.log(factorial(2));