You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
staticFunc<TIn,TOut>Prec<TIn,TOut>(Func<TIn,Func<TIn,TOut>,TOut>rec){
TOut Hehe(TIninput){return rec(input,static i => Hehe(i));// do not eta reduce!}returnHehe;}
Together with memoization, we could anonymously define, say, fibonacci:
varfib= Mem(Prec(inti,Func<int,int>fib)=> i switch0 or 1=>1,var n => fib(i-1)+ fib(i-2)}));
The text was updated successfully, but these errors were encountered:
For recursion for anonymous functions:
PoC implementation:
Together with memoization, we could anonymously define, say,
fibonacci
:The text was updated successfully, but these errors were encountered: