Submitted by flabberghaster in just_post
Specifically i can't understand how the Y combinator works, how do you make a recursive function, all the explanations i have read make no sense.
Submitted by flabberghaster in just_post
Specifically i can't understand how the Y combinator works, how do you make a recursive function, all the explanations i have read make no sense.
musou wrote (edited )
it doesn't let you write a recursive function the normal way, instead you write a function that takes a function as input (so you can introudce a stand-in name for the recursive call) and returns the function you want to write recursively except you call the input function in place of the recursive step. then you pass that through the y combinator to get it to work. here's an untested example in elixir because it's what i think in