Last active
October 18, 2018 14:57
-
-
Save Odomontois/f4b7a22ac87bc5f387708a0e57ee2748 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
def fix[A](f: A => A): A = f(fix(f)) | |
val fib = fix[Int => Int]( recur => n => | |
if (n <= 1) 1 | |
else recur(n - 1) + recur(n - 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment