diff options
author | Marvin Borner | 2024-09-08 14:51:06 +0200 |
---|---|---|
committer | Marvin Borner | 2024-09-08 14:51:06 +0200 |
commit | 86bf5ed53df9fc9be388352e1609f5b2ea08bcfd (patch) | |
tree | 863c923d206c20cd6ffde0c4def225fda680062c /std/List/Church.bruijn | |
parent | 8896fb6d8507f28708699e54a4fd03288b05d5b3 (diff) |
Fixed y*
Diffstat (limited to 'std/List/Church.bruijn')
-rw-r--r-- | std/List/Church.bruijn | 8 |
1 files changed, 7 insertions, 1 deletions
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 <! ([[1 2 0]] <$> 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) |