Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@palladin
Created May 25, 2017 15:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save palladin/d7103bd31dcac1734a285067dcf2dedf to your computer and use it in GitHub Desktop.
Save palladin/d7103bd31dcac1734a285067dcf2dedf to your computer and use it in GitHub Desktop.
Y combinator (dynamic)
using System;
public class C {
public void M() {
Func<Func<dynamic, dynamic>, dynamic> fd = x => x;
dynamic Y = fd(f => fd(x => f(fd(y => x(x)(y))))(fd(x => f(fd(y => x(x)(y))))));
Y(fd(f => fd(x => f(x))))(42);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment