Search results
Jul 16, 2011 · A Y-combinator is a "functional" (a function that operates on other functions) that enables recursion, when you can't refer to the function from within itself. In computer-science theory, it generalizes recursion, abstracting its implementation, and thereby separating it from the actual work of the function in question.
Aug 5, 2015 · To do this, I thought of using the Lambda Calculus' Y combinator. Here's the first definition: Y = λf.(λx.f(x x))(λx.f(x x)) Here's the reduced definition: Y g = g(Y g) I attempted to write them in C# like this: // Original. Lambda Y = f => (new Lambda(x => f(x(x)))(new Lambda(x => f(x(x))))); // Reduced.
I've recently come across this proposal that wants to add a Y Combinator to the Standard Library, and after reading it, it seems extremely similar to what I am doing here. Unfortunately, the concept of the Y Combinator still doesn't "click" for me - I am missing something and I cannot visualize how to generalize what I did with the self parameter for any function, avoiding the step boilerplate.
Jun 19, 2022 · 1. I found a implementation of Y-Combinator which supports Fn. However I want to have a version of FnMut. However, FnMut can not be wrapped into Rc, so I wrap them in Rc<RefCell>. The following code can make a[i] = i in a recursive way. It is the simplest code I have found to test if we can call itself inside a closure. move |i| {. if i < n ...
May 18, 2011 · EDIT: While chessweb or anyone else corroborates his answer, temporarily consider his answer correct and this one wrong. It seems the answer is yes. Apparently the exact same combinator appears here, midway down the page: (define Y. (lambda (f) (f (lambda (x) ((Y f) x))))) edited May 18, 2011 at 8:38. answered Jan 14, 2011 at 1:41.
Nov 29, 2011 · Thankfully the fathers of computing solved this problem ages ago by discovering Fixed-Point Combinators, with the most popular being the Y Combinator. I've made various attempts to get a Y combinator set up, but they can't get past the compiler.
fix2 is a y-combinator (specifically, it is a combinator for functions with two arguments; the first argument is the function (for the purpose of recursion), the second argument is a "proper" function argument). It creates recursive functions. bll::ret(...) appears to create some form of a function object, the body of which is
6. A combinator is function with no free variables. That means, amongst other things, that the combinator does not have dependencies on things outside of the function, only on the function parameters. Using F# this is my understanding of combinators: let sum a b = a + b;; //sum function (lambda)
Dec 28, 2022 · 383views. Understanding extra arguments in the Y Combinator in Scheme. According to RosettaCode, the Y Combinator in Scheme is implemented as (define Y (λ (h) ((λ (x) (x x)) (λ (g) (h (λ args (apply (g g) args)))))))Of course, the traditional Y ... scheme. y-combinator.
Feb 14, 2016 · So until our machines switch from Turing machines to running on lambda calculus, the Y combinator will be strictly academic. Note: other functional techniques related to the Y combinator are useful, so keep at it. Understanding the Y combinator will help you understand continuations, lazy evaluation, etc.