Skip to content

Instantly share code, notes, and snippets.

@zraffer
Created August 18, 2015 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zraffer/54573e79b2793da67447 to your computer and use it in GitHub Desktop.
Save zraffer/54573e79b2793da67447 to your computer and use it in GitHub Desktop.
get Y-combinator from infinite number
module iterY
total
iter : Nat->(x->x)->(x->x)
iter Z f = id
iter (S n) f = f . (iter n f)
partial
inf : Nat
inf = S inf
partial
myY : (x->x)->(x->x)
myY = iter inf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment