Skip to content

Instantly share code, notes, and snippets.

@Odomontois
Last active October 18, 2018 14:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Odomontois/f4b7a22ac87bc5f387708a0e57ee2748 to your computer and use it in GitHub Desktop.
Save Odomontois/f4b7a22ac87bc5f387708a0e57ee2748 to your computer and use it in GitHub Desktop.
Поправь так, чтобы работало
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