Created
October 15, 2023 17:02
-
-
Save y-yu/c77e975a6ccbfc61ac731ce7d4b94f85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nextpair (@z ->) (-> @y) = @z -> unpair (fst:-> @f) (snd:-> copy (-> id ->:fst) (-> + @f ->:snd) pair -> @y) | |
next (@x ->) (-> @y) = nextpair (fib (@x - 1)) -> @y | |
fib (@x ->) (-> @y) = @x -> if (@x == 0 || @x == 1) (then:-> (1, 1) ->) (else:-> next ->) merge -> @y | |
:{ | |
@x'0 -> fib -> unpair (fst:-> @t) (snd:-> output) | |
@x'0 + 1 -> @x | |
:} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment