Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize nested lambdas with closures #350

Open
dadhi opened this issue Oct 2, 2022 · 0 comments
Open

Optimize nested lambdas with closures #350

dadhi opened this issue Oct 2, 2022 · 0 comments
Assignees

Comments

@dadhi
Copy link
Owner

dadhi commented Oct 2, 2022

Currently FEC stores the data in the nested lambda closure and then calls method Curry to remove the closure from the lambda signature.
For example for nested Func<int> the Curry is Func<int> Curry(Func<Closure, int> f, Closure c) => () => f(c). It means that Curry creates another closure over f and c.

To avoid that, we may store the f in c and use an extension method for closure to use the closure as target, e.g. T Closure.Func<T>(this Closure c) => c.f(c); and use it as Func<int> f = c.Func<int> which is not a valid C#.

@dadhi dadhi self-assigned this Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant