From 86bf5ed53df9fc9be388352e1609f5b2ea08bcfd Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 8 Sep 2024 14:51:06 +0200 Subject: [PATCH] Fixed y* --- std/List/Church.bruijn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/std/List/Church.bruijn b/std/List/Church.bruijn index 4b1470d..636e3aa 100644 --- a/std/List/Church.bruijn +++ b/std/List/Church.bruijn @@ -532,6 +532,12 @@ enumerate zip (iterate ++‣ (+0)) ⧗ (List a) → (List (Pair Number a)) :test (enumerate "abc") (((+0) : 'a') : (((+1) : 'b') : {}((+2) : 'c'))) # calculates all fixed points of given functions as a list -y* y [[&(1 0) <$> 0]] +y* [[[0 1] <$> 0] xs] ⧗ (List a) → (List b) + xs [[1 0)]] <$> 0 :test (&(+5) <$> (y* ([[[=?0 true (1 --0)]]] : {}[[[=?0 false (2 --0)]]]))) (false : {}true) + +# similar to y* but passes arguments as a list +list-y* y [[&(1 0) <$> 0]] + +:test (&(+5) <$> (list-y* ([[=?0 true (_1 --0)]] : {}[[=?0 false (^1 --0)]]))) (false : {}true)