Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def Y[A, B](f: (A => B) => (A => B)): (A => B) = f(Y(f))(_)
- val fac = Y[Int, Int](f => i => if (i <= 0) 1 else f(i - 1) * i)
- fac(6)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement